diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2014-03-20 22:57:50 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2014-03-20 22:57:50 +0100 |
commit | bd881348e86670332abb0ccb8cd6a71543ee3fd1 (patch) | |
tree | 924486ab8026983e57fcac51af2cf7f173bc3cc6 /apps | |
parent | 057c2638e4d1c369f03739faad02d9d6c87e83f7 (diff) | |
download | nextcloud-server-bd881348e86670332abb0ccb8cd6a71543ee3fd1.tar.gz nextcloud-server-bd881348e86670332abb0ccb8cd6a71543ee3fd1.zip |
Fix wildcard handling and check even less DNs per filter, enough will be looked at anyway
Diffstat (limited to 'apps')
-rw-r--r-- | apps/user_ldap/lib/wizard.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/user_ldap/lib/wizard.php b/apps/user_ldap/lib/wizard.php index 930db5c4743..4f7eee5a989 100644 --- a/apps/user_ldap/lib/wizard.php +++ b/apps/user_ldap/lib/wizard.php @@ -876,7 +876,7 @@ class Wizard extends LDAPUtility { * @return mixed, an array with the values on success, false otherwise * */ - private function cumulativeSearchOnAttribute($filters, $attr, $lfw = true, $dnReadLimit = 5, &$maxF = null) { + public function cumulativeSearchOnAttribute($filters, $attr, $lfw = true, $dnReadLimit = 3, &$maxF = null) { $dnRead = array(); $foundItems = array(); $maxEntries = 0; @@ -889,8 +889,11 @@ class Wizard extends LDAPUtility { if(!is_resource($cr)) { return false; } + if(isset($filters[count($filters)-1])) { + $lastFilter = $filters[count($filters)-1]; + } foreach($filters as $filter) { - if($lfw && count($foundItems) > 0) { + if($lfw && $lastFilter === $filter && count($foundItems) > 0) { continue; } $rr = $this->ldap->search($cr, $base, $filter, array($attr)); @@ -927,7 +930,7 @@ class Wizard extends LDAPUtility { $rr = $entry; //will be expected by nextEntry next round } while(($state === self::LRESULT_PROCESSED_SKIP || $this->ldap->isResource($entry)) - && ($dnReadLimit === 0 || $dnReadCount <= $dnReadLimit)); + && ($dnReadLimit === 0 || $dnReadCount < $dnReadLimit)); } } @@ -960,7 +963,7 @@ class Wizard extends LDAPUtility { //When looking for objectclasses, testing few entries is sufficient, //when looking for group we need to get all names, though. if(strtolower($attr) === 'objectclass') { - $dig = 5; + $dig = 3; } else { $dig = 0; } |