#5584 Added edit users 2

This commit is contained in:
Daniel Maya 2022-10-03 09:07:35 +02:00
parent 87d4c03467
commit 4e68ae62ef
1 changed files with 28 additions and 0 deletions

View File

@ -125,8 +125,36 @@ if ($edit_users === 1) {
$update['timezone'] = $timezone;
}
$error = [];
$success = [];
foreach ($users as $key => $user) {
$result = update_user($user, $update);
if ($result === false) {
$error[] = $user;
} else {
$success[] = $user;
}
}
if (empty($success) === false) {
ui_print_success_message(
__(
'Users updated successfully (%s)',
implode(
',',
$success
)
)
);
}
if (empty($error) === false) {
ui_print_error_message(
__(
'Users cannot be updated (%s)',
implode(',', $error)
)
);
}
}
}