/** * Create and return the antibot armor HTML * * @param \string $content Content * @param \array $config Configuration * @return \string Armor fields */ public function armor($content, array $config) { try { $settings = \Tollwerk\TwAntibot\Utility\Utility::settings(); if (array_key_exists('antibot.', $config) && is_array($config['antibot.'])) { $typoscriptService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService'); $antibotSettings = $typoscriptService->convertTypoScriptArrayToPlainArray($config['antibot.']); \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($settings, $antibotSettings); } return \Tollwerk\TwAntibot\Validation\Validator::armor($settings); } catch (\Exception $e) { die(get_class($e)); } }
/** * Test if the current user is blocked access to the current form * * @return \boolean Blocked */ public function render() { $GLOBALS['TSFE']->set_no_cache(); // TODO: Only exclude the current plugin from cache?! return \Tollwerk\TwAntibot\Validation\Validator::armor($this->_extendedSettings); }