php-mpos/public/include/pages/admin/settings.inc.php
Sebastian Grewe 3e07263ae9 Removed registration configuration option
* Removed old registration configuration option from config file
* Changed database registration option to allow registrations by default
* Changed admin settings template for new DB option
* Changed registration controllers for new DB option

Fixes an issue with registrations not working if settings table is
empty.
2013-06-30 12:29:52 +02:00

27 lines
822 B
PHP

<?php
// Make sure we are called from index.php
if (!defined('SECURITY')) die('Hacking attempt');
// Check user to ensure they are admin
if (!$user->isAuthenticated() || !$user->isAdmin($_SESSION['USERDATA']['id'])) {
header("HTTP/1.1 404 Page not found");
die("404 Page not found");
}
if ($_REQUEST['do'] == 'save' && !empty($_REQUEST['data'])) {
foreach($_REQUEST['data'] as $var => $value) {
$setting->setValue($var, $value);
}
$_SESSION['POPUP'][] = array('CONTENT' => 'Settings updated');
}
// Fetch settings to propagate to template
$smarty->assign("MAINTENANCE", $setting->getValue('maintenance'));
var_dump($setting->getValue('lock_registration'));
$smarty->assign("LOCKREGISTRATION", $setting->getValue('lock_registration'));
// Tempalte specifics
$smarty->assign("CONTENT", "default.tpl");
?>