diff --git a/controllers/oecaptchauser.php b/controllers/oecaptchauser.php new file mode 100644 index 0000000..81eb8a6 --- /dev/null +++ b/controllers/oecaptchauser.php @@ -0,0 +1,52 @@ +editval, error + * + * @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; + } +} diff --git a/metadata.php b/metadata.php index b37181b..1c44928 100755 --- a/metadata.php +++ b/metadata.php @@ -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',