X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=blobdiff_plain;f=course%2Fview.php;fp=course%2Fview.php;h=7317094058ffea3d91502ffb4d5ba17978945ca7;hp=73095db91b8d30757162afee237f430899166c78;hb=74f0b722545b508a1d3a33f85ddce2b3ef812783;hpb=b37a5a000fefcbe281eb98da58ca02fd9bef1b02;ds=sidebyside diff --git a/course/view.php b/course/view.php index 73095db91b8..7317094058f 100644 --- a/course/view.php +++ b/course/view.php @@ -107,14 +107,24 @@ if ($PAGE->user_allowed_editing()) { if (($edit == 1) and confirm_sesskey()) { $USER->editing = 1; - redirect($PAGE->url); + // Redirect to site root if Editing is toggled on frontpage + if ($course->id == SITEID) { + redirect($CFG->wwwroot .'/?redirect=0'); + } else { + redirect($PAGE->url); + } } else if (($edit == 0) and confirm_sesskey()) { $USER->editing = 0; if(!empty($USER->activitycopy) && $USER->activitycopycourse == $course->id) { $USER->activitycopy = false; $USER->activitycopycourse = NULL; } - redirect($PAGE->url); + // Redirect to site root if Editing is toggled on frontpage + if ($course->id == SITEID) { + redirect($CFG->wwwroot .'/?redirect=0'); + } else { + redirect($PAGE->url); + } } if (has_capability('moodle/course:update', $context)) {