Maintenance mode is a mode manually entered by an admin with root privileges as defined by $levelRef[$statRef[$_SESSION['role']]['level']]['root'] and is used to designate one of the following:
1) An issue with user or server databases
2) A switch in backend data storage
3) Generic server issues or updates
4) A time in which a sensitive bug such as an auth breach or zero day exists and whose patch has yet to be pushed
5) Any other time in which database editing is unwanted
Maintenance mode is triggered by the following block in doctype.php:
$content = trim(file_get_contents('/mnt/shared/tmp/maintenance.txt'));
$main = $content == '1' ? true : ($content == '0' ? false : $content); //Maintenance mode.
This block triggers the variable $main to true if the file /mnt/shared/tmp/maintenance.txt has the value 1 or false if the aforementioned file has a value of 0, if the file has any other value the variable is set to that value. This boolean is used to trigger certain actions later.
A page saying the state of active is triggered by the following block in doctype.php:
if($main == true && !$levelRef[$statRef[$_SESSION['role']]['level']]['root']){
include 'down.php';
exit;
}
This block triggers an include of down.php(A page displaying and explaining the state) if both the maintenance state is active and the user isn't an admin with root privileges.
|