Skip to content

Commit

Permalink
Merge branch 'MDL-22510-m22' of git://github.com/ankitagarwal/moodle …
Browse files Browse the repository at this point in the history
…into MOODLE_22_STABLE
  • Loading branch information
Sam Hemelryk committed Mar 26, 2012
2 parents 015c334 + d06b2e0 commit ec202dd
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions lib/moodlelib.php
Expand Up @@ -2654,7 +2654,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);
Expand All @@ -2677,7 +2679,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);
}

Expand All @@ -2697,13 +2701,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');
}
}
Expand Down Expand Up @@ -2855,7 +2863,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);
}
}
Expand Down

0 comments on commit ec202dd

Please sign in to comment.