mirror of
https://git.d3data.de/3rdParty/captcha-module.git
synced 2024-12-21 20:06:16 +01:00
Merge pull request #6 from SeifertDaniel/feature/newslettercaptcha
Captcha for newsletter subscription added
This commit is contained in:
commit
f8bdc5285c
@ -1,3 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="oecaptcha.tpl"}]
|
||||
[{include file="oecaptcha.tpl" labelCssClass="col-lg-2" inputCssClass="col-lg-10"}]
|
||||
|
3
application/views/blocks/captcha_form_forgotpwd.tpl
Normal file
3
application/views/blocks/captcha_form_forgotpwd.tpl
Normal file
@ -0,0 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="oecaptcha.tpl" labelCssClass="col-md-3" inputCssClass="col-md-9"}]
|
@ -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()}]
|
||||
|
44
controllers/oecaptchaforgotpwd.php
Normal file
44
controllers/oecaptchaforgotpwd.php
Normal file
@ -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;
|
||||
}
|
||||
|
||||
}
|
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;
|
||||
}
|
||||
|
||||
}
|
@ -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' => ''),
|
||||
|
Loading…
Reference in New Issue
Block a user