aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-07-20 11:24:28 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-12-15 10:01:25 +0100
commit89fdca7748961bd88ddbb975566185d5690a6e67 (patch)
tree0dd80e73c23092c903cddfc83ea4f77d795f6b60
parent582ca0a50dda3c3b1924cab7932764ae736c2466 (diff)
downloadnextcloud-server-89fdca7748961bd88ddbb975566185d5690a6e67.tar.gz
nextcloud-server-89fdca7748961bd88ddbb975566185d5690a6e67.zip
Only throw exception if on new LDAP setups
* this is done by setting enforce_home_folder_naming_rule for the user_ldap app in the app settings
-rw-r--r--apps/user_ldap/appinfo/update.php27
-rw-r--r--apps/user_ldap/appinfo/version2
-rw-r--r--apps/user_ldap/user_ldap.php6
3 files changed, 32 insertions, 3 deletions
diff --git a/apps/user_ldap/appinfo/update.php b/apps/user_ldap/appinfo/update.php
new file mode 100644
index 00000000000..64ef0a16a3c
--- /dev/null
+++ b/apps/user_ldap/appinfo/update.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * @author Morris Jobke <hey@morrisjobke.de>
+ *
+ * @copyright Copyright (c) 2015, ownCloud, Inc.
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+$config = \OC::$server->getConfig();
+$installedVersion = $config->getAppValue('user_ldap', 'installed_version');
+
+if (version_compare($installedVersion, '0.5.2', '<')) {
+ $config->setAppValue('user_ldap', 'enforce_home_folder_naming_rule', false);
+}
diff --git a/apps/user_ldap/appinfo/version b/apps/user_ldap/appinfo/version
index 4b9fcbec101..cb0c939a936 100644
--- a/apps/user_ldap/appinfo/version
+++ b/apps/user_ldap/appinfo/version
@@ -1 +1 @@
-0.5.1
+0.5.2
diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php
index 9c35ec94cca..6f00ba13a77 100644
--- a/apps/user_ldap/user_ldap.php
+++ b/apps/user_ldap/user_ldap.php
@@ -290,8 +290,10 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
//TODO: if home directory changes, the old one needs to be removed.
return $homedir;
}
- // a naming rule attribute is defined, but it doesn't exist for that LDAP user
- throw new \Exception('Home dir attribute can\'t be read from LDAP for uid: ' . $uid);
+ if($this->ocConfig->getAppValue('user_ldap', 'enforce_home_folder_naming_rule', true)) {
+ // a naming rule attribute is defined, but it doesn't exist for that LDAP user
+ throw new \Exception('Home dir attribute can\'t be read from LDAP for uid: ' . $uid);
+ }
}
//false will apply default behaviour as defined and done by OC_User