$cbbb = $HTTP_POST_VARS["cbbb"]; if ($cbwwwdev == "1" && reg_load("SYSTEM/MAINTENANCE/WWWDEV") != "1") { switchToMaintenanceMode("dev"); } if ($cbwww == "1" && reg_load("SYSTEM/MAINTENANCE/WWW") != "1") { switchToMaintenanceMode("live"); } if ($cbwwwdev == "" && reg_load("SYSTEM/MAINTENANCE/WWWDEV") == "1") { disableMaintenanceMode("dev"); } if ($cbwww == "" && reg_load("SYSTEM/MAINTENANCE/WWW") == "1") { disableMaintenanceMode("live"); } reg_save("SYSTEM/MAINTENANCE/WWWDEV", $cbwwwdev); reg_save("SYSTEM/MAINTENANCE/WWW", $cbwww); reg_save("SYSTEM/MAINTENANCE/BB", $cbbb); } else { $cbwwwdev = reg_load("SYSTEM/MAINTENANCE/WWWDEV"); $cbwww = reg_load("SYSTEM/MAINTENANCE/WWW"); $cbbb = reg_load("SYSTEM/MAINTENANCE/BB"); } $page->tipp = $lang->get("maint_descr", "Maintenance mode displays a 'Page under maintance' message for the development or the live-website. <br>You can also switch the whole backend into maintenance mode. Then only the user ADMINISTRATOR can log in!"); $form = new Form($lang->get("maint_mode", "Maintenance Mode")); $form->add(new Label("lbl", $lang->get("maint_bb", "Backend Maintenance"), "standard")); $form->add(new Checkbox("cbbb", "1", "standard", $cbbb)); $form->add(new Label("lbl", $lang->get("maint_www", "Live Website Maintenance"), "standard")); $form->add(new Checkbox("cbwww", "1", "standard", $cbwww)); $form->add(new Label("lbl", $lang->get("maint_wwwdev", "Dev Website Maintenance"), "standard")); $form->add(new Checkbox("cbwwwdev", "1", "standard", $cbwwwdev)); $form->add(new Hidden("processing", "yes")); $form->add(new Spacer(2));
<?php require_once 'includes/header.php'; require_once 'includes/recaptcha.php'; $ack = @$_GET['action']; switch ($ack) { case 'save': reg_save(); break; default: reg_main(); break; } die; function reg_main($error_msg = '') { global $smarty; foreach ($_POST as $key => $value) { $key = strtolower($key); $smarty->assign($key, $value); } if (!isset($_POST['invitecode'])) { $smarty->assign('invitecode', @$_GET['invitecode']); } $smarty->assign('error_msg', $error_msg); $smarty->assign('recaptcha_html', recaptcha_get_html(RECAPTCHA_PUBLIC_KEY, null, true)); $smarty->display('reg.html'); } function reg_save() { global $smarty;
/** * saves a key-value-pair to the N/X-Registry * @param string Key in format: folder1/folder2/keyname * @param string Value */ function saveRegistryKey($key, $value) { reg_save($key, $value); }