Changeset 1079 in ExiteCMS for trunk/includes/core_functions.php


Ignore:
Timestamp:
11/06/07 22:44:18 (5 years ago)
Author:
hverton
Message:

Streamlined the maintenance mode. When an update is detected, the site switches automatically to maintenance mode. All users will be denied access, the webmaster will be redirected to the upgrade admin module to perform the upgrade.
This forces revision installations directly after an update has been installed. New code without the corresponding upgrade can cause the website to break.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/core_functions.php

    r1069 r1079  
    180180    include PATH_ADMIN."upgrade.php"; 
    181181    //  If so, force a switch to maintenance mode 
    182 //  if (UPGRADES) $settings['maintenance'] = 2; 
    183 } 
    184  
    185 // check if we need to redirect to maintenance mode 
    186 if (!iADMIN && $settings['maintenance']) { 
    187     // only if not called from the maintenance mode module! (to prevent a loop, endless ;-) 
    188     if (!eregi("maintenance.php", $_SERVER['PHP_SELF'])) { 
     182    if (UPGRADES) $settings['maintenance'] = 2; 
     183} 
     184 
     185// if not called from the maintenance mode module! (to prevent a loop, endless ;-) 
     186// check if we need to redirect to maintenance mode (for users) or upgrade (for webmasters) 
     187if ($settings['maintenance'] && !eregi("maintenance.php", $_SERVER['PHP_SELF'])) { 
     188    if (!iSUPERADMIN) { 
    189189        redirect('maintenance.php?reason='.$settings['maintenance']); 
     190    } else { 
     191        redirect(ADMIN.'upgrade.php'.$aidlink); 
    190192    } 
    191193} 
Note: See TracChangeset for help on using the changeset viewer.