From 7b9d0be608113b63236c31a55aed8f12bb222817 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 1 Mar 2023 17:22:21 +0100 Subject: [PATCH] unmark deleted users if their last login date is more recent than deleted date Signed-off-by: Robin Appelman --- apps/user_ldap/lib/User/DeletedUsersIndex.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/user_ldap/lib/User/DeletedUsersIndex.php b/apps/user_ldap/lib/User/DeletedUsersIndex.php index d679ca86d93ac..6ed14213d97d6 100644 --- a/apps/user_ldap/lib/User/DeletedUsersIndex.php +++ b/apps/user_ldap/lib/User/DeletedUsersIndex.php @@ -56,7 +56,12 @@ private function fetchDeletedUsers(): array { $userObjects = []; foreach ($deletedUsers as $user) { - $userObjects[] = new OfflineUser($user, $this->config, $this->mapping, $this->shareManager); + $userObject = new OfflineUser($user, $this->config, $this->mapping, $this->shareManager);; + if ($userObject->getLastLogin() > $userObject->getDetectedOn()) { + $userObject->unmark(); + } else { + $userObjects[] = $userObject; + } } $this->deletedUsers = $userObjects;