From 68c2bdb98e06602629a1a5290921972a85a34ae9 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 7 Mar 2024 06:12:36 +0000 Subject: [PATCH] Change the last activity for delegation parents and siblings as well --- src/Model/User.php | 5 +++++ src/Security/OAuth.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Model/User.php b/src/Model/User.php index 59ac7b46b5..5b06f5e77a 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -846,6 +846,11 @@ class User self::update($fields, $user['uid']); // Set the last activity for all identities of the user DBA::update('user', $fields, ['parent-uid' => $user['uid'], 'verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false]); + + if (!empty($user['parent-uid'])) { + self::update($fields, $user['parent-uid']); + DBA::update('user', $fields, ['parent-uid' => $user['parent-uid'], 'verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false]); + } } /** diff --git a/src/Security/OAuth.php b/src/Security/OAuth.php index 167c55487f..88dbdf4c2d 100644 --- a/src/Security/OAuth.php +++ b/src/Security/OAuth.php @@ -104,7 +104,7 @@ class OAuth } Logger::debug('Token found', $token); - $user = User::getById($token['uid'], ['uid', 'last-activity', 'login_date']); + $user = User::getById($token['uid'], ['uid', 'parent-uid', 'last-activity', 'login_date']); if (!empty($user)) { User::updateLastActivity($user, false); }