diff -r dc8741857bde -r 4d87aad3c4c0 includes/common.php --- a/includes/common.php Thu Jun 28 15:26:40 2007 -0400 +++ b/includes/common.php Sun Jul 01 14:08:39 2007 -0400 @@ -191,56 +191,59 @@ define('ENANO_BASE_CLASSES_INITIALIZED', ''); -$code = $plugins->setHook('base_classes_initted'); -foreach ( $code as $cmd ) +if ( !defined('IN_ENANO_INSTALL') ) { - eval($cmd); -} + $code = $plugins->setHook('base_classes_initted'); + foreach ( $code as $cmd ) + { + eval($cmd); + } + + $p = RenderMan::strToPageId($paths->get_pageid_from_url()); + if( ( $p[1] == 'Admin' || $p[1] == 'Special' ) && function_exists('page_'.$p[1].'_'.$p[0].'_preloader')) + { + @call_user_func('page_'.$p[1].'_'.$p[0].'_preloader'); + } + + $session->start(); + $paths->init(); + + define('ENANO_MAINSTREAM', ''); -$p = RenderMan::strToPageId($paths->get_pageid_from_url()); -if( ( $p[1] == 'Admin' || $p[1] == 'Special' ) && function_exists('page_'.$p[1].'_'.$p[0].'_preloader')) -{ - @call_user_func('page_'.$p[1].'_'.$p[0].'_preloader'); + // If the site is disabled, bail out, unless we're trying to log in or administer the site + if(getConfig('site_disabled') == '1' && $session->user_level < USER_LEVEL_ADMIN) + { + if ( $paths->namespace == 'Admin' || ( $paths->namespace == 'Special' && ( $paths->cpage['urlname_nons'] == 'CSS' || $paths->cpage['urlname_nons'] == 'Administration' || $paths->cpage['urlname_nons'] == 'Login' ) ) ) + { + // do nothing; allow execution to continue + } + else + { + if(!$n = getConfig('site_disabled_notice')) + { + $n = 'The administrator has disabled the site. Please check back later.'; + } + + $text = RenderMan::render($n) . ' +