Issue 10050: Avoid creating new contacts for expired users

This commit is contained in:
Michael 2021-03-20 09:56:35 +00:00
parent f75dbdab5b
commit 531ef6e6e2
2 changed files with 7 additions and 3 deletions

View file

@ -399,7 +399,7 @@ class User
return false;
}
if (!$repairMissing) {
if (!$repairMissing || $owner['account_expired']) {
return $owner;
}
@ -1367,6 +1367,9 @@ class User
// unique), so it cannot be re-registered in the future.
DBA::insert('userd', ['username' => $user['nickname']]);
// Remove all personal settings, especially connector settings
DBA::delete('pconfig', ['uid' => $uid]);
// The user and related data will be deleted in Friendica\Worker\ExpireAndRemoveUsers
DBA::update('user', ['account_removed' => true, 'account_expires_on' => DateTimeFormat::utc('now + 7 day')], ['uid' => $uid]);
Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::REMOVAL, $uid);