diff --git a/api/src/Accounts/Ldap.php b/api/src/Accounts/Ldap.php index 6a9f0de4ec..685b768ab9 100644 --- a/api/src/Accounts/Ldap.php +++ b/api/src/Accounts/Ldap.php @@ -1030,7 +1030,8 @@ class Ldap * Query the members of a group * * @param int $_gid - * @return array with uidnumber => uid pairs + * @return array|boolean array with uidnumber => uid pairs, + * false if $_git is not nummeric and can't be resolved to a nummeric gid */ function members($_gid) { @@ -1086,7 +1087,7 @@ class Ldap // adding new memberships foreach($old_memberships ? array_diff($groups,$old_memberships) : $groups as $gid) { - $members = $this->members($gid); + if (!($members = $this->members($gid))) $members = array(); $members[$account_id] = $this->id2name($account_id); $this->set_members($members,$gid); }