Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Static Public Member Functions | List of all members
backup_anonymizer_helper Class Reference

Helper class for anonymization of data. More...

Static Public Member Functions

static is_anonymous_user ($user)
 Determine if the given user is an 'anonymous' user, based on their username, firstname, lastname and email address. More...
 
static process_user_address ($value)
 
static process_user_aim ($value)
 
static process_user_alternatename ($value)
 Anonymises user's alternate name field. More...
 
static process_user_auth ($value)
 
static process_user_city ($value)
 
static process_user_country ($value)
 
static process_user_department ($value)
 
static process_user_description ($value)
 
static process_user_descriptionformat ($value)
 
static process_user_email ($value)
 
static process_user_firstname ($value)
 
static process_user_firstnamephonetic ($value)
 Anonymises user's phonetic name field. More...
 
static process_user_icq ($value)
 
static process_user_idnumber ($value)
 
static process_user_imagealt ($value)
 
static process_user_institution ($value)
 
static process_user_lastip ($value)
 
static process_user_lastname ($value)
 
static process_user_lastnamephonetic ($value)
 Anonymises user's phonetic last name field. More...
 
static process_user_middlename ($value)
 Anonymises user's middle name field. More...
 
static process_user_msn ($value)
 
static process_user_phone1 ($value)
 
static process_user_phone2 ($value)
 
static process_user_picture ($value)
 
static process_user_skype ($value)
 
static process_user_url ($value)
 
static process_user_username ($value)
 
static process_user_yahoo ($value)
 

Detailed Description

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

Member Function Documentation

◆ is_anonymous_user()

static backup_anonymizer_helper::is_anonymous_user (   $user)
static

Determine if the given user is an 'anonymous' user, based on their username, firstname, lastname and email address.

Parameters
stdClass$userthe user record to test
Return values
booltrue if this is an 'anonymous' user

◆ process_user_alternatename()

static backup_anonymizer_helper::process_user_alternatename (   $value)
static

Anonymises user's alternate name field.

Parameters
string$valuevalue of the user field
Return values
stringanonymised alternate name

◆ process_user_firstnamephonetic()

static backup_anonymizer_helper::process_user_firstnamephonetic (   $value)
static

Anonymises user's phonetic name field.

Parameters
string$valuevalue of the user field
Return values
stringanonymised phonetic name

◆ process_user_lastnamephonetic()

static backup_anonymizer_helper::process_user_lastnamephonetic (   $value)
static

Anonymises user's phonetic last name field.

Parameters
string$valuevalue of the user field
Return values
stringanonymised last phonetic name

◆ process_user_middlename()

static backup_anonymizer_helper::process_user_middlename (   $value)
static

Anonymises user's middle name field.

Parameters
string$valuevalue of the user field
Return values
stringanonymised middle name

The documentation for this class was generated from the following file: