Skip to content

Commit

Permalink
Bug #5661 - mymoodle redirect problem
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jun 1, 2006
1 parent 6d895ae commit ec7418d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions login/index.php
Expand Up @@ -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
Expand All @@ -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 ) {
Expand Down

0 comments on commit ec7418d

Please sign in to comment.