diff --git a/include/dbupdate.php b/include/dbupdate.php new file mode 100644 index 0000000000..6ae1bf10e7 --- /dev/null +++ b/include/dbupdate.php @@ -0,0 +1,29 @@ +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/mod/maintenance.php b/mod/maintenance.php new file mode 100644 index 0000000000..b50c94c9b9 --- /dev/null +++ b/mod/maintenance.php @@ -0,0 +1,7 @@ + t('System down for maintenance') + )); +} 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"; + diff --git a/view/maintenance.tpl b/view/maintenance.tpl new file mode 100644 index 0000000000..bbe15d46a8 --- /dev/null +++ b/view/maintenance.tpl @@ -0,0 +1 @@ +