diff options
author | Daniel <mail@danielkesselberg.de> | 2023-04-24 16:26:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-24 16:26:30 +0200 |
commit | 2abefff2899952ea422d708fbda611f1695125fd (patch) | |
tree | 004964f9a16ef75bda8eeb46860b6c6b01626f7a /apps/user_ldap | |
parent | 4953296b9e87037b742a463018974f4cda76752a (diff) | |
parent | 0186194ae969dfebe260733a587e83984a11230f (diff) | |
download | nextcloud-server-2abefff2899952ea422d708fbda611f1695125fd.tar.gz nextcloud-server-2abefff2899952ea422d708fbda611f1695125fd.zip |
Merge pull request #36784 from nextcloud/fix/user_ldap-update-groups-fail-get
Properly test and log when a group is not found
Diffstat (limited to 'apps/user_ldap')
-rw-r--r-- | apps/user_ldap/lib/Jobs/UpdateGroups.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/Jobs/UpdateGroups.php b/apps/user_ldap/lib/Jobs/UpdateGroups.php index 86b4b2b59f4..48687494a61 100644 --- a/apps/user_ldap/lib/Jobs/UpdateGroups.php +++ b/apps/user_ldap/lib/Jobs/UpdateGroups.php @@ -44,7 +44,7 @@ use OCP\IUserManager; use Psr\Log\LoggerInterface; class UpdateGroups extends TimedJob { - /** @var ?array<string, array{owncloudusers: string, owncloudname: string}> */ + /** @var ?array<string, array{owncloudusers: string, owncloudname: string}> */ private ?array $groupsFromDB = null; private Group_Proxy $groupBackend; private IEventDispatcher $dispatcher; @@ -157,6 +157,17 @@ class UpdateGroups extends TimedJob { $hasChanged = false; $groupObject = $this->groupManager->get($group); + if ($groupObject === null) { + /* We are not expecting the group to not be found since it was returned by $this->groupBackend->getGroups() */ + $this->logger->error( + 'bgJ "updateGroups" – Failed to get group {group} for update', + [ + 'app' => 'user_ldap', + 'group' => $group + ] + ); + continue; + } foreach (array_diff($knownUsers, $actualUsers) as $removedUser) { $userObject = $this->userManager->get($removedUser); if ($userObject instanceof IUser) { |