diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index b6c29b41fcc0..3efe523d922f 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -292,10 +292,7 @@ public function buildQuickForm() { if (count($this->_paymentProcessors) >= 1 && !$this->get_template_vars("isCaptcha") && $this->hasToAddForcefully()) { if (!$this->_userID) { - $this->enableCaptchaOnForm(); - } - else { - $this->displayCaptchaWarning(); + CRM_Utils_ReCAPTCHA::enableCaptchaOnForm($this); } } diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 9749d03e47fe..58e15df2afd7 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -756,19 +756,12 @@ public function buildCustom($id, $name, $viewOnly = FALSE, $profileContactType = } if ($addCaptcha && !$viewOnly) { - $this->enableCaptchaOnForm(); + CRM_Utils_ReCAPTCHA::enableCaptchaOnForm($this); } } } } - /** - * Enable ReCAPTCHA on Contribution form - */ - protected function enableCaptchaOnForm() { - CRM_Utils_ReCAPTCHA::enableCaptchaOnForm($this); - } - /** * Assign payment field information to the template. * @@ -827,17 +820,6 @@ public function assignPaymentFields() { } } - /** - * Display ReCAPTCHA warning on Contribution form - */ - protected function displayCaptchaWarning() { - if (CRM_Core_Permission::check("administer CiviCRM")) { - if (!CRM_Utils_ReCAPTCHA::hasSettingsAvailable()) { - $this->assign('displayCaptchaWarning', TRUE); - } - } - } - /** * Check if ReCAPTCHA has to be added on Contribution form forcefully. */ diff --git a/templates/CRM/Contribute/Form/Contribution/Main.tpl b/templates/CRM/Contribute/Form/Contribution/Main.tpl index 1a8d2180539e..fcbb26bfac41 100644 --- a/templates/CRM/Contribute/Form/Contribution/Main.tpl +++ b/templates/CRM/Contribute/Form/Contribution/Main.tpl @@ -50,12 +50,6 @@ {include file="CRM/Contribute/Form/Contribution/PreviewHeader.tpl"} {/if} - {if $displayCaptchaWarning} -
- {/if} - {if call_user_func(array('CRM_Core_Permission','check'), 'administer CiviCRM') } {capture assign="buttonTitle"}{ts}Configure Contribution Page{/ts}{/capture} {crmButton target="_blank" p="civicrm/admin/contribute/settings" q="reset=1&action=update&id=`$contributionPageID`" fb=1 title="$buttonTitle" icon="fa-wrench"}{ts}Configure{/ts}{/crmButton}