Skip to content

Commit

Permalink
Script: Cron: add possibility to empty an extra field when anonymizin…
Browse files Browse the repository at this point in the history
…g a user -refs BT#21445
  • Loading branch information
NicoDucou committed Mar 6, 2024
1 parent 58d3647 commit 80df5b7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/scripts/synchronize_user_base_from_ldap.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
//$extraLdapAttributes[0][] = 'description';
//$extraLdapAttributes[0][] = 'userAccountControl';


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


use Chamilo\CoreBundle\Entity\ExtraFieldValues;
Expand Down Expand Up @@ -477,6 +478,9 @@
or die("could not anonymize user $userId\n");
} catch (Exception $exception) {
die($exception->getMessage()."\n");
}
if (isset($extraFieldToEmpty)) {
UserManager::update_extra_field_value($userId,$extraFieldToEmpty,'');
}
}
if ($debug) {
Expand Down

0 comments on commit 80df5b7

Please sign in to comment.