From 8f9727459a204abcb63dbca321d797117cb13baf Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Fri, 13 May 2005 05:10:17 +0000 Subject: [PATCH] Merged from MOODLE_14_STABLE - Fixes 'Erroneous redirection to course enrolment page' bug #3224 - patch by Patrick Li --- enrol/enrol.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/enrol/enrol.class.php b/enrol/enrol.class.php index 05453a11853..c7fd99aac3e 100644 --- a/enrol/enrol.class.php +++ b/enrol/enrol.class.php @@ -129,15 +129,15 @@ function print_entry($course) { if (isguest()) { add_to_log($course->id, "course", "guest", "view.php?id=$course->id", "$USER->id"); - } else if (empty($_GET['confirm'])) { + } else if (empty($_GET['confirm']) && empty($_GET['cancel'])) { print_header($strloginto, $course->fullname, "$strcourses -> $strloginto"); echo "
"; - notice_yesno(get_string("enrolmentconfirmation"), "enrol.php?id=$course->id&confirm=1", $CFG->wwwroot); + notice_yesno(get_string("enrolmentconfirmation"), "enrol.php?id=$course->id&confirm=1", "enrol.php?id=$course->id&cancel=1"); print_footer(); exit; - } else { + } elseif (!empty($_GET['confirm'])) { if ($course->enrolperiod) { $timestart = time(); $timeend = time() + $course->enrolperiod; @@ -170,6 +170,9 @@ function print_entry($course) { } redirect($destination); + } elseif (!empty($_GET['cancel'])) { + unset($SESSION->wantsurl); + redirect($CFG->wwwroot); } }