Commit 289594c9 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Make sure setting no staff doesn't cause a problem.

parent cbb3f97b
......@@ -63,9 +63,11 @@ function staffusers_submit($values) {
execute_sql('UPDATE ' . $table . '
SET staff = 0
WHERE staff = 1');
execute_sql('UPDATE ' . $table . '
SET staff = 1
WHERE id IN (' . join(',', $values['users']) . ')');
if ($values['users']) {
execute_sql('UPDATE ' . $table . '
SET staff = 1
WHERE id IN (' . join(',', $values['users']) . ')');
}
db_commit();
$SESSION->add_ok_msg(get_string('staffusersupdated', 'admin'));
redirect(get_config('wwwroot') . 'admin/users/staff.php');
......
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