summary refs log tree commit diff stats
path: root/pages
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2008-12-20 21:41:09 -0500
committerStarla Insigna <hatkirby@fourisland.com>2008-12-20 21:41:09 -0500
commiteaf0dc418bb8338a0de53c6ca6d2469ce3b70214 (patch)
tree8b5ae56f2080d1dbdb261e04f71e11ddaacef12e /pages
parent03d6589fefd850f793215cb6805c0f0c0989f93f (diff)
downloadfourisland-eaf0dc418bb8338a0de53c6ca6d2469ce3b70214.tar.gz
fourisland-eaf0dc418bb8338a0de53c6ca6d2469ce3b70214.tar.bz2
fourisland-eaf0dc418bb8338a0de53c6ca6d2469ce3b70214.zip
Added Maintenance switcher to Admin
Also fixed spelling of maintenance in places where it was incorrectly spelled.

Maintenance Required: Rename "mantainenceMode" config to "maintenanceMode"
Diffstat (limited to 'pages')
-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 }