From 29ffaf742422c8845a7c215ff5316e3c645f88ae Mon Sep 17 00:00:00 2001 From: Alex Kellner Date: Wed, 3 Aug 2016 15:53:03 +0200 Subject: [PATCH] [BUGFIX] Allow multiple usergroups --- Classes/Domain/Repository/FeGroupsRepository.php | 6 +++--- Classes/Domain/Service/AuthenticationService.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Classes/Domain/Repository/FeGroupsRepository.php b/Classes/Domain/Repository/FeGroupsRepository.php index 46944b2..cd319c8 100644 --- a/Classes/Domain/Repository/FeGroupsRepository.php +++ b/Classes/Domain/Repository/FeGroupsRepository.php @@ -42,13 +42,13 @@ class FeGroupsRepository */ public function findByCurrentIpAddress() { - $row = $this->getDatabaseConnection()->exec_SELECTgetSingleRow( + $rows = $this->getDatabaseConnection()->exec_SELECTgetRows( '*', self::TABLE_NAME, 'deleted = 0 and hidden = 0' . $this->getIpQueryString() ); - if ($row !== false) { - return $row; + if (!empty($rows)) { + return $rows; } return []; } diff --git a/Classes/Domain/Service/AuthenticationService.php b/Classes/Domain/Service/AuthenticationService.php index 1530eca..90b0cff 100644 --- a/Classes/Domain/Service/AuthenticationService.php +++ b/Classes/Domain/Service/AuthenticationService.php @@ -47,9 +47,9 @@ class AuthenticationService extends AuthenticationServiceCore { $feGroupsRepository = GeneralUtility::makeInstance(ObjectManager::class) ->get(FeGroupsRepository::class); - $feGroup = $feGroupsRepository->findByCurrentIpAddress(); - if (!empty($feGroup)) { - return $feGroup; + $feGroups = $feGroupsRepository->findByCurrentIpAddress(); + if (!empty($feGroups)) { + return $feGroups; } return parent::getGroups($user, $knownGroups); }