2015-10-19 00:45:58 +02:00
|
|
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Check role
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
if($Login->role()!=='admin') {
|
|
|
|
Alert::set($Language->g('you-do-not-have-sufficient-permissions'));
|
|
|
|
Redirect::page('admin', 'dashboard');
|
|
|
|
}
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Functions
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
function setSettings($args)
|
|
|
|
{
|
|
|
|
global $Site;
|
|
|
|
global $Language;
|
|
|
|
|
|
|
|
if( $Site->set($args) ) {
|
2017-06-05 22:36:09 +02:00
|
|
|
// Add to syslog
|
|
|
|
$Syslog->add(array(
|
|
|
|
'dictionaryKey'=>'changes-on-settings',
|
|
|
|
'notes'=>''
|
|
|
|
));
|
|
|
|
|
|
|
|
// Create alert
|
2015-10-19 00:45:58 +02:00
|
|
|
Alert::set($Language->g('the-changes-have-been-saved'));
|
2017-06-05 22:36:09 +02:00
|
|
|
|
|
|
|
// Redirect
|
|
|
|
Redirect::page('settings-regional');
|
2015-10-19 00:45:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Main after POST
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// POST Method
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
if( $_SERVER['REQUEST_METHOD'] == 'POST' )
|
|
|
|
{
|
|
|
|
setSettings($_POST);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
// Main after POST
|
|
|
|
// ============================================================================
|