diff --git a/config b/config index 615d695..700aea7 100644 --- a/config +++ b/config @@ -1,4 +1,5 @@ [general] page=home emailAddress=YOUR.EMAIL@EXAMPLE.COM -language=en_US \ No newline at end of file +language=en_US +reCaptchaSiteKey=0 diff --git a/contact-form.php b/contact-form.php index 93552b8..eb8d731 100644 --- a/contact-form.php +++ b/contact-form.php @@ -5,7 +5,7 @@ * It allows to add and manage additional contents on a page. * * @author Thijs Ferket www.ferket.net - * @forked and adapted by Herman Adema + * @forked and adapted by Herman Adema * @forked by Jeremy Czajkowski * @forked by Robert Isoski @robiso * @version 3.0.0 @@ -23,9 +23,14 @@ define('CONTACT_FORM_PAGE', $configuration ['page']); define('CONTACT_FORM_EMAIL', $configuration ['emailAddress']); define('CONTACT_FORM_LANG', $configuration ['language']); +define('CONTACT_FORM_RECAPTCHA_SITE_KEY', $configuration ['reCaptchaSiteKey']); $Wcms->addListener('css', 'contactfCSS'); +if (CONTACT_FORM_RECAPTCHA_SITE_KEY) { + $Wcms->addListener('js', 'recaptchaJS'); +} + function contactfCSS($args) { global $Wcms; @@ -34,6 +39,19 @@ function contactfCSS($args) { return $args; } +function recaptchaJS($args) { + global $Wcms; + + $script = ''; + $script .= ''; + $args[0].=$script; + return $args; +} + function contactfCONTENT() { global $Wcms; @@ -164,7 +182,7 @@ function checkmail($email) { } else { $sent = false; - } + } // header ('Location: ' . $_SERVER['REQUEST_URI']); if ($sent) { echo "


" . $i18n['result_sent'] . "

"; @@ -184,7 +202,7 @@ function checkmail($email) { } $final_content .= "
"; - $final_content .= "
"; + $final_content .= ""; $final_content .= "

"; $final_content .= "

"; $final_content .= "

"; $final_content .= ""; $final_content .= "
"; diff --git a/version b/version index cb2b00e..b502146 100644 --- a/version +++ b/version @@ -1 +1 @@ -3.0.1 +3.0.2