summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2012-09-07 13:09:15 +0200
committerAleksander Machniak <machniak@kolabsys.com>2012-09-07 13:09:15 +0200
commit8d2de93f536edf239cfa42e7a1250fd1c69a3fbb (patch)
tree8ed8785c558a9dbf4eec37549a6aebceaaeaf558
parent83537043c792be58aec58eb548acedafb1f0eb98 (diff)
downloadwebadmin-8d2de93f536edf239cfa42e7a1250fd1c69a3fbb.tar.gz
Small improvements
-rw-r--r--lib/Conf.php4
-rw-r--r--lib/kolab_api_controller.php21
2 files changed, 16 insertions, 9 deletions
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;
}
/**