mirror of
https://git.d3data.de/3rdParty/captcha-module.git
synced 2024-11-21 22:23:10 +01:00
Captcha for newsletter subscription added
This form is often used for spam attacks. Requires new template blocks in the frontend theme.
This commit is contained in:
parent
88c9ffa235
commit
89d543156f
44
controllers/oecaptchanewsletter.php
Normal file
44
controllers/oecaptchanewsletter.php
Normal file
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -40,6 +40,7 @@ $aModule = array(
|
|||||||
'extend' => array('details' => 'oe/captcha/controllers/oecaptchadetails',
|
'extend' => array('details' => 'oe/captcha/controllers/oecaptchadetails',
|
||||||
'contact' => 'oe/captcha/controllers/oecaptchacontact',
|
'contact' => 'oe/captcha/controllers/oecaptchacontact',
|
||||||
'invite' => 'oe/captcha/controllers/oecaptchainvite',
|
'invite' => 'oe/captcha/controllers/oecaptchainvite',
|
||||||
|
'newsletter' => 'oe/captcha/controllers/oecaptchanewsletter',
|
||||||
'pricealarm' => 'oe/captcha/controllers/oecaptchapricealarm',
|
'pricealarm' => 'oe/captcha/controllers/oecaptchapricealarm',
|
||||||
'suggest' => 'oe/captcha/controllers/oecaptchasuggest',
|
'suggest' => 'oe/captcha/controllers/oecaptchasuggest',
|
||||||
'oxwarticledetails' => 'oe/captcha/application/component/widget/oecaptchawarticledetails'),
|
'oxwarticledetails' => 'oe/captcha/application/component/widget/oecaptchawarticledetails'),
|
||||||
@ -52,6 +53,7 @@ $aModule = array(
|
|||||||
),
|
),
|
||||||
'blocks' => array(
|
'blocks' => array(
|
||||||
array('template' => 'form/contact.tpl', 'block'=>'captcha_form', 'file'=>'/application/views/blocks/captcha_form.tpl'),
|
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/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/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/suggest.tpl', 'block'=>'captcha_form', 'file'=>'/application/views/blocks/captcha_form.tpl'),
|
||||||
|
Loading…
Reference in New Issue
Block a user