/** * Rendering the output of the captcha * * @return string */ public function render() { $this->session->remove('captchaWasValidPreviously'); if ($this->captcha !== null) { $output = $this->captcha->getReCaptcha(); } else { $output = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('error_captcha.notinstalled', 'Recaptcha', ['recaptcha']); } return $output; }
/** * Rendering the output of the captcha * * @return string */ public function render() { $this->objectManager->get('Evoweb\\SfRegister\\Services\\Session')->remove('captchaWasValidPreviously'); if ($this->captcha !== null) { $output = $this->captcha->getReCaptcha(); } else { $output = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('error_captcha.notinstalled', 'Recaptcha', ['recaptcha']); } return $output; }
/** * Rendering the output of the captcha * * @return string */ public function render() { if ($this->captcha !== null) { $output = $this->captcha->getReCaptcha(); $status = $this->captcha->validateReCaptcha(); if ($status == false || $status['error'] !== '') { $output .= '<strong class="error">' . \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('error_recaptcha_' . $status['error'], 'Recaptcha') . '</strong>'; } } else { $output = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('error_captcha.notinstalled', 'Recaptcha', ['recaptcha']); } return $output; }
/** * Rendering the output of the captcha * * @return string */ public function render() { if ($this->captcha !== null) { $output = $this->captcha->getReCaptcha(); /** @var \TYPO3\CMS\Form\Validation\RecaptchaValidator $recaptchaValidator */ $recaptchaValidator = GeneralUtility::makeInstance('TYPO3\\CMS\\Form\\Validation\\RecaptchaValidator'); $validationError = $recaptchaValidator->getError(); if (count($validationError)) { /** @var ContentObjectRenderer $content */ $content = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer'); $output .= '<strong class="error">' . $content->cObjGetSingle($validationError['cObj'], $validationError['cObj.']) . '</strong>'; } } else { $output = LocalizationUtility::translate('error_captcha.notinstalled', 'Recaptcha', ['recaptcha']); } return $output; }