2 commits - lib/Conf.php lib/kolab_api_controller.php

Aleksander Machniak machniak at kolabsys.com
Fri Sep 7 13:09:44 CEST 2012


 lib/Conf.php                 |    4 ++--
 lib/kolab_api_controller.php |   21 ++++++++++++++-------
 2 files changed, 16 insertions(+), 9 deletions(-)

New commits:
commit f2a2fd1a19f9ebdbab2cb402d37a1f77c34c27ef
Merge: 8d2de93 ee7ed1f
Author: Aleksander Machniak <machniak at kolabsys.com>
Date:   Fri Sep 7 13:09:29 2012 +0200

    Merge branch 'master' of ssh://git.kolab.org/git/kolab-wap



commit 8d2de93f536edf239cfa42e7a1250fd1c69a3fbb
Author: Aleksander Machniak <machniak at kolabsys.com>
Date:   Fri Sep 7 13:09:15 2012 +0200

    Small improvements

diff --git a/lib/Conf.php b/lib/Conf.php
index a207f79..f95df5f 100644
--- a/lib/Conf.php
+++ b/lib/Conf.php
@@ -122,12 +122,12 @@ class Conf {
         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])) {
+                if (isset($this->_conf[$domain_section_name]) && isset($this->_conf[$domain_section_name][$key1])) {
                     return $this->_conf[$domain_section_name][$key1];
                 }
             } catch (Exception $e) {
                 if ($domain_section_name = $this->_conf['kolab']['primary_domain']) {
-                    if (isset($this->_conf[$domain_section_name][$key1])) {
+                    if (isset($this->_conf[$domain_section_name]) && isset($this->_conf[$domain_section_name][$key1])) {
                         return $this->_conf[$domain_section_name][$key1];
                     }
                 }
diff --git a/lib/kolab_api_controller.php b/lib/kolab_api_controller.php
index 9e7c628..3cfa54f 100644
--- a/lib/kolab_api_controller.php
+++ b/lib/kolab_api_controller.php
@@ -382,6 +382,8 @@ class kolab_api_controller
 
     /**
      * End the current user session
+     *
+     * @return bool
      */
     private function quit()
     {
@@ -389,14 +391,19 @@ class kolab_api_controller
         return true;
     }
 
-    private function select_domain($getdata) {
-        if (isset($getdata['domain'])) {
-            $_SESSION['user']->set_domain($getdata['domain']);
-            return true;
-        }
-        else {
-            return false;
+    /**
+     * Session domain change
+     *
+     * @param array $request GET request parameters
+     *
+     * @return bool
+     */
+    private function select_domain($request) {
+        if (!empty($request['domain']) && is_string($request['domain'])) {
+            return $_SESSION['user']->set_domain($request['domain']);
         }
+
+        return false;
     }
 
     /**





More information about the commits mailing list