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

Add internal admin notifications for new site admins

parent 20c82d27
......@@ -72,10 +72,7 @@ function adminusers_submit(Pieform $form, $values) {
execute_sql('UPDATE {usr}
SET admin = 1
WHERE id IN (' . join(',', $values['users']) . ')');
execute_sql('DELETE FROM {usr_activity_preference}
WHERE activity IN (SELECT name FROM {activity_type}
WHERE admin = 1)
AND usr NOT IN (' . join(',', $values['users']) . ')');
activity_add_admin_defaults($values['users']);
db_commit();
$SESSION->add_ok_msg(get_string('adminusersupdated', 'admin'));
redirect('/admin/users/admins.php');
......
......@@ -182,6 +182,9 @@ function edituser_site_submit(Pieform $form, $values) {
if ($USER->get('admin')) { // Not editable by institutional admins
$user->staff = (int) ($values['staff'] == 'on');
$user->admin = (int) ($values['admin'] == 'on');
if ($user->admin) {
activity_add_admin_defaults(array($user->id));
}
}
// Authinstance can be changed by institutional admins if both the
......
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