From 4ee052641e0d654d91efb6b3c2ed212328860aac Mon Sep 17 00:00:00 2001 From: Martin Mastny Date: Fri, 15 May 2015 14:24:20 +0800 Subject: [PATCH] MDL-49493 backup: Implemented missing methods for anonymous backup --- .../helper/backup_anonymizer_helper.class.php | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/backup/util/helper/backup_anonymizer_helper.class.php b/backup/util/helper/backup_anonymizer_helper.class.php index 04a9d2da074..f3b5925a142 100644 --- a/backup/util/helper/backup_anonymizer_helper.class.php +++ b/backup/util/helper/backup_anonymizer_helper.class.php @@ -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. + } }