MDL-62670 policy: viewall.php must display always all active policies
authorSara Arjona <sara@moodle.com>
Wed, 4 Jul 2018 05:59:54 +0000 (07:59 +0200)
committerSara Arjona <sara@moodle.com>
Wed, 4 Jul 2018 10:04:41 +0000 (12:04 +0200)
The viewall.php page is called from the mobile app to display the policies
to the users before agree them. That's why it must display all the active
policies (even for guests), to guarantee the users agree all current
policies from the app.

admin/tool/policy/classes/output/page_viewalldoc.php

index f8dacf4..5ca5d99 100644 (file)
@@ -63,14 +63,7 @@ class page_viewalldoc implements renderable, templatable {
      *
      */
     protected function prepare_policies() {
-        global $USER;
-
-        if (isguestuser() || empty($USER->id)) {
-            $audience = policy_version::AUDIENCE_GUESTS;
-        } else {
-            $audience = policy_version::AUDIENCE_LOGGEDIN;
-        }
-        $this->policies = api::list_current_versions($audience);
+        $this->policies = api::list_current_versions();
     }
 
     /**