mirror of
https://git.d3data.de/3rdParty/captcha-module.git
synced 2024-11-04 22:26:56 +01:00
add check for register
This commit is contained in:
parent
b8f1c7e8aa
commit
0c74177b15
39
application/component/oeusercomponent.php
Normal file
39
application/component/oeusercomponent.php
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* #PHPHEADER_OECAPTCHA_LICENSE_INFORMATION#
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Article detailed information widget.
|
||||||
|
*/
|
||||||
|
class oeUserComponent extends oeUserComponent_parent
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Class handling CAPTCHA image.
|
||||||
|
*
|
||||||
|
* @var object
|
||||||
|
*/
|
||||||
|
protected $captcha = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function createUser()
|
||||||
|
{
|
||||||
|
if (!$this->getCaptcha()->passCaptcha()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent::createUser();
|
||||||
|
}
|
||||||
|
}
|
52
controllers/oecaptcharegister.php
Normal file
52
controllers/oecaptcharegister.php
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* #PHPHEADER_OECAPTCHA_LICENSE_INFORMATION#
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Article suggestion page.
|
||||||
|
* Collects some article base information, sets default recomendation text,
|
||||||
|
* sends suggestion mail to user.
|
||||||
|
*/
|
||||||
|
class oeCaptchaRegister extends oeCaptchaRegister_parent
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Class handling CAPTCHA image.
|
||||||
|
*
|
||||||
|
* @var object
|
||||||
|
*/
|
||||||
|
protected $captcha = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends product suggestion mail and returns a URL according to
|
||||||
|
* URL formatting rules.
|
||||||
|
*
|
||||||
|
* Template variables:
|
||||||
|
* <b>editval</b>, <b>error</b>
|
||||||
|
*
|
||||||
|
* @return null
|
||||||
|
*/
|
||||||
|
public function send()
|
||||||
|
{
|
||||||
|
// spam spider prevension
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
@ -44,7 +44,10 @@ $aModule = array(
|
|||||||
'newsletter' => 'oe/captcha/controllers/oecaptchanewsletter',
|
'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',
|
||||||
|
\OxidEsales\Eshop\Application\Component\UserComponent::class => 'oe/captcha/application/component/oeusercomponent',
|
||||||
|
'register' => 'oe/captcha/controllers/oecaptcharegister'
|
||||||
|
),
|
||||||
'files' => array(
|
'files' => array(
|
||||||
'oecaptcha' => 'oe/captcha/core/oecaptcha.php',
|
'oecaptcha' => 'oe/captcha/core/oecaptcha.php',
|
||||||
'oecaptchaEvents' => 'oe/captcha/core/oecaptchaevents.php',
|
'oecaptchaEvents' => 'oe/captcha/core/oecaptchaevents.php',
|
||||||
@ -59,6 +62,8 @@ $aModule = array(
|
|||||||
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'),
|
||||||
array('template' => 'form/forgotpwd_email.tpl', 'block'=>'captcha_form', 'file'=>'/application/views/blocks/captcha_form_forgotpwd.tpl'),
|
array('template' => 'form/forgotpwd_email.tpl', 'block'=>'captcha_form', 'file'=>'/application/views/blocks/captcha_form_forgotpwd.tpl'),
|
||||||
|
array('template' => 'form/fieldset/user_billing.tpl', 'block'=>'captcha_form', 'file'=>'/application/views/blocks/captcha_form.tpl'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
'settings' => array(
|
'settings' => array(
|
||||||
array('group' => 'main', 'name' => 'oecaptchakey', 'type' => 'str', 'value' => ''),
|
array('group' => 'main', 'name' => 'oecaptchakey', 'type' => 'str', 'value' => ''),
|
||||||
|
Loading…
Reference in New Issue
Block a user