diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2014-10-27 23:39:30 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2014-11-20 18:31:39 +0100 |
commit | f725cc66a385311d9995ec4215f57448b59f124e (patch) | |
tree | abd35b868ec32fe783823f0a02021a9760a0e1a3 /apps/user_ldap/lib | |
parent | cb3af1dce294ab058162b3c4d1a0feb84465dd0b (diff) | |
download | nextcloud-server-f725cc66a385311d9995ec4215f57448b59f124e.tar.gz nextcloud-server-f725cc66a385311d9995ec4215f57448b59f124e.zip |
consolidate user count filter in wizard and user back end
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r-- | apps/user_ldap/lib/access.php | 12 | ||||
-rw-r--r-- | apps/user_ldap/lib/wizard.php | 5 |
2 files changed, 13 insertions, 4 deletions
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index d89029abf17..0d51fc51143 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -1168,6 +1168,18 @@ class Access extends LDAPUtility implements user\IUserTools { } /** + * returns the filter used for counting users + */ + public function getFilterForUserCount() { + $filter = $this->combineFilterWithAnd(array( + $this->connection->ldapUserFilter, + $this->connection->ldapUserDisplayName . '=*' + )); + + return $filter; + } + + /** * @param string $name * @param string $password * @return bool diff --git a/apps/user_ldap/lib/wizard.php b/apps/user_ldap/lib/wizard.php index c5db4c66cc0..f373fabb69c 100644 --- a/apps/user_ldap/lib/wizard.php +++ b/apps/user_ldap/lib/wizard.php @@ -121,10 +121,7 @@ class Wizard extends LDAPUtility { */ public function countUsers() { $this->detectUserDisplayNameAttribute(); - $filter = $this->access->combineFilterWithAnd(array( - $this->configuration->ldapUserFilter, - $this->configuration->ldapUserDisplayName . '=*' - )); + $filter = $this->access->getFilterForUserCount(); $usersTotal = $this->countEntries($filter, 'users'); $usersTotal = ($usersTotal !== false) ? $usersTotal : 0; |