This will remove any template content related to the trade currency if that one is left empty in the configuration. While going through the templates I also cleaned up the PHP Warnings left. The code and templates should now process without throwing any PHP warnings. Fixes #305 and further addresses #301
26 lines
772 B
PHP
26 lines
772 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'));
|
|
$smarty->assign("LOCKREGISTRATION", $setting->getValue('lock_registration'));
|
|
|
|
// Tempalte specifics
|
|
$smarty->assign("CONTENT", "default.tpl");
|
|
?>
|