Merge branch 'MDL-59429-master' of git://github.com/mickhawkins/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2018-06-19 02:06:54 +02:00
commit f3611eabc8

View File

@ -80,9 +80,16 @@ if (optional_param('add', false, PARAM_BOOL) and confirm_sesskey()) {
} }
if (isset($admins[$newmain])) { if (isset($admins[$newmain])) {
$logstringold = implode(', ', $admins);
unset($admins[$newmain]); unset($admins[$newmain]);
array_unshift($admins, $newmain); array_unshift($admins, $newmain);
$logstringnew = implode(', ', $admins);
set_config('siteadmins', implode(',', $admins)); set_config('siteadmins', implode(',', $admins));
add_to_config_log('siteadmins', $logstringold, $logstringnew, null);
redirect($PAGE->url); redirect($PAGE->url);
} }
} }
@ -95,8 +102,16 @@ if (optional_param('add', false, PARAM_BOOL) and confirm_sesskey()) {
$admins[$admin] = $admin; $admins[$admin] = $admin;
} }
} }
$logstringold = implode(', ', $admins);
$admins[$confirmadd] = $confirmadd; $admins[$confirmadd] = $confirmadd;
$logstringnew = implode(', ', $admins);
set_config('siteadmins', implode(',', $admins)); set_config('siteadmins', implode(',', $admins));
add_to_config_log('siteadmins', $logstringold, $logstringnew, 'core');
redirect($PAGE->url); redirect($PAGE->url);
} else if ($confirmdel and confirm_sesskey() and $confirmdel != $USER->id) { } 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; $admins[$admin] = $admin;
} }
} }
$logstringold = implode(', ', $admins);
unset($admins[$confirmdel]); unset($admins[$confirmdel]);
$logstringnew = implode(', ', $admins);
set_config('siteadmins', implode(',', $admins)); set_config('siteadmins', implode(',', $admins));
add_to_config_log('siteadmins', $logstringold, $logstringnew, 'core');
redirect($PAGE->url); redirect($PAGE->url);
} }