diff --git a/index.php b/index.php index 19673fa7f9..4c98cd6e02 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,6 @@ query_string = preg_replace('/[\?&]zrl=(.*?)([\?&]|$)/is','',$a->query_string); zrl_init($a); @@ -135,8 +138,10 @@ if(! x($_SESSION,'sysmsg_info')) if($install) $a->module = 'install'; +elseif($maintenance) + $a->module = 'maintenance'; else - check_config($a); + proc_run('php', 'include/dbupdate.php'); nav_set_selected('nothing'); @@ -237,7 +242,7 @@ if (file_exists($theme_info_file)){ if(! x($a->page,'content')) $a->page['content'] = ''; -if(! $install) +if(!$install && !$maintenance) call_hooks('page_content_top',$a->page['content']); /** @@ -372,7 +377,7 @@ $a->page['content'] .= '
'; * */ -if($a->module != 'install') { +if($a->module != 'install' && $a->module != 'maintenance') { nav($a); } diff --git a/util/maintenance.php b/util/maintenance.php new file mode 100644 index 0000000000..d1ff94524e --- /dev/null +++ b/util/maintenance.php @@ -0,0 +1,31 @@ + 1) + $maint_mode = intval($argv[1]); +set_config('system', 'maintenance', $maint_mode); + +if($maint_mode) + $mode_str = "maintenance mode"; +else + $mode_str = "normal mode"; + +echo "\n\tSystem set in $mode_str\n\n"; +echo "Usage:\n\n"; +echo "\tphp {$argv[0]} [1]\tSet the system in maintenance mode\n"; +echo "\tphp {$argv[0]} 0 \tSet the system in normal mode\n\n"; +