MDL-49493 backup: Implemented missing methods for anonymous backup

This commit is contained in:
Martin Mastny 2015-05-15 14:24:20 +08:00
parent 803f565753
commit 4ee052641e

View File

@ -167,4 +167,48 @@ class backup_anonymizer_helper {
public static function process_user_imagealt($value) {
return ''; // No user imagealt
}
/**
* Anonymises user's phonetic name field
* @param string $value value of the user field
* @return string anonymised phonetic name
*/
public static function process_user_firstnamephonetic($value) {
static $counter = 0;
$counter++;
return 'anonfirstnamephonetic' . $counter; // Just a counter.
}
/**
* Anonymises user's phonetic last name field
* @param string $value value of the user field
* @return string anonymised last phonetic name
*/
public static function process_user_lastnamephonetic($value) {
static $counter = 0;
$counter++;
return 'anonlastnamephonetic' . $counter; // Just a counter.
}
/**
* Anonymises user's middle name field
* @param string $value value of the user field
* @return string anonymised middle name
*/
public static function process_user_middlename($value) {
static $counter = 0;
$counter++;
return 'anonmiddlename' . $counter; // Just a counter.
}
/**
* Anonymises user's alternate name field
* @param string $value value of the user field
* @return string anonymised alternate name
*/
public static function process_user_alternatename($value) {
static $counter = 0;
$counter++;
return 'anonalternatename' . $counter; // Just a counter.
}
}