Commit 0a42ea65 authored by Robert Lyon's avatar Robert Lyon

Bug 1804959: Make sure there is at least 1 admin

In members for ldap sync_group

behatnotneeded

Change-Id: I15a69e4ba4b90d95a9e4dbbb61c04235b4dcac62
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 7eb46ad6
......@@ -1522,6 +1522,11 @@ class AuthLdap extends Auth {
$members[$id] = 'member';
}
}
// doublecheck that we have at least 1 admin in the group in case the user = 1 is a member of the group
if (!in_array('admin', $members)) {
// in no admins then force user = 1 to be the admin
$members['1'] = 'admin';
}
if (get_config('auth_ldap_debug_sync_cron')) {
log_debug('new members list : '.count($members));
var_dump($members);
......
Markdown is supported
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