mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
Merge branch 'MDL-53357-dont-break-urls' of https://github.com/brendanheywood/moodle
This commit is contained in:
commit
c572ac8f3a
2 changed files with 7 additions and 4 deletions
|
@ -20,13 +20,15 @@ $focus = '';
|
|||
// now we'll deal with the case that the admin has submitted the form with changed settings
|
||||
if ($data = data_submitted() and confirm_sesskey()) {
|
||||
if (admin_write_settings($data)) {
|
||||
$statusmsg = get_string('changessaved');
|
||||
redirect($PAGE->url, get_string('changessaved'), null, \core\output\notification::NOTIFY_SUCCESS);
|
||||
}
|
||||
|
||||
if (!empty($adminroot->errors)) {
|
||||
$errormsg = get_string('errorwithsettings', 'admin');
|
||||
$firsterror = reset($adminroot->errors);
|
||||
$focus = $firsterror->id;
|
||||
} else {
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ $errormsg = '';
|
|||
|
||||
if ($data = data_submitted() and confirm_sesskey()) {
|
||||
if (admin_write_settings($data)) {
|
||||
$statusmsg = get_string('changessaved');
|
||||
redirect($PAGE->url, get_string('changessaved'), null, \core\output\notification::NOTIFY_SUCCESS);
|
||||
}
|
||||
|
||||
if (empty($adminroot->errors)) {
|
||||
|
@ -44,6 +44,7 @@ if ($data = data_submitted() and confirm_sesskey()) {
|
|||
case 'site': redirect("$CFG->wwwroot/");
|
||||
case 'admin': redirect("$CFG->wwwroot/$CFG->admin/");
|
||||
}
|
||||
redirect($PAGE->url);
|
||||
} else {
|
||||
$errormsg = get_string('errorwithsettings', 'admin');
|
||||
$firsterror = reset($adminroot->errors);
|
||||
|
@ -72,7 +73,7 @@ if (empty($SITE->fullname)) {
|
|||
|
||||
// ---------------------------------------------------------------------------------------------------------------
|
||||
|
||||
echo '<form action="settings.php" method="post" id="adminsettings">';
|
||||
echo '<form action="' . $PAGE->url . '" method="post" id="adminsettings">';
|
||||
echo '<div class="settingsform clearfix">';
|
||||
echo html_writer::input_hidden_params($PAGE->url);
|
||||
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
|
||||
|
@ -116,7 +117,7 @@ if (empty($SITE->fullname)) {
|
|||
|
||||
// ---------------------------------------------------------------------------------------------------------------
|
||||
|
||||
echo '<form action="settings.php" method="post" id="adminsettings">';
|
||||
echo '<form action="' . $PAGE->url . '" method="post" id="adminsettings">';
|
||||
echo '<div class="settingsform clearfix">';
|
||||
echo html_writer::input_hidden_params($PAGE->url);
|
||||
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue