miroir de
https://git.d3data.de/3rdParty/captcha-module.git
synchronisé 2024-11-21 14:13:11 +01:00
Captcha for newsletter subscription added
This form is often used for spam attacks. Requires new template blocks in the frontend theme.
Cette révision appartient à :
Parent
88c9ffa235
révision
89d543156f
44
controllers/oecaptchanewsletter.php
Fichier normal
44
controllers/oecaptchanewsletter.php
Fichier normal
@ -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',
|
||||
'contact' => 'oe/captcha/controllers/oecaptchacontact',
|
||||
'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,6 +53,7 @@ $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'),
|
||||
|
Chargement…
Référencer dans un nouveau ticket
Block a user