Skip to content

Commit d97ac3d

Browse files
committed
Update installer and add checks
1 parent 44368fd commit d97ac3d

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

eicaptcha.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,10 @@ public function hookDisplayNewsletterRegistration($params)
376376
*/
377377
public function hookActionNewsletterRegistrationBefore($params)
378378
{
379-
if (Configuration::get('CAPTCHA_ENABLE_NEWSLETTER') == 1 && $this->canUseCaptchaOnNewsletter()) {
379+
if (Configuration::get('CAPTCHA_ENABLE_NEWSLETTER') == 1
380+
&& $this->canUseCaptchaOnNewsletter()
381+
&& $this->shouldDisplayToCustomer()
382+
) {
380383
if (!$this->_validateCaptcha()) {
381384
$params['hookError'] = $this->l('Please validate the captcha field before submitting your request');
382385
}

src/Installer.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Installer
3737
'displayHeader',
3838
'displayCustomerAccountForm',
3939
'displayNewsletterRegistration',
40-
'actionContactFormSubmitCaptcha',
40+
'actionCustomerRegisterSubmitCaptcha',
4141
'actionContactFormSubmitBefore',
4242
'actionNewsletterRegistrationBefore',
4343
'actionAdminControllerSetMedia',
@@ -94,7 +94,8 @@ protected function installConfigurations()
9494
&& Configuration::updateValue('CAPTCHA_ENABLE_CONTACT', 0)
9595
&& Configuration::updateValue('CAPTCHA_ENABLE_NEWSLETTER', 0)
9696
&& Configuration::updateValue('CAPTCHA_THEME', 0)
97-
&& Configuration::updateValue('CAPTCHA_DEBUG', 0);
97+
&& Configuration::updateValue('CAPTCHA_DEBUG', 0)
98+
&& Configuration::updateValue('CAPTCHA_ENABLE_LOGGED_CUSTOMERS', 1);
9899
}
99100

100101
/**
@@ -107,6 +108,7 @@ protected function uninstallConfigurations()
107108
&& Configuration::deleteByName('CAPTCHA_ENABLE_NEWSLETTER')
108109
&& Configuration::deleteByName('CAPTCHA_THEME')
109110
&& Configuration::deleteByName('CAPTCHA_DEBUG')
110-
&& Configuration::deleteByName('CAPTCHA_VERSION');
111+
&& Configuration::deleteByName('CAPTCHA_VERSION')
112+
&& Configuration::deleteByName('CAPTCHA_ENABLE_LOGGED_CUSTOMERS');
111113
}
112114
}

0 commit comments

Comments
 (0)