From f84547a0be56ca00f82e5d01e6e39f140de983ba Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Wed, 8 Apr 2026 12:36:49 +0200 Subject: [PATCH] refactor: Port hooks to IUserManager::getUserNameFromLoginName Signed-off-by: Carl Schwan --- lib/ComplianceService.php | 6 +----- tests/psalm-baseline.xml | 5 ----- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/ComplianceService.php b/lib/ComplianceService.php index f78bae49..8df8207a 100644 --- a/lib/ComplianceService.php +++ b/lib/ComplianceService.php @@ -34,9 +34,6 @@ class ComplianceService { public function __construct( private ContainerInterface $container, private LoggerInterface $logger, - private IUserSession $userSession, - private IConfig $config, - private ISession $session, private IUserManager $userManager, ) { } @@ -57,8 +54,7 @@ public function audit(IUser $user, string $password): void { * @throws LoginException */ public function entryControl(string $loginName, ?string $password): void { - $uid = $loginName; - \OCP\Util::emitHook('\OCA\Files_Sharing\API\Server2Server', 'preLoginNameUsedAsUserName', ['uid' => &$uid]); + $uid = $this->userManager->getUserNameFromLoginName($loginName); /** @var IEntryControl $instance */ foreach ($this->getInstance(IEntryControl::class) as $instance) { diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index 084f6b10..c5bafff6 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -14,11 +14,6 @@ - - - &$uid])]]> - -