summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-07-11 14:32:00 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-07-11 14:32:00 (GMT)
commit872a0de4406a4bd9b004c1b0ee023e6d4b4c83ee (patch)
treef0cd34808093b9eb16d413b55cb733b7e206f81f
parent81a1cd170e88cdc9c9b2bdc9ff29e26660bfe40d (diff)
downloadkolab-wap-872a0de4406a4bd9b004c1b0ee023e6d4b4c83ee.tar.gz
Introduce a new setting for the home directory base path
-rw-r--r--lib/api/kolab_api_service_form_value.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/api/kolab_api_service_form_value.php b/lib/api/kolab_api_service_form_value.php
index 0657a99..3fb41bb 100644
--- a/lib/api/kolab_api_service_form_value.php
+++ b/lib/api/kolab_api_service_form_value.php
@@ -536,8 +536,22 @@ class kolab_api_service_form_value extends kolab_api_service
$uid = $this->generate_uid($postdata, $attribs);
// TODO: Home directory base path from configuration?
+ $conf = Conf::get_instance():
- return '/home/' . $uid;
+ $homedirectory_base = $conf->get($_SESSION['user']->get_domain(), 'homedirectory_base');
+ if (empty($homedirectory_base)) {
+ $homedirectory_base = $conf->get('kolab', 'homedirectory_base');
+ }
+
+ if (empty($homedirectory_base)) {
+ $homedirectory_base = "/home/";
+ }
+
+ if (substr($homedirectory_base, (strlen($homedirectory_base)-1), 1) == "/") {
+ $homedirectory_base = substr($homedirectory_base, 0, (strlen($homedirectory_base)-1));
+ }
+
+ return $homedirectory_base . '/' . $uid;
}
}