summaryrefslogtreecommitdiff
path: root/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'controllers')
-rw-r--r--controllers/base.php4
-rw-r--r--controllers/config.php9
2 files changed, 9 insertions, 4 deletions
diff --git a/controllers/base.php b/controllers/base.php
index c248ede1..c4a69bf0 100644
--- a/controllers/base.php
+++ b/controllers/base.php
@@ -67,6 +67,10 @@ abstract class Base
$language = $this->config->get('language', 'en_US');
if ($language !== 'en_US') \Translator\load($language);
+ //set timezone
+ $timezone = $this->config->get('timezone', 'UTC');
+ date_default_timezone_set($timezone);
+
$this->response->csp();
$this->response->nosniff();
$this->response->xss();
diff --git a/controllers/config.php b/controllers/config.php
index e01b2082..51a04079 100644
--- a/controllers/config.php
+++ b/controllers/config.php
@@ -15,7 +15,8 @@ class Config extends Base
'values' => $this->config->getAll(),
'errors' => array(),
'menu' => 'config',
- 'title' => t('Settings')
+ 'title' => t('Settings'),
+ 'timezones' => array_combine(timezone_identifiers_list(), timezone_identifiers_list())
)));
}
@@ -32,8 +33,7 @@ class Config extends Base
if ($this->config->save($values)) {
$this->config->reload();
$this->session->flash(t('Settings saved successfully.'));
- }
- else {
+ } else {
$this->session->flashError(t('Unable to save your settings.'));
}
@@ -48,7 +48,8 @@ class Config extends Base
'values' => $values,
'errors' => $errors,
'menu' => 'config',
- 'title' => t('Settings')
+ 'title' => t('Settings'),
+ 'timezones' => array_combine(timezone_identifiers_list(), timezone_identifiers_list())
)));
}