diff --git a/admin/tool/log/store/standard/classes/privacy/provider.php b/admin/tool/log/store/standard/classes/privacy/provider.php index 73ca7671e6234..fb82a7508e64a 100644 --- a/admin/tool/log/store/standard/classes/privacy/provider.php +++ b/admin/tool/log/store/standard/classes/privacy/provider.php @@ -51,7 +51,7 @@ class provider implements * @return collection A listing of user data stored through this system. */ public static function get_metadata(collection $collection) { - $collection->add_database_table('log', [ + $collection->add_database_table('logstore_standard_log', [ 'eventname' => 'privacy:metadata:log:eventname', 'userid' => 'privacy:metadata:log:userid', 'relateduserid' => 'privacy:metadata:log:relateduserid', diff --git a/blocks/recent_activity/classes/privacy/provider.php b/blocks/recent_activity/classes/privacy/provider.php index 240af61bcbd24..9a4b9dea2652b 100644 --- a/blocks/recent_activity/classes/privacy/provider.php +++ b/blocks/recent_activity/classes/privacy/provider.php @@ -25,6 +25,10 @@ namespace block_recent_activity\privacy; +use core_privacy\local\metadata\collection; +use core_privacy\local\request\approved_contextlist; +use core_privacy\local\request\contextlist; + defined('MOODLE_INTERNAL') || die(); /** @@ -33,15 +37,61 @@ * @copyright 2018 Shamim Rezaie * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class provider implements \core_privacy\local\metadata\null_provider { +class provider implements \core_privacy\local\metadata\provider, + \core_privacy\local\request\plugin\provider { + + /** + * Returns metadata. + * + * @param collection $collection The initialised collection to add items to. + * @return collection A listing of user data stored through this system. + */ + public static function get_metadata(collection $collection) { + + // This plugin defines a db table but it is not considered personal data and, therefore, not exported or deleted. + $collection->add_database_table('block_recent_activity', [ + 'courseid' => 'privacy:metadata:block_recent_activity:courseid', + 'cmid' => 'privacy:metadata:block_recent_activity:cmid', + 'timecreated' => 'privacy:metadata:block_recent_activity:timecreated', + 'userid' => 'privacy:metadata:block_recent_activity:userid', + 'action' => 'privacy:metadata:block_recent_activity:action', + 'modname' => 'privacy:metadata:block_recent_activity:modname' + ], 'privacy:metadata:block_recent_activity'); + + return $collection; + } + + /** + * Get the list of contexts that contain user information for the specified user. + * + * @param int $userid The user to search. + * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. + */ + public static function get_contexts_for_userid($userid) { + return new contextlist(); + } + + /** + * Export all user data for the specified user, in the specified contexts. + * + * @param approved_contextlist $contextlist The approved contexts to export information for. + */ + public static function export_user_data(approved_contextlist $contextlist) { + } + + /** + * Delete all data for all users in the specified context. + * + * @param \context $context The specific context to delete data for. + */ + public static function delete_data_for_all_users_in_context(\context $context) { + } /** - * Get the language string identifier with the component's language - * file to explain why this plugin stores no data. + * Delete all user data for the specified user, in the specified contexts. * - * @return string + * @param approved_contextlist $contextlist The approved contexts and user information to delete information for. */ - public static function get_reason() { - return 'privacy:metadata'; + public static function delete_data_for_user(approved_contextlist $contextlist) { } } diff --git a/blocks/recent_activity/lang/en/block_recent_activity.php b/blocks/recent_activity/lang/en/block_recent_activity.php index 3f6eadb60fac0..a569a7a533f4d 100644 --- a/blocks/recent_activity/lang/en/block_recent_activity.php +++ b/blocks/recent_activity/lang/en/block_recent_activity.php @@ -25,6 +25,13 @@ $string['pluginname'] = 'Recent activity'; $string['privacy:metadata'] = 'The recent activity block contains a cache of data stored elsewhere in Moodle.'; +$string['privacy:metadata:block_recent_activity'] = 'Temporary log of recent teacher activity. Removed after two days'; +$string['privacy:metadata:block_recent_activity:action'] = 'Action: created, updated or deleted'; +$string['privacy:metadata:block_recent_activity:cmid'] = 'Course module id'; +$string['privacy:metadata:block_recent_activity:courseid'] = 'Course id'; +$string['privacy:metadata:block_recent_activity:modname'] = 'Module type name (for delete action)'; +$string['privacy:metadata:block_recent_activity:timecreated'] = 'Time when action was performed'; +$string['privacy:metadata:block_recent_activity:userid'] = 'User performing the action'; $string['recent_activity:addinstance'] = 'Add a new recent activity block'; $string['recent_activity:viewaddupdatemodule'] = 'View added and updated modules in recent activity block'; $string['recent_activity:viewdeletemodule'] = 'View deleted modules in recent activity block'; diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 3a5014c757a07..91e53bf5ac27c 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -1513,6 +1513,16 @@ $string['privacy:metadata:events_queue:stackdump'] = 'Any stacktrace associated with this event.'; $string['privacy:metadata:events_queue:timecreated'] = 'The time that this event was created.'; $string['privacy:metadata:events_queue:userid'] = 'The userid associated with this event.'; +$string['privacy:metadata:log'] = 'A collection of past events'; +$string['privacy:metadata:log:action'] = 'A description of the action'; +$string['privacy:metadata:log:cmid'] = 'cmid'; +$string['privacy:metadata:log:course'] = 'course'; +$string['privacy:metadata:log:info'] = 'Additional information'; +$string['privacy:metadata:log:ip'] = 'The IP address used at the time of the event'; +$string['privacy:metadata:log:module'] = 'module'; +$string['privacy:metadata:log:time'] = 'The date at wich the action took place'; +$string['privacy:metadata:log:url'] = 'The URL related to the event'; +$string['privacy:metadata:log:userid'] = 'The ID of the user who performed the action'; $string['privacy:metadata:task_adhoc'] = 'The status of adhoc tasks.'; $string['privacy:metadata:task_adhoc:component'] = 'The component owning the task.'; $string['privacy:metadata:task_adhoc:nextruntime'] = 'The earliest time to run this task.'; diff --git a/lang/en/user.php b/lang/en/user.php index 8a4d933a1ff73..8b0fd76ba30e5 100644 --- a/lang/en/user.php +++ b/lang/en/user.php @@ -75,6 +75,10 @@ $string['privacy:metadata:mnethostid'] = 'An identifier for the mnet host if used.'; $string['privacy:metadata:model'] = 'The device name, occam or iPhone etc..'; $string['privacy:metadata:msn'] = 'The MSN identifier of the user.'; +$string['privacy:metadata:my_pages'] = 'User pages - dashboard and profile. This table does not contain personal data and only used to link dashboard blocks to users'; +$string['privacy:metadata:my_pages:name'] = 'Page name'; +$string['privacy:metadata:my_pages:private'] = 'Whether or not the page is private (dashboard) or public (profile)'; +$string['privacy:metadata:my_pages:userid'] = 'The user who owns this page or 0 for system defaults'; $string['privacy:metadata:password'] = 'The password for this user to log into the system.'; $string['privacy:metadata:passwordresettablesummary'] = 'A table tracking password reset confirmation tokens'; $string['privacy:metadata:passwordtablesummary'] = 'A rotating log of hashes of previously used passwords for the user.'; @@ -87,6 +91,10 @@ $string['privacy:metadata:requester'] = 'An identifier to a user that requested this course.'; $string['privacy:metadata:requestsummary'] = 'Stores information about requests for courses that users make.'; $string['privacy:metadata:suspended'] = 'A flag to show if the user has been suspended on this system.'; +$string['privacy:metadata:user_preferences'] = 'Preferences associated with the given user'; +$string['privacy:metadata:user_preferences:name'] = 'Preference name'; +$string['privacy:metadata:user_preferences:userid'] = 'User id'; +$string['privacy:metadata:user_preferences:value'] = 'Preference value'; $string['privacy:metadata:username'] = 'The username for this user.'; $string['privacy:metadata:secret'] = 'Secret.. not sure.'; $string['privacy:metadata:sessdata'] = 'Session content'; diff --git a/lib/classes/privacy/provider.php b/lib/classes/privacy/provider.php index 078def9911c12..1170f02603bce 100644 --- a/lib/classes/privacy/provider.php +++ b/lib/classes/privacy/provider.php @@ -91,6 +91,16 @@ public static function get_metadata(collection $collection) { 'timecreated' => 'privacy:metadata:events_queue:timecreated', ], 'privacy:metadata:events_queue'); + // The log table is defined in core but used in logstore_legacy. + $collection->add_database_table('log', [ + 'time' => 'privacy:metadata:log:time', + 'userid' => 'privacy:metadata:log:userid', + 'ip' => 'privacy:metadata:log:ip', + 'action' => 'privacy:metadata:log:action', + 'url' => 'privacy:metadata:log:url', + 'info' => 'privacy:metadata:log:info' + ], 'privacy:metadata:log'); + return $collection; } diff --git a/mod/chat/classes/privacy/provider.php b/mod/chat/classes/privacy/provider.php index 40ba43bdc2156..ba6c46ab1db3f 100644 --- a/mod/chat/classes/privacy/provider.php +++ b/mod/chat/classes/privacy/provider.php @@ -65,10 +65,26 @@ public static function get_metadata(collection $collection) { 'timestamp' => 'privacy:metadata:messages:timestamp', ], 'privacy:metadata:messages'); - // The tables chat_messages_current and chat_users are not reported here + // The tables chat_messages_current and chat_users are not exported/deleted // because they are considered as short-lived data and are deleted on a - // regular basis by cron, or during normal requests. MDL-62006 was raised - // to discuss and/or implement support for those tables. + // regular basis by cron, or during normal requests. TODO MDL-62006. + + $collection->add_database_table('chat_messages_current', [ + 'userid' => 'privacy:metadata:messages:userid', + 'message' => 'privacy:metadata:messages:message', + 'issystem' => 'privacy:metadata:messages:issystem', + 'timestamp' => 'privacy:metadata:messages:timestamp' + ], 'privacy:metadata:chat_messages_current'); + + $collection->add_database_table('chat_users', [ + 'userid' => 'privacy:metadata:chat_users:userid', + 'version' => 'privacy:metadata:chat_users:version', + 'ip' => 'privacy:metadata:chat_users:ip', + 'firstping' => 'privacy:metadata:chat_users:firstping', + 'lastping' => 'privacy:metadata:chat_users:lastping', + 'lastmessageping' => 'privacy:metadata:chat_users:lastmessageping', + 'lang' => 'privacy:metadata:chat_users:lang' + ], 'privacy:metadata:chat_users'); return $collection; } diff --git a/mod/chat/lang/en/chat.php b/mod/chat/lang/en/chat.php index b2ae4df26e7fb..5d16172855f53 100644 --- a/mod/chat/lang/en/chat.php +++ b/mod/chat/lang/en/chat.php @@ -114,6 +114,15 @@ $string['pastchats'] = 'Past chat sessions'; $string['pluginadministration'] = 'Chat administration'; $string['pluginname'] = 'Chat'; +$string['privacy:metadata:chat_messages_current'] = 'Current chat session. This data is temporary and is deleted after the chat session is deleted'; +$string['privacy:metadata:chat_users'] = 'Keeps track of which users are in which chat rooms'; +$string['privacy:metadata:chat_users:firstping'] = 'Time of the first access to chat room'; +$string['privacy:metadata:chat_users:ip'] = 'User IP'; +$string['privacy:metadata:chat_users:lang'] = 'User language'; +$string['privacy:metadata:chat_users:lastmessageping'] = 'Time of the last message in this chat room'; +$string['privacy:metadata:chat_users:lastping'] = 'Time of the last access to chat room'; +$string['privacy:metadata:chat_users:userid'] = 'User id'; +$string['privacy:metadata:chat_users:version'] = 'How user accessed the chat (sockets/basic/ajax/header_js)'; $string['privacy:metadata:messages'] = 'A record of the messages sent during a chat session'; $string['privacy:metadata:messages:issystem'] = 'Whether the message is a system-generated message'; $string['privacy:metadata:messages:message'] = 'The message'; diff --git a/mod/forum/classes/privacy/provider.php b/mod/forum/classes/privacy/provider.php index 66e99994189b9..22482fe5d60c0 100644 --- a/mod/forum/classes/privacy/provider.php +++ b/mod/forum/classes/privacy/provider.php @@ -117,6 +117,14 @@ public static function get_metadata(collection $items) { 'forumid' => 'privacy:metadata:forum_track_prefs:forumid', ], 'privacy:metadata:forum_track_prefs'); + // The 'forum_queue' table stores temporary data that is not exported/deleted. + $items->add_database_table('forum_queue', [ + 'userid' => 'privacy:metadata:forum_queue:userid', + 'discussionid' => 'privacy:metadata:forum_queue:discussionid', + 'postid' => 'privacy:metadata:forum_queue:postid', + 'timemodified' => 'privacy:metadata:forum_queue:timemodified' + ], 'privacy:metadata:forum_queue'); + // Forum posts can be tagged and rated. $items->link_subsystem('core_tag', 'privacy:metadata:core_tag'); $items->link_subsystem('core_rating', 'privacy:metadata:core_rating'); diff --git a/mod/forum/lang/en/forum.php b/mod/forum/lang/en/forum.php index 5ccffce5e08d9..c67ae2741cc1f 100644 --- a/mod/forum/lang/en/forum.php +++ b/mod/forum/lang/en/forum.php @@ -454,6 +454,11 @@ $string['privacy:metadata:forum_posts:subject'] = 'The subject of the forum post.'; $string['privacy:metadata:forum_posts:totalscore'] = 'The message of the forum post.'; $string['privacy:metadata:forum_posts:userid'] = 'The ID of the user who authored the forum post.'; +$string['privacy:metadata:forum_queue'] = 'Temporary log of posts that will be mailed in digest form'; +$string['privacy:metadata:forum_queue:discussionid'] = 'Forum discussion id'; +$string['privacy:metadata:forum_queue:postid'] = 'Forum post id'; +$string['privacy:metadata:forum_queue:timemodified'] = 'The modified time of the original post'; +$string['privacy:metadata:forum_queue:userid'] = 'User who needs to be notified of the post'; $string['privacy:metadata:forum_read'] = 'Information about which posts have been read by the user.'; $string['privacy:metadata:forum_read:discussionid'] = 'The discussion that the post is in.'; $string['privacy:metadata:forum_read:firstread'] = 'The first time that the post was read.'; diff --git a/user/classes/privacy/provider.php b/user/classes/privacy/provider.php index c92732357c003..4b6680e39071b 100644 --- a/user/classes/privacy/provider.php +++ b/user/classes/privacy/provider.php @@ -154,6 +154,18 @@ public static function get_metadata(collection $collection) { 'requester' => 'privacy:metadata:requester' ]; + $mypages = [ + 'userid' => 'privacy:metadata:my_pages:userid', + 'name' => 'privacy:metadata:my_pages:name', + 'private' => 'privacy:metadata:my_pages:private', + ]; + + $userpreferences = [ + 'userid' => 'privacy:metadata:user_preferences:userid', + 'name' => 'privacy:metadata:user_preferences:name', + 'value' => 'privacy:metadata:user_preferences:value' + ]; + $collection->add_database_table('user', $userfields, 'privacy:metadata:usertablesummary'); $collection->add_database_table('user_password_history', $passwordhistory, 'privacy:metadata:passwordtablesummary'); $collection->add_database_table('user_password_resets', $userpasswordresets, 'privacy:metadata:passwordresettablesummary'); @@ -161,6 +173,8 @@ public static function get_metadata(collection $collection) { $collection->add_database_table('user_devices', $userdevices, 'privacy:metadata:devicetablesummary'); $collection->add_database_table('course_request', $courserequest, 'privacy:metadata:requestsummary'); $collection->add_database_table('sessions', $usersessions, 'privacy:metadata:sessiontablesummary'); + $collection->add_database_table('my_pages', $mypages, 'privacy:metadata:my_pages'); + $collection->add_database_table('user_preferences', $userpreferences, 'privacy:metadata:user_preferences'); $collection->add_subsystem_link('core_files', [], 'privacy:metadata:filelink'); return $collection;