Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 310 and 400] [Versions 39 and 400]

(no description)

Copyright: 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 192 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: backup_anonymizer_helper  - X-Ref

Helper class for anonymization of data

This functions includes a collection of methods that are invoked
from the backup process when anonymization services have been
requested.

The name of each method must be "process_parentname_name", as defined
byt the @anonymizer_final_element final element class, where
parentname is the name ob the parent tag and name the name of the tag
contents to be anonymized (i.e. process_user_username) with one param
being the value to anonymize.

Note: current implementation of anonymization is pretty simple, just some
sequential values are used. If we want more elaborated generation, it
can be replaced later (using generators or wathever). Don't forget we must
ensure some fields (username, idnumber, email) are unique always.

TODO: Improve to use more advanced anonymization

TODO: Finish phpdocs
is_anonymous_user($user)   X-Ref
Determine if the given user is an 'anonymous' user, based on their username, firstname, lastname
and email address.

return: bool true if this is an 'anonymous' user
param: stdClass $user the user record to test

process_user_auth($value)   X-Ref
No description

process_user_username($value)   X-Ref
No description

process_user_idnumber($value)   X-Ref
No description

process_user_firstname($value)   X-Ref
No description

process_user_lastname($value)   X-Ref
No description

process_user_email($value)   X-Ref
No description

process_user_phone1($value)   X-Ref
No description

process_user_phone2($value)   X-Ref
No description

process_user_institution($value)   X-Ref
No description

process_user_department($value)   X-Ref
No description

process_user_address($value)   X-Ref
No description

process_user_city($value)   X-Ref
No description

process_user_country($value)   X-Ref
No description

process_user_lastip($value)   X-Ref
No description

process_user_picture($value)   X-Ref
No description

process_user_description($value)   X-Ref
No description

process_user_descriptionformat($value)   X-Ref
No description

process_user_imagealt($value)   X-Ref
No description

process_user_firstnamephonetic($value)   X-Ref
Anonymises user's phonetic name field

return: string anonymised phonetic name
param: string $value value of the user field

process_user_lastnamephonetic($value)   X-Ref
Anonymises user's phonetic last name field

return: string anonymised last phonetic name
param: string $value value of the user field

process_user_middlename($value)   X-Ref
Anonymises user's middle name field

return: string anonymised middle name
param: string $value value of the user field

process_user_alternatename($value)   X-Ref
Anonymises user's alternate name field

return: string anonymised alternate name
param: string $value value of the user field