getValue('appearance','theme')))) && is_file(realpath(sprintf('css/%s/%s',$_SESSION[APPCONFIG]->getValue('appearance','theme'),$_SESSION[APPCONFIG]->getValue('appearance','stylesheet'))))) $app['theme'] = $_SESSION[APPCONFIG]->getValue('appearance','theme'); define('CSSDIR',sprintf('css/%s',$app['theme'])); define('IMGDIR',sprintf('images/%s',$app['theme'])); # Initialise the hooks if (file_exists(LIBDIR.'hooks.php')) require_once LIBDIR.'hooks.php'; # If we get here, and $_SESSION[APPCONFIG] is not set, then redirect the user to the index. if (isset($_SERVER['SERVER_SOFTWARE']) && ! isset($_SESSION[APPCONFIG])) { if ($_SERVER['QUERY_STRING']) header(sprintf('Location: index.php?URI=%s',base64_encode($_SERVER['QUERY_STRING']))); else header('Location: index.php'); die(); } else { # SF Bug #1903987 if (! method_exists($_SESSION[APPCONFIG],'CheckCustom')) error('Unknown situation, $_SESSION[APPCONFIG] exists, but method CheckCustom() does not','error',null,true,true); # Check our custom variables. # @todo Change this so that we dont process a cached session. $_SESSION[APPCONFIG]->CheckCustom(); } # Set our timezone, if it is specified in config.php if ($_SESSION[APPCONFIG]->getValue('appearance','timezone')) date_default_timezone_set($_SESSION[APPCONFIG]->getValue('appearance','timezone')); # Set our PHP timelimit. if ($_SESSION[APPCONFIG]->getValue('session','timelimit') && ! @ini_get('safe_mode')) set_time_limit($_SESSION[APPCONFIG]->getValue('session','timelimit')); setlanguage(); /** * Strip slashes from GET, POST, and COOKIE variables if this * PHP install is configured to automatically addslashes() */ if (@get_magic_quotes_gpc() && (! isset($slashes_stripped) || ! $slashes_stripped)) { array_stripslashes($_REQUEST); array_stripslashes($_GET); array_stripslashes($_POST); array_stripslashes($_COOKIE); $slashes_stripped = true; } # Create our application repository variable. $app['server'] = $_SESSION[APPCONFIG]->getServer(get_request('server_id','REQUEST')); /** * Look/evaluate our timeout */ if (! $app['server']->isSessionValid()) { system_message(array( 'title'=>('Session Timed Out'), 'body'=>sprintf('%s %s %s', ('Your Session timed out after'),$app['server']->getValue('login','timeout'), ('min. of inactivity. You have been automatically logged out.')), 'type'=>'info'),sprintf('index.php?server_id=%s&refresh=SID_%s',$app['server']->getIndex(),$app['server']->getIndex())); die(); } # If syslog is enabled, we need to include the supporting file. if ($_SESSION[APPCONFIG]->getValue('debug','syslog')) require LIBDIR.'syslog.php'; /** * At this point we have read all our additional function PHP files and our configuration. * If we are using hooks, run the session_init hook. */ if (function_exists('run_hook')) run_hook('post_session_init',array()); ?>