MDL-13161 - auth/db - suppress php warning when there are no users using db auth

This commit is contained in:
mjollnir_
2008-01-27 20:05:29 +00:00
parent 66d4805a81
commit 357eefcdbe
+5 -3
View File
@@ -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);