Index: trunk/globals.php =================================================================== diff -u -N -r4002 -r4077 --- trunk/globals.php (.../globals.php) (revision 4002) +++ trunk/globals.php (.../globals.php) (revision 4077) @@ -87,16 +87,23 @@ $LogFile = NULL; /** - * @return object - * @desc Returns reference to database connection -*/ -function &GetADODBConnection() + * Returns reference to database connection + * + * @param bool $new_type Return Kernel4 or in-portal connection object + * @return kDBConnection + */ +function &GetADODBConnection($new_type = false) { static $DB = null; global $g_DBType, $g_DBHost, $g_DBUser, $g_DBUserPassword, $g_DBName, $g_DebugMode; global $ADODB_FETCH_MODE, $ADODB_COUNTRECS, $ADODB_CACHE_DIR, $pathtoroot; + if ($new_type) { + $application =& kApplication::Instance(); + return $application->GetADODBConnection(); + } + if( !isset($DB) && strlen($g_DBType) > 0 ) { $DB = ADONewConnection($g_DBType);