MDL-61899 tool_dataprivacy: Add missing get_role_users fields
authorDavid Monllao <davidm@moodle.com>
Fri, 20 Apr 2018 15:46:49 +0000 (17:46 +0200)
committerDavid Monllao <davidm@moodle.com>
Fri, 20 Apr 2018 15:46:49 +0000 (17:46 +0200)
admin/tool/dataprivacy/classes/api.php

index da87d8a..9ec5f45 100644 (file)
@@ -140,8 +140,15 @@ class api {
             if (empty($roleid)) {
                 continue;
             }
+            $allnames = get_all_user_name_fields(true, 'u');
+            $fields = 'u.id, u.confirmed, u.username, '. $allnames . ', ' .
+                      'u.maildisplay, u.mailformat, u.maildigest, u.email, u.emailstop, u.city, '.
+                      'u.country, u.picture, u.idnumber, u.department, u.institution, '.
+                      'u.lang, u.timezone, u.lastaccess, u.mnethostid, u.auth, u.suspended, u.deleted, ' .
+                      'r.name AS rolename, r.sortorder, '.
+                      'r.shortname AS roleshortname, rn.name AS rolecoursealias';
             // Fetch users that can manage data requests.
-            $dpos += get_role_users($roleid, $context);
+            $dpos += get_role_users($roleid, $context, false, $fields);
         }
 
         // If the site has no data protection officer, defer to site admin(s).