From a022a29b4771bdf92c22dbc64b101cfcbdb46201 Mon Sep 17 00:00:00 2001 From: Marcus Schwemer Date: Mon, 10 Jul 2017 14:46:21 +0200 Subject: [PATCH] [FEATURE] Add slot for allowing ip-based authentication --- Classes/Slot/AddCustomGroupsSlot.php | 26 ++++++++++++++++++++++++++ ext_localconf.php | 11 +++++++++++ 2 files changed, 37 insertions(+) create mode 100644 Classes/Slot/AddCustomGroupsSlot.php diff --git a/Classes/Slot/AddCustomGroupsSlot.php b/Classes/Slot/AddCustomGroupsSlot.php new file mode 100644 index 0000000..540e02e --- /dev/null +++ b/Classes/Slot/AddCustomGroupsSlot.php @@ -0,0 +1,26 @@ +get(FeGroupsRepository::class); + $feGroups = $feGroupsRepository->findByCurrentIpAddress(); + + + + $customGroups = []; + foreach ($feGroups as $feGroup) { + $customGroups[] = $feGroup['uid']; + } + + $checkPermissions->addCustomGroups($customGroups); + } +} diff --git a/ext_localconf.php b/ext_localconf.php index 9a28328..ec079ab 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -17,3 +17,14 @@ defined('TYPO3_MODE') || die(); 'className' => \In2code\In2frontendauthentication\Domain\Service\AuthenticationService::class, ] ); + +/** @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher */ +$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher'); +$signalSlotDispatcher->connect( + \BeechIt\FalSecuredownload\Security\CheckPermissions::class, + 'AddCustomGroups', + \In2code\In2frontendauthentication\Slot\AddCustomGroupsSlot::class, + 'addCustomGroups' +); + +