[BUGFIX] Allow multiple usergroups

This commit is contained in:
Alex Kellner 2016-08-03 15:53:03 +02:00
parent e655cb399b
commit 29ffaf7424
2 changed files with 6 additions and 6 deletions

View file

@ -42,13 +42,13 @@ class FeGroupsRepository
*/ */
public function findByCurrentIpAddress() public function findByCurrentIpAddress()
{ {
$row = $this->getDatabaseConnection()->exec_SELECTgetSingleRow( $rows = $this->getDatabaseConnection()->exec_SELECTgetRows(
'*', '*',
self::TABLE_NAME, self::TABLE_NAME,
'deleted = 0 and hidden = 0' . $this->getIpQueryString() 'deleted = 0 and hidden = 0' . $this->getIpQueryString()
); );
if ($row !== false) { if (!empty($rows)) {
return $row; return $rows;
} }
return []; return [];
} }

View file

@ -47,9 +47,9 @@ class AuthenticationService extends AuthenticationServiceCore
{ {
$feGroupsRepository = GeneralUtility::makeInstance(ObjectManager::class) $feGroupsRepository = GeneralUtility::makeInstance(ObjectManager::class)
->get(FeGroupsRepository::class); ->get(FeGroupsRepository::class);
$feGroup = $feGroupsRepository->findByCurrentIpAddress(); $feGroups = $feGroupsRepository->findByCurrentIpAddress();
if (!empty($feGroup)) { if (!empty($feGroups)) {
return $feGroup; return $feGroups;
} }
return parent::getGroups($user, $knownGroups); return parent::getGroups($user, $knownGroups);
} }