summaryrefslogtreecommitdiffstats
path: root/lib/kolab_client_task.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-06-26 09:27:06 +0200
committerAleksander Machniak <alec@alec.pl>2013-06-26 09:29:24 +0200
commit9652212d7f584a4da1e15010c3cfdf639c17e89d (patch)
treecb2f7f10380ed6a62297b42f16b99a964e045b58 /lib/kolab_client_task.php
parent1ee1a17592e8cf53c5c1c6674bfd57d041f9e18e (diff)
downloadwebadmin-9652212d7f584a4da1e15010c3cfdf639c17e89d.tar.gz
Fix uninitialized locale on login screen (in case when session exists but is invalid)
Diffstat (limited to 'lib/kolab_client_task.php')
-rw-r--r--lib/kolab_client_task.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index 4e937a5..c334fdb 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -76,6 +76,10 @@ class kolab_client_task
*/
protected function locale_init()
{
+ if (!empty(self::$translation)) {
+ return;
+ }
+
$language = $this->get_language();
$LANG = array();
@@ -244,6 +248,7 @@ class kolab_client_task
$label = 'internalerror';
$this->raise_error(500, 'Login failed. ' . $str);
}
+
$this->output->command('display_message', $label, 'error');
}
}
@@ -318,6 +323,9 @@ class kolab_client_task
*/
private function action_logout($sess_expired = false, $stop_sess = true)
{
+ // Initialize locales
+ $this->locale_init();
+
if (!empty($_SESSION['user']) && !empty($_SESSION['user']['token']) && $stop_sess) {
$this->api->logout();
}