Merge pull request #6 from SeifertDaniel/feature/newslettercaptcha

Captcha for newsletter subscription added
This commit is contained in:
Marco Steinhaeuser 2020-12-10 09:22:50 +01:00 gecommit door GitHub
bovenliggende 88c9ffa235 087f912897
commit f8bdc5285c
Geen bekende sleutel gevonden voor deze handtekening in de database
GPG sleutel-ID: 4AEE18F83AFDEB23
6 gewijzigde bestanden met toevoegingen van 98 en 3 verwijderingen

Bestand weergeven

@ -1,3 +1,3 @@
[{$smarty.block.parent}]
[{include file="oecaptcha.tpl"}]
[{include file="oecaptcha.tpl" labelCssClass="col-lg-2" inputCssClass="col-lg-10"}]

Bestand weergeven

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="oecaptcha.tpl" labelCssClass="col-md-3" inputCssClass="col-md-9"}]

Bestand weergeven

@ -2,9 +2,9 @@
<input type="hidden" name="c_mach" value="[{$oCaptcha->getHash()}]"/>
<div class="form-group verify">
<label class="req control-label col-lg-2" for="c_mac">[{oxmultilang ident="VERIFICATION_CODE"}]</label>
<label class="req control-label [{$labelCssClass}]" for="c_mac">[{oxmultilang ident="VERIFICATION_CODE"}]</label>
<div class="col-lg-10 controls">
<div class="[{$inputCssClass}] controls">
<div class="input-group">
<span class="input-group-addon">
[{if $oCaptcha->isImageVisible()}]

Bestand weergeven

@ -0,0 +1,44 @@
<?php
/**
* #PHPHEADER_OECAPTCHA_LICENSE_INFORMATION#
*/
class oeCaptchaForgotPwd extends oeCaptchaForgotPwd_parent
{
/**
* Class handling CAPTCHA image.
*
* @var object
*/
protected $captcha = null;
/**
* Composes and sends user written message, returns false if some parameters
* are missing.
*
* @return bool
*/
public function forgotpassword()
{
if (!$this->getCaptcha()->passCaptcha()) {
return false;
}
return parent::forgotpassword();
}
/**
* Template variable getter. Returns object of handling CAPTCHA image
*
* @return object
*/
public function getCaptcha()
{
if ($this->captcha === null) {
$this->captcha = oxNew('oeCaptcha');
}
return $this->captcha;
}
}

Bestand weergeven

@ -0,0 +1,44 @@
<?php
/**
* #PHPHEADER_OECAPTCHA_LICENSE_INFORMATION#
*/
class oeCaptchaNewsletter extends oeCaptchaNewsletter_parent
{
/**
* Class handling CAPTCHA image.
*
* @var object
*/
protected $captcha = null;
/**
* Composes and sends user written message, returns false if some parameters
* are missing.
*
* @return bool
*/
public function send()
{
if (!$this->getCaptcha()->passCaptcha()) {
return false;
}
return parent::send();
}
/**
* Template variable getter. Returns object of handling CAPTCHA image
*
* @return object
*/
public function getCaptcha()
{
if ($this->captcha === null) {
$this->captcha = oxNew('oeCaptcha');
}
return $this->captcha;
}
}

Bestand weergeven

@ -39,7 +39,9 @@ $aModule = array(
'email' => '',
'extend' => array('details' => 'oe/captcha/controllers/oecaptchadetails',
'contact' => 'oe/captcha/controllers/oecaptchacontact',
'forgotpwd' => 'oe/captcha/controllers/oecaptchaforgotpwd',
'invite' => 'oe/captcha/controllers/oecaptchainvite',
'newsletter' => 'oe/captcha/controllers/oecaptchanewsletter',
'pricealarm' => 'oe/captcha/controllers/oecaptchapricealarm',
'suggest' => 'oe/captcha/controllers/oecaptchasuggest',
'oxwarticledetails' => 'oe/captcha/application/component/widget/oecaptchawarticledetails'),
@ -52,9 +54,11 @@ $aModule = array(
),
'blocks' => array(
array('template' => 'form/contact.tpl', 'block'=>'captcha_form', 'file'=>'/application/views/blocks/captcha_form.tpl'),
array('template' => 'form/newsletter.tpl', 'block'=>'captcha_form', 'file'=>'/application/views/blocks/captcha_form.tpl'),
array('template' => 'form/privatesales/invite.tpl', 'block'=>'captcha_form', 'file'=>'/application/views/blocks/captcha_form.tpl'),
array('template' => 'form/pricealarm.tpl', 'block'=>'captcha_form', 'file'=>'/application/views/blocks/captcha_form.tpl'),
array('template' => 'form/suggest.tpl', 'block'=>'captcha_form', 'file'=>'/application/views/blocks/captcha_form.tpl'),
array('template' => 'form/forgotpwd_email.tpl', 'block'=>'captcha_form', 'file'=>'/application/views/blocks/captcha_form_forgotpwd.tpl'),
),
'settings' => array(
array('group' => 'main', 'name' => 'oecaptchakey', 'type' => 'str', 'value' => ''),