diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2012-08-14 14:14:20 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2012-08-14 14:14:20 +0200 |
commit | 452f55e163444e573a8ddbf762fedf6d32b48e8d (patch) | |
tree | 4eb63932a7e9ff4f86f8d93f752903434ac1b1e2 /apps | |
parent | 1522f7f21185d2f3d3b5edebaa09f3e2f3a454aa (diff) | |
download | nextcloud-server-452f55e163444e573a8ddbf762fedf6d32b48e8d.tar.gz nextcloud-server-452f55e163444e573a8ddbf762fedf6d32b48e8d.zip |
adjust LDAP to updated interface
Diffstat (limited to 'apps')
-rw-r--r-- | apps/user_ldap/user_ldap.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php index fb3471af91b..31b6dccbf67 100644 --- a/apps/user_ldap/user_ldap.php +++ b/apps/user_ldap/user_ldap.php @@ -100,14 +100,22 @@ class USER_LDAP extends lib\Access implements \OCP\UserInterface { * * Get a list of all users. */ - public function getUsers(){ + public function getUsers($search = '', $limit = 10, $offset = 0){ $ldap_users = $this->connection->getFromCache('getUsers'); if(is_null($ldap_users)) { $ldap_users = $this->fetchListOfUsers($this->connection->ldapUserFilter, array($this->connection->ldapUserDisplayName, 'dn')); $ldap_users = $this->ownCloudUserNames($ldap_users); $this->connection->writeToCache('getUsers', $ldap_users); } - return $ldap_users; + $this->userSearch = $search; + if(!empty($this->userSearch)) { + $ldap_users = array_filter($ldap_users, array($this, 'userMatchesFilter')); + } + return array_slice($ldap_users, $offset, $limit); + } + + public function userMatchesFilter($user) { + return (strripos($user, $this->userSearch) !== false); } /** |