aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2013-03-19 11:52:35 +0100
committerArthur Schiwon <blizzz@owncloud.com>2013-03-19 14:40:15 +0100
commit18fccf66128d5ee198355d6a064da370d272d9a5 (patch)
tree37baee138b672ea07628fbc481c95c1aca1ef7e0
parent504f5f229f9ae46ef0e50136d58e499ebfde5105 (diff)
downloadnextcloud-server-18fccf66128d5ee198355d6a064da370d272d9a5.tar.gz
nextcloud-server-18fccf66128d5ee198355d6a064da370d272d9a5.zip
LDAP: check first whether group exists in this backend before doing other operations
-rw-r--r--apps/user_ldap/group_ldap.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php
index efa5f8b4fe3..3dbc5e7d895 100644
--- a/apps/user_ldap/group_ldap.php
+++ b/apps/user_ldap/group_ldap.php
@@ -139,6 +139,9 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
if(!$this->enabled) {
return array();
}
+ if(!$this->groupExists($gid)) {
+ return false;
+ }
$cachekey = 'usersInGroup-'.$gid.'-'.$search.'-'.$limit.'-'.$offset;
// check for cache of the exact query
$groupUsers = $this->connection->getFromCache($cachekey);
@@ -214,6 +217,12 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
* @returns array with display names (value) and user ids(key)
*/
public function displayNamesInGroup($gid, $search, $limit, $offset) {
+ if(!$this->enabled) {
+ return array();
+ }
+ if(!$this->groupExists($gid)) {
+ return false;
+ }
$users = $this->usersInGroup($gid, $search, $limit, $offset);
$displayNames = array();
foreach($users as $user) {