mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-59429 roles: Log add/remove admin users.
This commit is contained in:
parent
9e7c397889
commit
0be294c005
@ -80,9 +80,16 @@ if (optional_param('add', false, PARAM_BOOL) and confirm_sesskey()) {
|
||||
}
|
||||
|
||||
if (isset($admins[$newmain])) {
|
||||
$logstringold = implode(', ', $admins);
|
||||
|
||||
unset($admins[$newmain]);
|
||||
array_unshift($admins, $newmain);
|
||||
|
||||
$logstringnew = implode(', ', $admins);
|
||||
|
||||
set_config('siteadmins', implode(',', $admins));
|
||||
add_to_config_log('siteadmins', $logstringold, $logstringnew, null);
|
||||
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
}
|
||||
@ -95,8 +102,16 @@ if (optional_param('add', false, PARAM_BOOL) and confirm_sesskey()) {
|
||||
$admins[$admin] = $admin;
|
||||
}
|
||||
}
|
||||
|
||||
$logstringold = implode(', ', $admins);
|
||||
|
||||
$admins[$confirmadd] = $confirmadd;
|
||||
|
||||
$logstringnew = implode(', ', $admins);
|
||||
|
||||
set_config('siteadmins', implode(',', $admins));
|
||||
add_to_config_log('siteadmins', $logstringold, $logstringnew, 'core');
|
||||
|
||||
redirect($PAGE->url);
|
||||
|
||||
} else if ($confirmdel and confirm_sesskey() and $confirmdel != $USER->id) {
|
||||
@ -107,8 +122,16 @@ if (optional_param('add', false, PARAM_BOOL) and confirm_sesskey()) {
|
||||
$admins[$admin] = $admin;
|
||||
}
|
||||
}
|
||||
|
||||
$logstringold = implode(', ', $admins);
|
||||
|
||||
unset($admins[$confirmdel]);
|
||||
|
||||
$logstringnew = implode(', ', $admins);
|
||||
|
||||
set_config('siteadmins', implode(',', $admins));
|
||||
add_to_config_log('siteadmins', $logstringold, $logstringnew, 'core');
|
||||
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user