Index: trunk/kernel/startup.php =================================================================== diff -u -r657 -r658 --- trunk/kernel/startup.php (.../startup.php) (revision 657) +++ trunk/kernel/startup.php (.../startup.php) (revision 658) @@ -1,185 +1,185 @@ -$v) -// $a[$k]=is_array($v)?stripSlashesA($v):stripslashes($v); -// return $a; -// } -// foreach(Array( -// 'HTTP_GET_VARS','HTTP_POST_VARS','HTTP_COOKIE_VARS','HTTP_SESSION_VARS','HTTP_SERVER_VARS','$HTTP_POST_FILES', -// '_POST','_GET','_COOKIE','_SESSION','_SERVER','_FILES','_REQUEST') as $_) -// if(isset($GLOBALS[$_])) -// $GLOBALS[$_]=stripSlashesA($GLOBALS[$_]); -//} - -if(!get_magic_quotes_gpc()) -{ - function addSlashesA($a) - { - foreach($a as $k=>$v) - $a[$k]=is_array($v)?addSlashesA($v):addslashes($v); - return $a; - } - foreach(Array( - 'HTTP_GET_VARS','HTTP_POST_VARS','HTTP_COOKIE_VARS','HTTP_SESSION_VARS','HTTP_SERVER_VARS','$HTTP_POST_FILES', - '_POST','_GET','_COOKIE','_SESSION','_SERVER','_FILES','_REQUEST') as $_) - if(isset($GLOBALS[$_])) - $GLOBALS[$_]=addSlashesA($GLOBALS[$_]); -} - -function inp_htmlize($var,$strip=0) -{ - if(is_array($var)) - foreach($var as $k=>$v) - $var[$k]=inp_htmlize($v,$strip); - else - $var=htmlspecialchars($strip?stripslashes($var):$var); - return $var; -} -/* - startup.php: this is the primary startup sequence for in-portal services -*/ -if( file_exists($pathtoroot.'debug.php') && !defined('DEBUG_MODE') ) include_once($pathtoroot.'debug.php'); -if( !defined('DEBUG_MODE') ) error_reporting(0); - -ini_set('memory_limit', '16M'); -ini_set('include_path', '.'); - -$kernel_version = "1.0.0"; -$FormError = array(); -$FormValues = array(); -/* include PHP version compatibility functions */ -require_once($pathtoroot."compat.php"); -/* set global variables and module lists */ -require_once($pathtoroot."globals.php"); - -LogEntry("Initalizing System..\n"); -/* for 64 bit timestamps */ -require_once($pathtoroot."kernel/include/adodb/adodb-time.inc.php"); -require_once($pathtoroot."kernel/include/dates.php"); - -/* create the global error object */ -require_once($pathtoroot."kernel/include/error.php"); -$Errors = new clsErrorManager(); - -require_once($pathtoroot."kernel/include/itemdb.php"); -require_once($pathtoroot."kernel/include/config.php"); -/* create the global configuration object */ -LogEntry("Creating Config Object..\n"); -$objConfig = new clsConfig(); -$objConfig->Load(); /* Populate our configuration data */ -LogEntry("Done Loading Configuration\n"); -if( defined('ADODB_EXTENSION') && constant('ADODB_EXTENSION') > 0 ) - LogEntry("ADO Extension: ".ADODB_EXTENSION."\n"); - -require_once($pathtoroot."kernel/include/parseditem.php"); -require_once($pathtoroot."kernel/include/item.php"); -require_once($pathtoroot."kernel/include/syscache.php"); -require_once($pathtoroot."kernel/include/modlist.php"); -require_once($pathtoroot."kernel/include/searchconfig.php"); -require_once($pathtoroot."kernel/include/banrules.php"); - -$objModules = new clsModList(); -$objSystemCache = new clsSysCacheList(); -$objSystemCache->PurgeExpired(); -$objBanList = new clsBanRuleList(); - -require_once($pathtoroot."kernel/include/image.php"); - -require_once($pathtoroot."kernel/include/itemtypes.php"); -$objItemTypes = new clsItemTypeList(); - -require_once($pathtoroot."kernel/include/theme.php"); -$objThemes = new clsThemeList(); - -require_once($pathtoroot."kernel/include/language.php"); -$objLanguages = new clsLanguageList(); -$objImageList = new clsImageList(); - -/* Load session and user class definitions */ -//require_once("include/customfield.php"); -//require_once("include/custommetadata.php"); -require_once($pathtoroot."kernel/include/usersession.php"); -require_once($pathtoroot."kernel/include/favorites.php"); -require_once($pathtoroot."kernel/include/portaluser.php"); -require_once($pathtoroot."kernel/include/portalgroup.php"); - -/* create the user management class */ -$objFavorites = new clsFavoriteList(); -$objUsers = new clsUserManager(); -$objGroups = new clsGroupList(); - -require_once($pathtoroot."kernel/include/cachecount.php"); -require_once($pathtoroot."kernel/include/customfield.php"); -require_once($pathtoroot."kernel/include/custommetadata.php"); -require_once($pathtoroot."kernel/include/permissions.php"); -require_once($pathtoroot."kernel/include/relationship.php"); -require_once($pathtoroot."kernel/include/category.php"); -require_once($pathtoroot."kernel/include/statitem.php"); -/* category base class, used by all the modules at some point */ -$objPermissions = new clsPermList(); -$objPermCache = new clsPermCacheList(); - -$objCatList = new clsCatList(); -$objCustomFieldList = new clsCustomFieldList(); -$objCustomDataList = new clsCustomDataList(); -$objCountCache = new clsCacheCountList(); - -require_once($pathtoroot."kernel/include/smtp.php"); -require_once($pathtoroot."kernel/include/emailmessage.php"); -require_once($pathtoroot."kernel/include/events.php"); -LogEntry("Creating Mail Queue..\n"); -$objMessageList = new clsEmailMessageList(); -$objEmailQueue = new clsEmailQueue(); -LogEntry("Done creating Mail Queue Objects\n"); - -require_once($pathtoroot."kernel/include/searchitems.php"); -require_once($pathtoroot."kernel/include/advsearch.php"); - -require_once($pathtoroot."kernel/include/parse.php"); -require_once($pathtoroot."kernel/include/socket.php"); - -/* responsible for including module code as required - This script also creates an instance of the user session onject and - handles all session management. The global session object is created - and populated, then the global user object is created and populated - - each module's parser functions and action code is included here -*/ - -LogEntry("Startup complete\n"); -include_once("include/modules.php"); - -if( defined('DEBUG_MODE') && constant('DEBUG_MODE') == 1 && function_exists('DebugByFile') ) DebugByFile(); - -/* startup is complete, so now check the mail queue to see if there's anything that needs to be sent*/ -$objEmailQueue->SendMailQeue(); - - $ado=&GetADODBConnection(); - $rs = $ado->Execute("SELECT * FROM ".GetTablePrefix()."Modules WHERE LoadOrder = 0"); - - $kernel_version = $rs->fields['Version']; - - -$adminDir = $objConfig->Get("AdminDirectory"); -if ($adminDir == '') { - $adminDir = 'admin'; -} - -if (strstr(__FILE__, $adminDir) && !GetVar('logout') && !strstr(__FILE__, "install") && !strstr(__FILE__, "index")) { - //echo "testz [".admin_login()."]
"; - - if (!admin_login()) - { - if( !headers_sent() ) setcookie("sid"," ",time()-3600); - $objSession->Logout(); - $url_add = isset($_GET['expired']) && $_GET['expired'] ? '?expired=1' : ''; - header("Location: ".$adminURL.'/login.php'.$url_add); - die(); - //require_once($pathtoroot."admin/login.php"); - } -} - +$v) +// $a[$k]=is_array($v)?stripSlashesA($v):stripslashes($v); +// return $a; +// } +// foreach(Array( +// 'HTTP_GET_VARS','HTTP_POST_VARS','HTTP_COOKIE_VARS','HTTP_SESSION_VARS','HTTP_SERVER_VARS','$HTTP_POST_FILES', +// '_POST','_GET','_COOKIE','_SESSION','_SERVER','_FILES','_REQUEST') as $_) +// if(isset($GLOBALS[$_])) +// $GLOBALS[$_]=stripSlashesA($GLOBALS[$_]); +//} + +if(!get_magic_quotes_gpc()) +{ + function addSlashesA($a) + { + foreach($a as $k=>$v) + $a[$k]=is_array($v)?addSlashesA($v):addslashes($v); + return $a; + } + foreach(Array( + 'HTTP_GET_VARS','HTTP_POST_VARS','HTTP_COOKIE_VARS','HTTP_SESSION_VARS','HTTP_SERVER_VARS','$HTTP_POST_FILES', + '_POST','_GET','_COOKIE','_SESSION','_SERVER','_FILES','_REQUEST') as $_) + if(isset($GLOBALS[$_])) + $GLOBALS[$_]=addSlashesA($GLOBALS[$_]); +} + +function inp_htmlize($var,$strip=0) +{ + if(is_array($var)) + foreach($var as $k=>$v) + $var[$k]=inp_htmlize($v,$strip); + else + $var=htmlspecialchars($strip?stripslashes($var):$var); + return $var; +} +/* + startup.php: this is the primary startup sequence for in-portal services +*/ +if( file_exists($pathtoroot.'debug.php') && !defined('DEBUG_MODE') ) include_once($pathtoroot.'debug.php'); +if( !defined('DEBUG_MODE') ) error_reporting(0); + +ini_set('memory_limit', '16M'); +ini_set('include_path', '.'); + +$kernel_version = "1.0.0"; +$FormError = array(); +$FormValues = array(); +/* include PHP version compatibility functions */ +require_once($pathtoroot."compat.php"); +/* set global variables and module lists */ +require_once($pathtoroot."globals.php"); + +LogEntry("Initalizing System..\n"); +/* for 64 bit timestamps */ +require_once($pathtoroot."kernel/include/adodb/adodb-time.inc.php"); +require_once($pathtoroot."kernel/include/dates.php"); + +/* create the global error object */ +require_once($pathtoroot."kernel/include/error.php"); +$Errors = new clsErrorManager(); + +require_once($pathtoroot."kernel/include/itemdb.php"); +require_once($pathtoroot."kernel/include/config.php"); +/* create the global configuration object */ +LogEntry("Creating Config Object..\n"); +$objConfig = new clsConfig(); +$objConfig->Load(); /* Populate our configuration data */ +LogEntry("Done Loading Configuration\n"); +if( defined('ADODB_EXTENSION') && constant('ADODB_EXTENSION') > 0 ) + LogEntry("ADO Extension: ".ADODB_EXTENSION."\n"); + +require_once($pathtoroot."kernel/include/parseditem.php"); +require_once($pathtoroot."kernel/include/item.php"); +require_once($pathtoroot."kernel/include/syscache.php"); +require_once($pathtoroot."kernel/include/modlist.php"); +require_once($pathtoroot."kernel/include/searchconfig.php"); +require_once($pathtoroot."kernel/include/banrules.php"); + +$objModules = new clsModList(); +$objSystemCache = new clsSysCacheList(); +$objSystemCache->PurgeExpired(); +$objBanList = new clsBanRuleList(); + +require_once($pathtoroot."kernel/include/image.php"); + +require_once($pathtoroot."kernel/include/itemtypes.php"); +$objItemTypes = new clsItemTypeList(); + +require_once($pathtoroot."kernel/include/theme.php"); +$objThemes = new clsThemeList(); + +require_once($pathtoroot."kernel/include/language.php"); +$objLanguages = new clsLanguageList(); +$objImageList = new clsImageList(); + +/* Load session and user class definitions */ +//require_once("include/customfield.php"); +//require_once("include/custommetadata.php"); +require_once($pathtoroot."kernel/include/usersession.php"); +require_once($pathtoroot."kernel/include/favorites.php"); +require_once($pathtoroot."kernel/include/portaluser.php"); +require_once($pathtoroot."kernel/include/portalgroup.php"); + +/* create the user management class */ +$objFavorites = new clsFavoriteList(); +$objUsers = new clsUserManager(); +$objGroups = new clsGroupList(); + +require_once($pathtoroot."kernel/include/cachecount.php"); +require_once($pathtoroot."kernel/include/customfield.php"); +require_once($pathtoroot."kernel/include/custommetadata.php"); +require_once($pathtoroot."kernel/include/permissions.php"); +require_once($pathtoroot."kernel/include/relationship.php"); +require_once($pathtoroot."kernel/include/category.php"); +require_once($pathtoroot."kernel/include/statitem.php"); +/* category base class, used by all the modules at some point */ +$objPermissions = new clsPermList(); +$objPermCache = new clsPermCacheList(); + +$objCatList = new clsCatList(); +$objCustomFieldList = new clsCustomFieldList(); +$objCustomDataList = new clsCustomDataList(); +$objCountCache = new clsCacheCountList(); + +require_once($pathtoroot."kernel/include/smtp.php"); +require_once($pathtoroot."kernel/include/emailmessage.php"); +require_once($pathtoroot."kernel/include/events.php"); +LogEntry("Creating Mail Queue..\n"); +$objMessageList = new clsEmailMessageList(); +$objEmailQueue = new clsEmailQueue(); +LogEntry("Done creating Mail Queue Objects\n"); + +require_once($pathtoroot."kernel/include/searchitems.php"); +require_once($pathtoroot."kernel/include/advsearch.php"); + +require_once($pathtoroot."kernel/include/parse.php"); +require_once($pathtoroot."kernel/include/socket.php"); + +/* responsible for including module code as required + This script also creates an instance of the user session onject and + handles all session management. The global session object is created + and populated, then the global user object is created and populated + + each module's parser functions and action code is included here +*/ + +LogEntry("Startup complete\n"); +include_once("include/modules.php"); + +if( defined('DEBUG_MODE') && constant('DEBUG_MODE') == 1 && function_exists('DebugByFile') ) DebugByFile(); + +/* startup is complete, so now check the mail queue to see if there's anything that needs to be sent*/ +$objEmailQueue->SendMailQeue(); + + $ado=&GetADODBConnection(); + $rs = $ado->Execute("SELECT * FROM ".GetTablePrefix()."Modules WHERE LoadOrder = 0"); + + $kernel_version = $rs->fields['Version']; + + +$adminDir = $objConfig->Get("AdminDirectory"); +if ($adminDir == '') { + $adminDir = 'admin'; +} + +if (strstr(__FILE__, $adminDir) && !GetVar('logout') && !strstr(__FILE__, "install") && !strstr(__FILE__, "index")) { + //echo "testz [".admin_login()."]
"; + + if (!admin_login()) + { + if( !headers_sent() ) setcookie("sid"," ",time()-3600); + $objSession->Logout(); + $url_add = isset($_GET['expired']) && $_GET['expired'] ? '?expired=1' : ''; + header("Location: ".$adminURL.'/login.php'.$url_add); + die(); + //require_once($pathtoroot."admin/login.php"); + } +} + ?> \ No newline at end of file