Commit c25a8dcc authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Fixes #4560 Fixed an error when there are no groups in a department and...

Fixes #4560 Fixed an error when there are no groups in a department and restrict option is activated
parent 03e33144
......@@ -29,7 +29,11 @@ class RoleMembersAttribute extends UsersAttribute
if ($this->whitelistDns === NULL) {
/* Computes a list of members of all groups within our branch */
$groups = objects::ls('ogroup', array('member' => '*'), $this->plugin->base);
$this->whitelistDns = call_user_func_array('array_merge_recursive', $groups)['member'];
if (empty($groups)) {
$this->whitelistDns = array();
} else {
$this->whitelistDns = call_user_func_array('array_merge_recursive', $groups)['member'];
}
}
return array(
'branches' => array($this->plugin->base),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment