includes/common.php
changeset 678 c5d4ce19e640
parent 666 402adf8ea719
child 685 17ebe24cdf85
equal deleted inserted replaced
677:2a263b598a2b 678:c5d4ce19e640
   390 
   390 
   391   // All checks passed! Start the main components up.  
   391   // All checks passed! Start the main components up.  
   392   $session->start();
   392   $session->start();
   393   
   393   
   394   // Grab language strings from the database
   394   // Grab language strings from the database
   395   $lang->fetch();
   395   if ( is_object(@$lang) )
   396   profiler_log('Fetched language strings');
   396   {
       
   397     $lang->fetch();
       
   398     profiler_log('Fetched language strings');
       
   399   }
   397   
   400   
   398   // Add all of our built in special pages
   401   // Add all of our built in special pages
   399   SpecialUserFuncs_paths_init();
   402   foreach ( array('SpecialUserFuncs', 'SpecialPageFuncs', 'SpecialAdmin', 'SpecialCSS', 'SpecialUpDownload', 'SpecialSearch', 'PrivateMessages', 'SpecialGroups', 'SpecialRecentChanges') as $plugin )
   400   SpecialPageFuncs_paths_init();
   403   {
   401   SpecialAdmin_paths_init();
   404     $funcname = "{$plugin}_paths_init";
   402   SpecialCSS_paths_init();
   405     if ( function_exists($funcname) )
   403   SpecialUpDownload_paths_init();
   406     {
   404   SpecialSearch_paths_init();
   407       $funcname();
   405   PrivateMessages_paths_init();
   408     }
   406   SpecialGroups_paths_init();
   409   }
   407   SpecialRecentChanges_paths_init();
       
   408   profiler_log('Added special pages');
   410   profiler_log('Added special pages');
   409   
   411   
   410   // This is where plugins will want to add pages from 1.1.x on out. You can still add
   412   // This is where plugins will want to add pages from 1.1.x on out. You can still add
   411   // pages at base_classes_initted but the titles won't be localized. This is because
   413   // pages at base_classes_initted but the titles won't be localized. This is because
   412   // the session manager has to be started before localization will work in the user's
   414   // the session manager has to be started before localization will work in the user's
   419   
   421   
   420   profiler_log('Ran session_started hook');
   422   profiler_log('Ran session_started hook');
   421   
   423   
   422   $paths->init();
   424   $paths->init();
   423   
   425   
   424   // We're ready for whatever life throws us now.
   426   // We're ready for whatever life throws us now, at least from an API point of view.
   425   define('ENANO_MAINSTREAM', '');
   427   define('ENANO_MAINSTREAM', '');
   426   
   428   
   427   // If the site is disabled, bail out, unless we're trying to log in or administer the site
   429   // If the site is disabled, bail out, unless we're trying to log in or administer the site
   428   if(getConfig('site_disabled') == '1' && $session->user_level < USER_LEVEL_ADMIN)
   430   if(getConfig('site_disabled') == '1' && $session->user_level < USER_LEVEL_ADMIN)
   429   {
   431   {
       
   432     // is this one of the more critical special pages?
   430     if ( $paths->namespace == 'Admin' || ( $paths->namespace == 'Special' && ( $paths->page_id == 'CSS' || $paths->page_id == 'Administration' || $paths->page_id == 'Login' ) ) )
   433     if ( $paths->namespace == 'Admin' || ( $paths->namespace == 'Special' && ( $paths->page_id == 'CSS' || $paths->page_id == 'Administration' || $paths->page_id == 'Login' ) ) )
   431     {
   434     {
   432       // do nothing; allow execution to continue
   435       // yeah, we need to keep this page available. do nothing; allow execution to continue
   433     }
   436     }
   434     else
   437     else
   435     {
   438     {
   436       if(!$n = getConfig('site_disabled_notice')) 
   439       if(!$n = getConfig('site_disabled_notice')) 
   437       {
   440       {