Source of file NoCaptchaField.php
Size: 0,689 Bytes - Last Modified: 2021-12-23T10:51:35+00:00
/var/www/docs.ssmods.com/process/src/code/NoCaptchaField.php
12345678910111213141516171819202122232425262728293031323334353637383940414243 | <?php class NoCaptchaField extends FormField { function Field($properties = array()) { $api_key = $this->config()->PublicKey; return <<<HTML <div class="g-recaptcha" data-sitekey="$api_key"></div> HTML; } public function validate($validator) { if( !isset($_REQUEST['g-recaptcha-response']) || empty($_REQUEST['g-recaptcha-response']) ) { $validator->validationError( $this->name, _t( 'RecaptchaField.EMPTY', "Please check the 'I am not a robot' box" ), "validation", false ); return false; } return true; } public function setFieldMapping($array) { $this->spamFieldMapping = $array; } } |