includes/common.php
changeset 261 5f1cd51bf1be
parent 259 112debff64bd
child 267 105457df35e5
equal deleted inserted replaced
259:112debff64bd 261:5f1cd51bf1be
   150 
   150 
   151 // The first thing we need to do is start the database connection. At this point, for all we know, Enano might not
   151 // The first thing we need to do is start the database connection. At this point, for all we know, Enano might not
   152 // even be installed. If this connection attempt fails and it's because of a missing or corrupt config file, the
   152 // even be installed. If this connection attempt fails and it's because of a missing or corrupt config file, the
   153 // user will be redirected (intelligently) to install.php.
   153 // user will be redirected (intelligently) to install.php.
   154 
   154 
   155 require(ENANO_ROOT . '/config.php');
   155 @include(ENANO_ROOT . '/config.php');
   156 unset($dbuser, $dbpasswd);
   156 unset($dbuser, $dbpasswd);
   157 if ( !isset($dbdriver) )
   157 if ( !isset($dbdriver) )
   158   $dbdriver = 'mysql';
   158   $dbdriver = 'mysql';
   159 
   159 
   160 $db = new $dbdriver();
   160 $db = new $dbdriver();
   326   define('ENANO_MAINSTREAM', '');
   326   define('ENANO_MAINSTREAM', '');
   327   
   327   
   328   // If the site is disabled, bail out, unless we're trying to log in or administer the site
   328   // If the site is disabled, bail out, unless we're trying to log in or administer the site
   329   if(getConfig('site_disabled') == '1' && $session->user_level < USER_LEVEL_ADMIN)
   329   if(getConfig('site_disabled') == '1' && $session->user_level < USER_LEVEL_ADMIN)
   330   {
   330   {
   331     if ( $paths->namespace == 'Admin' || ( $paths->namespace == 'Special' && ( $paths->cpage['urlname_nons'] == 'CSS' || $paths->cpage['urlname_nons'] == 'Administration' || $paths->cpage['urlname_nons'] == 'Login' ) ) )
   331     if ( $paths->namespace == 'Admin' || ( $paths->namespace == 'Special' && ( $paths->page_id == 'CSS' || $paths->page_id == 'Administration' || $paths->page_id == 'Login' ) ) )
   332     {
   332     {
   333       // do nothing; allow execution to continue
   333       // do nothing; allow execution to continue
   334     }
   334     }
   335     else
   335     else
   336     {
   336     {