Merge branch 'MDL-84274-405' of https://github.com/davewoloszyn/moodle into MOODLE_405_STABLE

This commit is contained in:
Huong Nguyen
2025-05-21 13:36:09 +07:00
5 changed files with 20 additions and 5 deletions
+7
View File
@@ -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)) {
+1 -1
View File
@@ -58,7 +58,7 @@ $agreedocs = array_values(array_unique($agreedocs));
$declinedocs = array_values(array_unique($declinedocs));
$PAGE->set_context(context_system::instance());
$PAGE->set_pagelayout('standard');
$PAGE->set_pagelayout('secure');
$PAGE->set_url('/admin/tool/policy/index.php');
$PAGE->set_popup_notification_allowed(false);
@@ -304,3 +304,14 @@ 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 the following config values are set as admin:
| enabled | 1 | factor_email |
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"
@@ -290,9 +290,6 @@ Feature: User must accept policy managed by this plugin when logging in and sign
And I set the field "I agree to the This privacy policy." to "0"
Then I should see "Please agree to the following policies:"
And I should see "Before continuing you need to acknowledge all these policies."
# Confirm that user can not browse the site (edit their profile).
When I follow "Profile" in the user menu
Then I should see "Please agree to the following policies:"
Scenario: Accept policy on login, accept all policies
Given the following config values are set as admin:
+1 -1
View File
@@ -47,7 +47,7 @@ $numpolicy = optional_param('numpolicy', null, PARAM_INT);
$totalpolicies = optional_param('totalpolicies', null, PARAM_INT);
$PAGE->set_context(context_system::instance());
$PAGE->set_pagelayout('standard');
$PAGE->set_pagelayout('secure');
$viewpage = new page_viewdoc($policyid, $versionid, $returnurl, $behalfid, $manage, $numpolicy, $totalpolicies);