Merge branch 'MDL-49493-master' of git://github.com/mastnym/moodle
authorDan Poltawski <dan@moodle.com>
Mon, 25 May 2015 11:00:44 +0000 (12:00 +0100)
committerDan Poltawski <dan@moodle.com>
Mon, 25 May 2015 11:00:44 +0000 (12:00 +0100)
backup/util/helper/backup_anonymizer_helper.class.php

index 04a9d2d..f3b5925 100644 (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.
+    }
 }