8
0
Mirror von https://git.d3data.de/3rdParty/captcha-module.git synchronisiert 2024-11-21 14:13:11 +01:00

add check for register

Dieser Commit ist enthalten in:
Markus Gärtner 2022-02-23 09:20:32 +01:00
Ursprung 2b8493d37a
Commit 81b9602b10
3 geänderte Dateien mit 97 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -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();
}
}

Datei anzeigen

@ -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;
}
}

Datei anzeigen

@ -44,7 +44,10 @@ $aModule = array(
'newsletter' => 'oe/captcha/controllers/oecaptchanewsletter',
'pricealarm' => 'oe/captcha/controllers/oecaptchapricealarm',
'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(
'oecaptcha' => 'oe/captcha/core/oecaptcha.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/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/fieldset/user_billing.tpl', 'block'=>'captcha_form', 'file'=>'/application/views/blocks/captcha_form.tpl'
),
),
'settings' => array(
array('group' => 'main', 'name' => 'oecaptchakey', 'type' => 'str', 'value' => ''),