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:
Dan Poltawski 2012-04-28 13:47:02 +08:00
parent 599a52fec7
commit e3c171e19b

View File

@ -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');