This commit is contained in:
Diego Najar 2017-07-26 21:00:20 +02:00
parent b7c2a9016d
commit 7f14b15489
2 changed files with 21 additions and 23 deletions

View File

@ -13,28 +13,6 @@ if($Login->role()!=='admin') {
// Functions
// ============================================================================
function setSettings($args)
{
global $Site;
global $Language;
if( $Site->set($args) ) {
// Add to syslog
$Syslog->add(array(
'dictionaryKey'=>'changes-on-settings',
'notes'=>''
));
// Create alert
Alert::set($Language->g('the-changes-have-been-saved'));
// Redirect
Redirect::page('settings-regional');
}
return true;
}
// ============================================================================
// Main after POST
// ============================================================================
@ -45,7 +23,10 @@ function setSettings($args)
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
setSettings($_POST);
if (editSettings($_POST)) {
Alert::set($Language->g('the-changes-have-been-saved'));
Redirect::page('settings-regional');
}
}
// ============================================================================

View File

@ -468,5 +468,22 @@ function createUser($args) {
return true;
}
return false;
}
function editSettings($args) {
global $Site;
global $Syslog;
if( $Site->set($args) ) {
// Add to syslog
$Syslog->add(array(
'dictionaryKey'=>'changes-on-settings',
'notes'=>''
));
return true;
}
return false;
}