summaryrefslogtreecommitdiffstats
path: root/lib/kolab_client_task.php
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-11-04 08:47:08 -0500
committerAleksander Machniak <machniak@kolabsys.com>2014-11-04 08:47:08 -0500
commite561788b5c9bc243e332c09d86506489deeee796 (patch)
tree434c29987ad5515e6c967de4303c3f56c4d310ca /lib/kolab_client_task.php
parentbe7ef6f18d07aa3f71be0184c8845c646fa09a18 (diff)
downloadwebadmin-e561788b5c9bc243e332c09d86506489deeee796.tar.gz
Return user info in system.authenticate result for better performance (#3858)
Diffstat (limited to 'lib/kolab_client_task.php')
-rw-r--r--lib/kolab_client_task.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index 87d8b62..da0acf5 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -202,7 +202,7 @@ class kolab_client_task
$login = $this->get_input('login', 'POST');
if ($login['username']) {
- $result = $this->api->login($login['username'], $login['password'], $login['domain']);
+ $result = $this->api->login($login['username'], $login['password'], $login['domain'], true);
if ($token = $result->get('session_token')) {
$user = array(
@@ -219,8 +219,11 @@ class kolab_client_task
$user['fullname'] = ucwords($m[1]);
}
else {
- $res = $this->api->get('user.info', array('id' => $user['id']));
- $res = $res->get();
+ $res = $result->get('info');
+ if (empty($res)) {
+ $res = $this->api->get('user.info', array('id' => $user['id']));
+ $res = $res->get();
+ }
if (is_array($res) && !empty($res)) {
$user['language'] = $res['preferredlanguage'];