summary refs log tree commit diff stats
path: root/pages/admin.php
diff options
context:
space:
mode:
Diffstat (limited to 'pages/admin.php')
-rwxr-xr-xpages/admin.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/pages/admin.php b/pages/admin.php index 579feed..a3b1783 100755 --- a/pages/admin.php +++ b/pages/admin.php
@@ -692,6 +692,44 @@ if (isLoggedIn())
692 system('hg update'); 692 system('hg update');
693 $template->add('MSG', ob_get_contents()); 693 $template->add('MSG', ob_get_contents());
694 ob_end_clean(); 694 ob_end_clean();
695 } else if ($_GET['page'] == 'maintenanceMode')
696 {
697 if (isset($_GET['submit']))
698 {
699 if ($_POST['mode'] == 'on')
700 {
701 $set = 1;
702 } else if ($_POST['mode'] == 'off')
703 {
704 $set = 0;
705 } else {
706 $template = new FITemplate('msg');
707 $template->add('MSG', 'You seem to have somehow messed up the form. That\'s weird.');
708 $template->add('BACK', 'the Maintenance Mode form');
709 }
710
711 if (isset($set))
712 {
713 $setconfig = "UPDATE config SET value = \"" . $set . "\" WHERE name = \"maintenanceMode\"";
714 $setconfig2 = mysql_query($setconfig);
715
716 $template = new FITemplate('msg');
717 $template->add('MSG', 'Maintenance Mode has successfully been set to "' . $_POST['mode'] . '"');
718 $template->add('BACK', 'the Maintenance Mode form');
719 }
720 } else {
721 $template = new FITemplate('admin/maintenanceMode');
722
723 $getconfig = "SELECT * FROM config WHERE name = \"maintenanceMode\"";
724 $getconfig2 = mysql_query($getconfig);
725 $getconfig3 = mysql_fetch_array($getconfig2);
726 if ($getconfig3['value'] == '1')
727 {
728 $template->add('ON', ' CHECKED="CHECKED"');
729 } else {
730 $template->add('OFF', ' CHECKED="CHECKED"');
731 }
732 }
695 } else { 733 } else {
696 generateError(404); 734 generateError(404);
697 } 735 }