diff --git a/lang/en/local_pages.php b/lang/en/local_pages.php index 22e1363..e682868 100644 --- a/lang/en/local_pages.php +++ b/lang/en/local_pages.php @@ -67,6 +67,11 @@ $string['email_headers'] = 'Custom headers for PHP mail'; $string['user_copy'] = "Copy message to person"; $string['user_copy_description'] = "Select if the person filling in the form is to receive a message"; +$string['recaptcha_site_key'] = "Google reCaptcha site key"; +$string['recaptcha_site_key_description'] = "Included in the data sent to Google. When set, all forms will have a reCaptcha added and the user response will be validated."; +$string['recaptcha_secret_key'] = "Google reCaptcha secret key"; +$string['recaptcha_secret_key_description'] = "Used to validate the reCaptcha submission from the user"; +$string['invalid_recaptcha'] = 'The reCaptcha response did not verify. Please try again (with JavaScript enabled).'; $string['message_copy'] = "Message to go to user"; $string['message_copy_description'] = "Enter {field name} from the form to appear in the message. Use {table} to place the all form fields"; $string['enable_limit'] = "Limit emails to one per session"; diff --git a/renderer.php b/renderer.php index 91de531..906d587 100644 --- a/renderer.php +++ b/renderer.php @@ -283,6 +283,25 @@ public function createform($data) { $str .= '' . $this->error_fields[$value->name] . ''; } + $recaptcha_site_key = get_config('local_pages', 'recaptcha_site_key'); + if ($recaptcha_site_key) + { + $recaptcha_error = ""; + if (isset($this->error_fields['recaptcha'])) { + $recaptcha_error = '' . $this->error_fields['recaptcha'] . ''; + } + $str .= << +
+HTML; + + } + $str .= '