MDL-84274 tool_mfa: Prevent tool_policy pages from redirecting
This commit is contained in:
@@ -530,6 +530,13 @@ class manager {
|
||||
}
|
||||
}
|
||||
|
||||
// Site policies from tool_policy.
|
||||
$policyviewurl = new \moodle_url('/admin/tool/policy/view.php');
|
||||
$policyindexurl = new \moodle_url('/admin/tool/policy/index.php');
|
||||
if ($policyviewurl->compare($url, URL_MATCH_BASE) || $policyindexurl->compare($url, URL_MATCH_BASE)) {
|
||||
return self::NO_REDIRECT;
|
||||
}
|
||||
|
||||
// WS/AJAX check.
|
||||
if (WS_SERVER || AJAX_SCRIPT) {
|
||||
if (isset($SESSION->mfa_pending) && !empty($SESSION->mfa_pending)) {
|
||||
|
||||
@@ -304,3 +304,12 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
And I log out
|
||||
When I log in as "user1"
|
||||
Then I should see "Calendar"
|
||||
|
||||
Scenario: Policy acceptance is prioritised when MFA is enabled
|
||||
Given the following config values are set as admin:
|
||||
| enabled | 1 | tool_mfa |
|
||||
And I log in as "user1"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
When I press "Next"
|
||||
Then I should see "2-step verification"
|
||||
|
||||
Reference in New Issue
Block a user