add check for user

This commit is contained in:
Markus Gärtner 2022-03-14 11:14:24 +01:00
parent 81b9602b10
commit 9e5c91bed7
2 changed files with 54 additions and 1 deletions

View 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 oeCaptchaUser extends oeCaptchaUser_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;
}
}

View File

@ -46,7 +46,8 @@ $aModule = array(
'suggest' => 'oe/captcha/controllers/oecaptchasuggest',
'oxwarticledetails' => 'oe/captcha/application/component/widget/oecaptchawarticledetails',
\OxidEsales\Eshop\Application\Component\UserComponent::class => 'oe/captcha/application/component/oeusercomponent',
'register' => 'oe/captcha/controllers/oecaptcharegister'
'register' => 'oe/captcha/controllers/oecaptcharegister',
'user' => 'oe/captcha/controllers/oecaptchauser'
),
'files' => array(
'oecaptcha' => 'oe/captcha/core/oecaptcha.php',