diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-09-23 16:52:48 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2015-09-23 17:27:40 +0200 |
commit | 002b6bf059377853dc174c1d49792e62983c4bec (patch) | |
tree | ef32e287f2fa472ff33154c79f0f03c48a10e070 /apps/user_ldap/lib/user | |
parent | 845485cfe637c3a7fdb72a110cb68c769b2f8d4b (diff) | |
download | nextcloud-server-002b6bf059377853dc174c1d49792e62983c4bec.tar.gz nextcloud-server-002b6bf059377853dc174c1d49792e62983c4bec.zip |
do not throw exception when no attribute is specified
Diffstat (limited to 'apps/user_ldap/lib/user')
-rw-r--r-- | apps/user_ldap/lib/user/user.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/user/user.php b/apps/user_ldap/lib/user/user.php index 3bfe0c27077..6498cdf913f 100644 --- a/apps/user_ldap/lib/user/user.php +++ b/apps/user_ldap/lib/user/user.php @@ -225,6 +225,7 @@ class User { */ public function getHomePath($valueFromLDAP = null) { $path = $valueFromLDAP; + $attr = null; if( is_null($path) && strpos($this->access->connection->homeFolderNamingRule, 'attr:') === 0 @@ -256,7 +257,9 @@ class User { return $path; } - if($this->config->getAppValue('user_ldap', 'enforce_home_folder_naming_rule', true)) { + if( !is_null($attr) + && $this->config->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: ' . $this->getUsername()); } |