Skip to content

Commit

Permalink
Merge pull request #158 from catalyst/url_issues
Browse files Browse the repository at this point in the history
Issue #148: Updated manager to $FULLME
  • Loading branch information
Peterburnett authored Feb 13, 2020
2 parents 4fad514 + 4e3745f commit f2cde8e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions classes/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ public static function sleep_timer() {
*/
public static function require_auth($courseorid = null, $autologinguest = null, $cm = null,
$setwantsurltome = null, $preventredirect = null) {
global $SESSION, $ME;
global $PAGE, $SESSION, $FULLME;

if (!self::is_ready()) {
// Set session var so if MFA becomes ready, you dont get locked from session.
Expand All @@ -467,7 +467,12 @@ public static function require_auth($courseorid = null, $autologinguest = null,
}

if (empty($SESSION->tool_mfa_authenticated) || !$SESSION->tool_mfa_authenticated) {
$cleanurl = new \moodle_url($ME);
if ($PAGE->has_set_url()) {
$cleanurl = $PAGE->url;
} else {
// Use $FULLME instead.
$cleanurl = new \moodle_url($FULLME);
}
$authurl = new \moodle_url('/admin/tool/mfa/auth.php');

$redir = self::should_require_mfa($cleanurl, $preventredirect);
Expand Down

0 comments on commit f2cde8e

Please sign in to comment.