Skip to content

Commit 80df5b7

Browse files
committed
Script: Cron: add possibility to empty an extra field when anonymizing a user -refs BT#21445
1 parent 58d3647 commit 80df5b7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/scripts/synchronize_user_base_from_ldap.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
//$extraLdapAttributes[0][] = 'description';
5252
//$extraLdapAttributes[0][] = 'userAccountControl';
5353

54-
54+
// Extra field to be emptied when user is anonimized to really make it anonyme, for example the sso id of the user
55+
// extraFieldToEmpty = "cas_user";
5556

5657

5758
use Chamilo\CoreBundle\Entity\ExtraFieldValues;
@@ -477,6 +478,9 @@
477478
or die("could not anonymize user $userId\n");
478479
} catch (Exception $exception) {
479480
die($exception->getMessage()."\n");
481+
}
482+
if (isset($extraFieldToEmpty)) {
483+
UserManager::update_extra_field_value($userId,$extraFieldToEmpty,'');
480484
}
481485
}
482486
if ($debug) {

0 commit comments

Comments
 (0)