From 1f48cd2892a6b0c0d9f95fdd5b512a36842b267a Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 1 Jun 2006 05:40:45 +0000 Subject: [PATCH] Bug #5661 - mymoodle redirect problem; merged from MOODLE_16_STABLE --- login/index.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/login/index.php b/login/index.php index a0c25d5589..618b4b7a8e 100644 --- a/login/index.php +++ b/login/index.php @@ -163,6 +163,7 @@ } + /// Prepare redirection if (user_not_fully_set_up($USER)) { $urltogo = $CFG->wwwroot.'/user/edit.php?id='.$USER->id.'&course='.SITEID; // We don't delete $SESSION->wantsurl yet, so we get there later @@ -172,13 +173,19 @@ unset($SESSION->wantsurl); } else { - $urltogo = $CFG->wwwroot.'/my'; /// Go to the standard home page - if (isadmin() || empty($CFG->mymoodleredirect) || isguest()) { - $urltogo = $CFG->wwwroot; /// not needed by admins or guests or when it's turned off + // no wantsurl stored or external - go to homepage + $urltogo = $CFG->wwwroot; + unset($SESSION->wantsurl); + } + + /// Go to my-moodle page instead of homepage if mymoodleredirect enabled + if (!isadmin() and !empty($CFG->mymoodleredirect) and !isguest()) { + if ($urltogo == $CFG->wwwroot or $urltogo == $CFG->wwwroot.'/' or $urltogo == $CFG->wwwroot.'/index.php') { + $urltogo = $CFG->wwwroot.'/my/'; } - unset($SESSION->wantsurl); /// Just in case } + // check if user password has expired // Currently supported only for ldap-authentication module if (isset($CFG->ldap_expiration) && $CFG->ldap_expiration == 1 ) { -- 2.39.5