Commit d7f2da4f authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Use db prefix in admin users, staff users

parent c5863f89
......@@ -58,14 +58,11 @@ $form = array(
function adminusers_submit($values) {
global $SESSION;
$table = get_config('dbprefix') . 'usr';
db_begin();
execute_sql('UPDATE usr
SET admin = 0
WHERE admin = 1');
execute_sql('UPDATE usr
SET admin = 1
WHERE id IN (' . join(',', $values['users']) . ')');
execute_sql('UPDATE ' . $table . ' SET admin = 0 WHERE admin = 1');
execute_sql('UPDATE ' . $table . ' SET admin = 1 WHERE id IN (' . join(',', $values['users']) . ')');
db_commit();
$SESSION->add_ok_msg(get_string('adminusersupdated', 'admin'));
redirect(get_config('wwwroot') . 'admin/usermanagement/adminusers.php');
......
......@@ -57,14 +57,11 @@ $form = array(
function staffusers_submit($values) {
global $SESSION;
$table = get_config('dbprefix') . 'usr';
db_begin();
execute_sql('UPDATE usr
SET staff = 0
WHERE staff = 1');
execute_sql('UPDATE usr
SET staff = 1
WHERE id IN (' . join(',', $values['users']) . ')');
execute_sql('UPDATE ' . $table . ' SET staff = 0 WHERE staff = 1');
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/usermanagement/staffusers.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