mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-22510 libraries: Set wantsurl only when $setwantsurltome is set in
require_login
This commit is contained in:
parent
c856a1f60b
commit
af572078cf
1 changed files with 15 additions and 5 deletions
|
@ -2726,7 +2726,9 @@ function require_login($courseorid = NULL, $autologinguest = true, $cm = NULL, $
|
||||||
if (get_user_preferences('auth_forcepasswordchange') && !session_is_loggedinas()) {
|
if (get_user_preferences('auth_forcepasswordchange') && !session_is_loggedinas()) {
|
||||||
$userauth = get_auth_plugin($USER->auth);
|
$userauth = get_auth_plugin($USER->auth);
|
||||||
if ($userauth->can_change_password() and !$preventredirect) {
|
if ($userauth->can_change_password() and !$preventredirect) {
|
||||||
$SESSION->wantsurl = $FULLME;
|
if ($setwantsurltome) {
|
||||||
|
$SESSION->wantsurl = $FULLME;
|
||||||
|
}
|
||||||
if ($changeurl = $userauth->change_password_url()) {
|
if ($changeurl = $userauth->change_password_url()) {
|
||||||
//use plugin custom url
|
//use plugin custom url
|
||||||
redirect($changeurl);
|
redirect($changeurl);
|
||||||
|
@ -2749,7 +2751,9 @@ function require_login($courseorid = NULL, $autologinguest = true, $cm = NULL, $
|
||||||
if ($preventredirect) {
|
if ($preventredirect) {
|
||||||
throw new require_login_exception('User not fully set-up');
|
throw new require_login_exception('User not fully set-up');
|
||||||
}
|
}
|
||||||
$SESSION->wantsurl = $FULLME;
|
if ($setwantsurltome) {
|
||||||
|
$SESSION->wantsurl = $FULLME;
|
||||||
|
}
|
||||||
redirect($CFG->wwwroot .'/user/edit.php?id='. $USER->id .'&course='. SITEID);
|
redirect($CFG->wwwroot .'/user/edit.php?id='. $USER->id .'&course='. SITEID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2769,13 +2773,17 @@ function require_login($courseorid = NULL, $autologinguest = true, $cm = NULL, $
|
||||||
if ($preventredirect) {
|
if ($preventredirect) {
|
||||||
throw new require_login_exception('Policy not agreed');
|
throw new require_login_exception('Policy not agreed');
|
||||||
}
|
}
|
||||||
$SESSION->wantsurl = $FULLME;
|
if ($setwantsurltome) {
|
||||||
|
$SESSION->wantsurl = $FULLME;
|
||||||
|
}
|
||||||
redirect($CFG->wwwroot .'/user/policy.php');
|
redirect($CFG->wwwroot .'/user/policy.php');
|
||||||
} else if (!empty($CFG->sitepolicyguest) and isguestuser()) {
|
} else if (!empty($CFG->sitepolicyguest) and isguestuser()) {
|
||||||
if ($preventredirect) {
|
if ($preventredirect) {
|
||||||
throw new require_login_exception('Policy not agreed');
|
throw new require_login_exception('Policy not agreed');
|
||||||
}
|
}
|
||||||
$SESSION->wantsurl = $FULLME;
|
if ($setwantsurltome) {
|
||||||
|
$SESSION->wantsurl = $FULLME;
|
||||||
|
}
|
||||||
redirect($CFG->wwwroot .'/user/policy.php');
|
redirect($CFG->wwwroot .'/user/policy.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2927,7 +2935,9 @@ function require_login($courseorid = NULL, $autologinguest = true, $cm = NULL, $
|
||||||
if ($preventredirect) {
|
if ($preventredirect) {
|
||||||
throw new require_login_exception('Not enrolled');
|
throw new require_login_exception('Not enrolled');
|
||||||
}
|
}
|
||||||
$SESSION->wantsurl = $FULLME;
|
if ($setwantsurltome) {
|
||||||
|
$SESSION->wantsurl = $FULLME;
|
||||||
|
}
|
||||||
redirect($CFG->wwwroot .'/enrol/index.php?id='. $course->id);
|
redirect($CFG->wwwroot .'/enrol/index.php?id='. $course->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue