diff options
-rw-r--r-- | lib/Conf.php | 15 | ||||
-rw-r--r-- | lib/kolab_client_task.php | 6 |
2 files changed, 15 insertions, 6 deletions
diff --git a/lib/Conf.php b/lib/Conf.php index 7c35baf..d333e42 100644 --- a/lib/Conf.php +++ b/lib/Conf.php @@ -106,10 +106,17 @@ class Conf { // and we can try and iterate over it. // First, try the most exotic. - if (isset($_SESSION['user'])) { - $domain_section_name = $_SESSION['user']->get_domain(); - if (isset($this->_conf[$domain_section_name][$key1])) { - return $this->_conf[$domain_section_name][$key1]; + if (isset($_SESSION['user']) && method_exists($_SESSION['user'], 'get_domain')) { + try { + $domain_section_name = $_SESSION['user']->get_domain(); + if (isset($this->_conf[$domain_section_name][$key1])) { + return $this->_conf[$domain_section_name][$key1]; + } + } catch (Exception $e) { + $domain_section_name = $this->get('kolab', 'primary_domain'); + if (isset($this->_conf[$domain_section_name][$key1])) { + return $this->_conf[$domain_section_name][$key1]; + } } } diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php index d454215..54a5c2d 100644 --- a/lib/kolab_client_task.php +++ b/lib/kolab_client_task.php @@ -107,7 +107,7 @@ class kolab_client_task $url = $this->config_get('api_url', ''); // TODO: Debug logging - console($url); + //console($url); if (!$url) { $url = kolab_utils::https_check() ? 'https://' : 'http://'; @@ -117,7 +117,7 @@ class kolab_client_task } // TODO: Debug logging - console($url); + //console($url); $this->api = new kolab_client_api($url); } @@ -173,6 +173,8 @@ class kolab_client_task if ($login['username']) { $result = $this->api->login($login['username'], $login['password']); + //console($result); + if ($token = $result->get('session_token')) { $user = array('token' => $token, 'domain' => $result->get('domain')); |