LDAP: check first whether group exists in this backend before doing other operations
This commit is contained in:
parent
504f5f229f
commit
18fccf6612
|
@ -139,6 +139,9 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
|
||||||
if(!$this->enabled) {
|
if(!$this->enabled) {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
if(!$this->groupExists($gid)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$cachekey = 'usersInGroup-'.$gid.'-'.$search.'-'.$limit.'-'.$offset;
|
$cachekey = 'usersInGroup-'.$gid.'-'.$search.'-'.$limit.'-'.$offset;
|
||||||
// check for cache of the exact query
|
// check for cache of the exact query
|
||||||
$groupUsers = $this->connection->getFromCache($cachekey);
|
$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)
|
* @returns array with display names (value) and user ids(key)
|
||||||
*/
|
*/
|
||||||
public function displayNamesInGroup($gid, $search, $limit, $offset) {
|
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);
|
$users = $this->usersInGroup($gid, $search, $limit, $offset);
|
||||||
$displayNames = array();
|
$displayNames = array();
|
||||||
foreach($users as $user) {
|
foreach($users as $user) {
|
||||||
|
|
Loading…
Reference in New Issue