mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Bug #5661 - mymoodle redirect problem; merged from MOODLE_16_STABLE
This commit is contained in:
parent
65d169680c
commit
1f48cd2892
@ -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
|
||||
}
|
||||
unset($SESSION->wantsurl); /// Just in case
|
||||
// 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/';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// check if user password has expired
|
||||
// Currently supported only for ldap-authentication module
|
||||
if (isset($CFG->ldap_expiration) && $CFG->ldap_expiration == 1 ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user