diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-05-17 17:19:23 +0300 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2019-05-17 17:19:23 +0300 |
commit | 3372bcc7fcba026b9d2ac58812863e1e74c8ffdf (patch) | |
tree | eee16e38d5a3302957b443ebc990bd2042b9c124 /apps/user_ldap/lib/Wizard.php | |
parent | 528eb1b2239a66826f0793fead0e06ab576b7a13 (diff) |
fixes possible override of uniqueMember by autodetection
* uniqueMember was the default so we did not know whether this setting is
desired or the initial value
* autodetection of the user-group association attribute runs only when it
was not set (as far as we knew)
* the default is now empty
* thus LDAPProvider might return this value as well (in exceptional cases)
* if a group base is given (edge case), use this instead of general base
* resolves #12682
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/lib/Wizard.php')
-rw-r--r-- | apps/user_ldap/lib/Wizard.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php index 26b5a8cab71..0ffb74a36a3 100644 --- a/apps/user_ldap/lib/Wizard.php +++ b/apps/user_ldap/lib/Wizard.php @@ -794,7 +794,7 @@ class Wizard extends LDAPUtility { * @throws \Exception */ private function detectGroupMemberAssoc() { - $possibleAttrs = array('uniqueMember', 'memberUid', 'member', 'gidNumber'); + $possibleAttrs = ['uniqueMember', 'memberUid', 'member', 'gidNumber']; $filter = $this->configuration->ldapGroupFilter; if(empty($filter)) { return false; @@ -803,7 +803,7 @@ class Wizard extends LDAPUtility { if(!$cr) { throw new \Exception('Could not connect to LDAP'); } - $base = $this->configuration->ldapBase[0]; + $base = $this->configuration->ldapBaseGroups[0] ?: $this->configuration->ldapBase[0]; $rr = $this->ldap->search($cr, $base, $filter, $possibleAttrs, 0, 1000); if(!$this->ldap->isResource($rr)) { return false; @@ -812,7 +812,7 @@ class Wizard extends LDAPUtility { while(is_resource($er)) { $this->ldap->getDN($cr, $er); $attrs = $this->ldap->getAttributes($cr, $er); - $result = array(); + $result = []; $possibleAttrsCount = count($possibleAttrs); for($i = 0; $i < $possibleAttrsCount; $i++) { if(isset($attrs[$possibleAttrs[$i]])) { |