mirror of
https://github.com/moodle/moodle.git
synced 2025-05-31 21:19:49 +02:00
MDL-32508 course/view.php: action cleanup
After doing actions redirect back to the 'real url' in order to prevent problems with caching/bookmarking bad urls
This commit is contained in:
parent
599a52fec7
commit
e3c171e19b
@ -123,10 +123,12 @@
|
||||
if (has_capability('moodle/course:update', $context)) {
|
||||
if ($hide && confirm_sesskey()) {
|
||||
set_section_visible($course->id, $hide, '0');
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
|
||||
if ($show && confirm_sesskey()) {
|
||||
set_section_visible($course->id, $show, '1');
|
||||
redirect($PAGE->url);
|
||||
}
|
||||
|
||||
if (!empty($section)) {
|
||||
@ -135,7 +137,7 @@
|
||||
if ($course->id == SITEID) {
|
||||
redirect($CFG->wwwroot . '/?redirect=0');
|
||||
} else {
|
||||
redirect($PAGE->url);
|
||||
redirect(course_get_url($course));
|
||||
}
|
||||
} else {
|
||||
echo $OUTPUT->notification('An error occurred while moving a section');
|
||||
|
Loading…
x
Reference in New Issue
Block a user