Merge branch 'MDL-78173-402' of https://github.com/paulholden/moodle into MOODLE_402_STABLE

This commit is contained in:
Ilya Tregubov
2024-02-08 16:13:01 +08:00
committed by Andrew Nicols
+10 -3
View File
@@ -20,10 +20,10 @@ if (\core\session\manager::is_loggedinas()) {
}
if ($redirect) {
if ($id and $id != SITEID) {
if ($id && $id != SITEID) {
$SESSION->wantsurl = "$CFG->wwwroot/course/view.php?id=".$id;
} else {
$SESSION->wantsurl = "$CFG->wwwroot/";
$SESSION->wantsurl = "$CFG->wwwroot/?redirect=1";
}
redirect(get_login_url());
@@ -90,4 +90,11 @@ $strloggedinas = get_string('loggedinas', '', $newfullname);
$PAGE->set_title($strloggedinas);
$PAGE->set_heading($course->fullname);
$PAGE->navbar->add($strloggedinas);
notice($strloggedinas, "$CFG->wwwroot/course/view.php?id=$course->id");
if ($course->id != SITEID) {
$returnurl = course_get_url($course);
} else {
$returnurl = new moodle_url('/', ['redirect' => 1]);
}
notice($strloggedinas, $returnurl);