Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'MDL-22510-m21' of git://github.com/ankitagarwal/moodle …

…into MOODLE_21_STABLE
  • Loading branch information...
commit c4d72072dc0e074e63c67aa1bf23d9a2ab4245fc 2 parents 88ead1b + 4d8cb11
@samhemelryk samhemelryk authored
Showing with 15 additions and 5 deletions.
  1. +15 −5 lib/moodlelib.php
View
20 lib/moodlelib.php
@@ -2413,7 +2413,9 @@ function require_login($courseorid = NULL, $autologinguest = true, $cm = NULL, $
if (get_user_preferences('auth_forcepasswordchange') && !session_is_loggedinas()) {
$userauth = get_auth_plugin($USER->auth);
if ($userauth->can_change_password() and !$preventredirect) {
- $SESSION->wantsurl = $FULLME;
+ if ($setwantsurltome) {
+ $SESSION->wantsurl = $FULLME;
+ }
if ($changeurl = $userauth->change_password_url()) {
//use plugin custom url
redirect($changeurl);
@@ -2436,7 +2438,9 @@ function require_login($courseorid = NULL, $autologinguest = true, $cm = NULL, $
if ($preventredirect) {
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);
}
@@ -2456,13 +2460,17 @@ function require_login($courseorid = NULL, $autologinguest = true, $cm = NULL, $
if ($preventredirect) {
throw new require_login_exception('Policy not agreed');
}
- $SESSION->wantsurl = $FULLME;
+ if ($setwantsurltome) {
+ $SESSION->wantsurl = $FULLME;
+ }
redirect($CFG->wwwroot .'/user/policy.php');
} else if (!empty($CFG->sitepolicyguest) and isguestuser()) {
if ($preventredirect) {
throw new require_login_exception('Policy not agreed');
}
- $SESSION->wantsurl = $FULLME;
+ if ($setwantsurltome) {
+ $SESSION->wantsurl = $FULLME;
+ }
redirect($CFG->wwwroot .'/user/policy.php');
}
}
@@ -2629,7 +2637,9 @@ function require_login($courseorid = NULL, $autologinguest = true, $cm = NULL, $
if ($preventredirect) {
throw new require_login_exception('Not enrolled');
}
- $SESSION->wantsurl = $FULLME;
+ if ($setwantsurltome) {
+ $SESSION->wantsurl = $FULLME;
+ }
redirect($CFG->wwwroot .'/enrol/index.php?id='. $course->id);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.