This repository has been archived on 2021-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
feiplogin/Classes/Slot/AddCustomGroupsSlot.php

26 lines
703 B
PHP

<?php
namespace In2code\In2frontendauthentication\Slot;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use In2code\In2frontendauthentication\Domain\Repository\FeGroupsRepository;
class AddCustomGroupsSlot
{
public function addCustomGroups($checkPermissions)
{
$feGroupsRepository = GeneralUtility::makeInstance(ObjectManager::class)
->get(FeGroupsRepository::class);
$feGroups = $feGroupsRepository->findByCurrentIpAddress();
$customGroups = [];
foreach ($feGroups as $feGroup) {
$customGroups[] = $feGroup['uid'];
}
$checkPermissions->addCustomGroups($customGroups);
}
}