Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

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

(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.

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

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

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

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

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

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

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

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

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