Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 402] [Versions 311 and 403]

Privacy Subsystem implementation for mod_forum.

Copyright: 2018 Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 1362 lines (60 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: provider  - X-Ref

Implementation of the privacy subsystem plugin provider for the forum activity module.

get_metadata(collection $items)   X-Ref
Returns meta data about this system.

param: collection     $items The initialised collection to add items to.
return: collection     A listing of user data stored through this system.

get_contexts_for_userid(int $userid)   X-Ref
Get the list of contexts that contain user information for the specified user.

In the case of forum, that is any forum where the user has made any post, rated any content, or has any preferences.

param: int         $userid     The user to search.
return: contextlist $contextlist  The contextlist containing the list of contexts used in this plugin.

get_users_in_context(userlist $userlist)   X-Ref
Get the list of users within a specific context.

param: userlist    $userlist   The userlist containing the list of users who have data in this context/plugin combination.

export_user_preferences(int $userid)   X-Ref
Store all user preferences for the plugin.

param: int         $userid The userid of the user whose data is to be exported.

export_user_data(approved_contextlist $contextlist)   X-Ref
Export all user data for the specified user, in the specified contexts.

param: approved_contextlist    $contextlist    The approved contexts to export information for.

export_discussion_data(int $userid, array $mappings)   X-Ref
Store all information about all discussions that we have detected this user to have access to.

param: int         $userid The userid of the user whose data is to be exported.
param: array       $mappings A list of mappings from forumid => contextid.
return: array       Which forums had data written for them.

export_all_posts(int $userid, array $mappings)   X-Ref
Store all information about all posts that we have detected this user to have access to.

param: int         $userid The userid of the user whose data is to be exported.
param: array       $mappings A list of mappings from forumid => contextid.
return: array       Which forums had data written for them.

export_all_posts_in_discussion(int $userid, \context $context, \stdClass $discussion)   X-Ref
Store all information about all posts that we have detected this user to have access to.

param: int         $userid The userid of the user whose data is to be exported.
param: \context    $context The instance of the forum context.
param: \stdClass   $discussion The discussion whose data is being exported.

export_posts_in_structure(int $userid, \context $context, $parentarea, \stdClass $structure)   X-Ref
Export all posts in the provided structure.

param: int         $userid The userid of the user whose data is to be exported.
param: \context    $context The instance of the forum context.
param: array       $parentarea The subcontext of the parent.
param: \stdClass   $structure The post structure and all of its children

export_post_data(int $userid, \context $context, $postarea, $post)   X-Ref
Export all data in the post.

param: int         $userid The userid of the user whose data is to be exported.
param: \context    $context The instance of the forum context.
param: array       $postarea The subcontext of the parent.
param: \stdClass   $post The post structure and all of its children

export_digest_data(int $userid, \stdClass $forum, int $maildigest)   X-Ref
Store data about daily digest preferences

param: int         $userid The userid of the user whose data is to be exported.
param: \stdClass   $forum The forum whose data is being exported.
param: int         $maildigest The mail digest setting for this forum.
return: bool        Whether any data was stored.

export_subscription_data(int $userid, \stdClass $forum, int $subscribed)   X-Ref
Store data about whether the user subscribes to forum.

param: int         $userid The userid of the user whose data is to be exported.
param: \stdClass   $forum The forum whose data is being exported.
param: int         $subscribed if the user is subscribed
return: bool        Whether any data was stored.

export_discussion_subscription_data(int $userid, \context_module $context, \stdClass $discussion)   X-Ref
Store data about whether the user subscribes to this particular discussion.

param: int         $userid The userid of the user whose data is to be exported.
param: \context_module $context The instance of the forum context.
param: \stdClass   $discussion The discussion whose data is being exported.
return: bool        Whether any data was stored.

export_tracking_data(int $userid, \stdClass $forum, int $tracked)   X-Ref
Store forum read-tracking data about a particular forum.

This is whether a forum has read-tracking enabled or not.

param: int         $userid The userid of the user whose data is to be exported.
param: \stdClass   $forum The forum whose data is being exported.
param: int         $tracke if the user is subscribed
return: bool        Whether any data was stored.

export_grading_data(int $userid, \stdClass $forum, int $grade)   X-Ref
No description

export_grade_data(int $grade, \context $context, \stdClass $forum, array $path)   X-Ref
No description

export_read_data(int $userid, \context_module $context, array $postarea, \stdClass $post)   X-Ref
Store read-tracking information about a particular forum post.

param: int         $userid The userid of the user whose data is to be exported.
param: \context_module $context The instance of the forum context.
param: array       $postarea The subcontext for this post.
param: \stdClass   $post The post whose data is being exported.
return: bool        Whether any data was stored.

delete_data_for_all_users_in_context(\context $context)   X-Ref
Delete all data for all users in the specified context.

param: context                 $context   The specific context to delete data for.

delete_data_for_user(approved_contextlist $contextlist)   X-Ref
Delete all user data for the specified user, in the specified contexts.

param: approved_contextlist    $contextlist    The approved contexts and user information to delete information for.

delete_data_for_users(approved_userlist $userlist)   X-Ref
Delete multiple users within a single context.

param: approved_userlist       $userlist The approved context and user information to delete information for.