From 53e036e5c0adb5c3105d78faf62f73b96c8204a8 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Wed, 11 Jun 2014 14:33:11 +0200 Subject: [PATCH] add method to count groups on LDAP --- apps/user_ldap/lib/access.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index 0fd106366d4..fef222f40ea 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -723,6 +723,18 @@ class Access extends LDAPUtility { return $this->search($filter, $this->connection->ldapBaseGroups, $attr, $limit, $offset); } + /** + * returns the number of available groups + * @param string $filter the LDAP search filter + * @param string[] $attr optional + * @param int|null $limit + * @param int|null $offset + * @return int|bool + */ + public function countGroups($filter, $attr = array('dn'), $limit = null, $offset = null) { + return $this->count($filter, $this->connection->ldapBaseGroups, $attr, $limit, $offset); + } + /** * @brief prepares and executes an LDAP search operation * @param $filter the LDAP filter for the search