From f93ce1fd7fca1a7229a9c9da4f1f4a3f98823524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Sat, 8 Feb 2014 17:11:17 -0500 Subject: [PATCH] Minors improvements --- controllers/config.php | 3 ++- lib/session.php | 4 +++- models/config.php | 6 +++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/controllers/config.php b/controllers/config.php index 96a6a0857..e01b20826 100644 --- a/controllers/config.php +++ b/controllers/config.php @@ -32,11 +32,12 @@ class Config extends Base if ($this->config->save($values)) { $this->config->reload(); $this->session->flash(t('Settings saved successfully.')); - $this->response->redirect('?controller=config'); } else { $this->session->flashError(t('Unable to save your settings.')); } + + $this->response->redirect('?controller=config'); } $this->response->html($this->template->layout('config_index', array( diff --git a/lib/session.php b/lib/session.php index c5a8271f0..5ea6ceb0b 100644 --- a/lib/session.php +++ b/lib/session.php @@ -4,8 +4,10 @@ class Session { const SESSION_LIFETIME = 2678400; - public function open($base_path = '/') + public function open($base_path = '/', $save_path = '') { + if ($save_path !== '') session_save_path($save_path); + session_set_cookie_params( self::SESSION_LIFETIME, $base_path, diff --git a/models/config.php b/models/config.php index d854047dc..4d39af872 100644 --- a/models/config.php +++ b/models/config.php @@ -11,10 +11,14 @@ class Config extends Base public function getLanguages() { - return array( + $languages = array( 'en_US' => t('English'), 'fr_FR' => t('French'), ); + + asort($languages); + + return $languages; } public function get($name, $default_value = '')