MDL-62418 tool_policy: Redirect always to home when agreed all policies

This commit is contained in:
Sara Arjona 2018-05-13 21:26:47 +02:00
parent 15ed7d938e
commit 5bf7f59a19
2 changed files with 2 additions and 3 deletions

View File

@ -278,9 +278,7 @@ class page_agreedocs implements renderable, templatable {
// and $SESSION->wantsurl is defined, redirect to the return page.
$hasagreedsignupuser = empty($USER->id) && $this->signupuserpolicyagreed;
$hasagreedloggeduser = $USER->id == $userid && !empty($USER->policyagreed);
$canrevoke = api::can_revoke_policies($USER->id);
if (!is_siteadmin() && ($hasagreedsignupuser ||
($hasagreedloggeduser && !$canrevoke))) {
if (!is_siteadmin() && ($hasagreedsignupuser || $hasagreedloggeduser)) {
$this->redirect_to_previous_url();
}

View File

@ -80,6 +80,7 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
And I press "Next"
And I set the field "I agree to the This site policy" to "1"
And I press "Next"
And I should not see "Next"
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
And I click on "1 of 4 (25%)" "link" in the "This site policy" "table_row"
And I click on "Consent not given" "link" in the "User One" "table_row"