MDL-13161 - auth/db - suppress php warning when there are no users using db auth
This commit is contained in:
+5
-3
@@ -334,10 +334,12 @@ class auth_plugin_db extends auth_plugin_base {
|
||||
|
||||
// simplify down to usernames
|
||||
$usernames = array();
|
||||
foreach ($users as $user) {
|
||||
array_push($usernames, $user->username);
|
||||
if (!empty($users)) {
|
||||
foreach ($users as $user) {
|
||||
array_push($usernames, $user->username);
|
||||
}
|
||||
unset($users);
|
||||
}
|
||||
unset($users);
|
||||
|
||||
$add_users = array_diff($userlist, $usernames);
|
||||
unset($usernames);
|
||||
|
||||
Reference in New Issue
Block a user