Commit aabc0dfd authored by Tino Goratsch's avatar Tino Goratsch

removed noCAPTCHA for now...

parent 2a5bf85b
......@@ -70,7 +70,6 @@ class RenderRecaptchaOnLayoutContentBeforeListener
{
return [
'captcha.extension.recaptcha_captcha_extension' => 'Captcha/Partials/captcha_recaptcha.onload.tpl',
'captcha.extension.nocaptcha_captcha_extension' => 'Captcha/Partials/captcha_nocaptcha.onload.tpl'
];
}
......
<?php
/**
* Copyright (c) 2017 by the ACP3 Developers.
* See the LICENCE file at the top-level module directory for licencing details.
*/
namespace ACP3\Modules\ACP3\Captcha\Extension;
use ACP3\Core\Http\RequestInterface;
use ACP3\Core\I18n\Translator;
use ACP3\Core\Settings\SettingsInterface;
use ACP3\Core\View;
use ACP3\Modules\ACP3\Users\Model\UserModel;
class NoCaptchaCaptchaExtension extends ReCaptchaCaptchaExtension
{
const TEMPLATE = 'Captcha/Partials/captcha_nocaptcha.tpl';
/**
* @var Translator
*/
private $translator;
/**
* NoCaptchaCaptchaExtension constructor.
* @param Translator $translator
* @param RequestInterface $request
* @param SettingsInterface $settings
* @param View $view
* @param UserModel $user
*/
public function __construct(
Translator $translator,
RequestInterface $request,
SettingsInterface $settings,
View $view,
UserModel $user
) {
parent::__construct($translator, $request, $settings, $view, $user);
$this->translator = $translator;
}
/**
* @inheritdoc
*/
public function getCaptchaName()
{
return $this->translator->t('captcha', 'recaptcha_invisible');
}
}
......@@ -6,7 +6,6 @@
jQuery(document).ready(function ($) {
var $recaptchaWrapper = $('#recaptcha-wrapper'),
serviceIds = [
'captcha.extension.nocaptcha_captcha_extension',
'captcha.extension.recaptcha_captcha_extension'
];
......
{javascripts}
<script type="text/javascript"
src="https://www.google.com/recaptcha/api.js?hl={$recaptcha.lang}"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$(document).on('acp3.ajaxFrom.submit.before', function(e, ajaxForm) {
jQuery('.recaptcha-placeholder').each(function() {
console.log(this.id);
var widget = grecaptcha.render(this.id, {
'sitekey': '{$recaptcha.sitekey}',
'size': this.dataset.size,
'callback': function() {
ajaxForm.isFormValid = true;
}
});
grecaptcha.execute(widget);
});
});
});
</script>
{/javascripts}
<div id="{$captcha.id}"
class="recaptcha-placeholder"
data-size="invisible">
</div>
<div class="recaptcha-placeholder"></div>
......@@ -23,12 +23,6 @@ services:
tags:
- { name: 'captcha.extension.captcha' }
captcha.extension.nocaptcha_captcha_extension:
class: ACP3\Modules\ACP3\Captcha\Extension\NoCaptchaCaptchaExtension
parent: captcha.extension.recaptcha_captcha_extension
tags:
- { name: 'captcha.extension.captcha' }
captcha.extension.recaptcha_captcha_extension:
class: ACP3\Modules\ACP3\Captcha\Extension\ReCaptchaCaptchaExtension
arguments:
......
......@@ -12,7 +12,6 @@
<item key="mod_description">Captchas bieten wirkungsvollen Schutz gegen Spambots.</item>
<item key="native">ACP3-Nativ</item>
<item key="recaptcha">reCAPTCHA</item>
<item key="recaptcha_invisible">reCAPTCHA (Unsichtbar)</item>
<item key="recaptcha_secret">reCAPTCHA Secret</item>
<item key="recaptcha_sitekey">reCAPTCHA Sitekey</item>
<item key="select_captcha_type">Bitte wählen Sie den zu verwendenten Captcha-Typen aus.</item>
......
......@@ -12,7 +12,6 @@
<item key="mod_description">Captchas provide effective protection against spambots.</item>
<item key="native">ACP3 native</item>
<item key="recaptcha">reCAPTCHA</item>
<item key="recaptcha_invisible">Invisible reCAPTCHA</item>
<item key="recaptcha_secret">reCAPTCHA secret</item>
<item key="recaptcha_sitekey">reCAPTCHA sitekey</item>
<item key="select_captcha_type">Please select the captcha type which should be used.</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment