public function validation($data, $files) {
        $errors = parent::validation($data, $files);

        if (signup_captcha_enabled()) {
            $recaptchaelement = $this->_form->getElement('recaptcha_element');
            if (!empty($this->_form->_submitValues['g-recaptcha-response'])) {
                $response = $this->_form->_submitValues['g-recaptcha-response'];
                if (!$recaptchaelement->verify($response)) {
                    $errors['recaptcha_element'] = get_string('incorrectpleasetryagain', 'auth');
                }
            } else {
                $errors['recaptcha_element'] = get_string('missingrecaptchachallengefield');
            }
        }

        $errors += signup_validate_data($data, $files);

        return $errors;
    }
public function validation($data, $files) {
        $errors = parent::validation($data, $files);

        if (signup_captcha_enabled()) {
            $recaptchaelement = $this->_form->getElement('recaptcha_element');
            if (!empty($this->_form->_submitValues['g-recaptcha-response'])) {
                $response = $this->_form->_submitValues['g-recaptcha-response'];
                if (!$recaptchaelement->verify($response)) {
                    $errors['recaptcha_element'] = get_string('incorrectpleasetryagain', 'auth');
                }
            } else {
                $errors['recaptcha_element'] = get_string('missingrecaptchachallengefield');
            }
        }

        $errors += signup_validate_data($data, $files);

        return $errors;
    }
public function validation ( $ data , $ files ) { $ errors = parent :: validation ( $ data , $ files ) ; if ( signup_captcha_enabled ( ) ) { $ recaptchaelement = $ this -> _form -> getElement ( 'recaptcha_element' ) ; if ( ! empty ( $ this -> _form -> _submitValues [ 'g-recaptcha-response' ] ) ) { $ response = $ this -> _form -> _submitValues [ 'g-recaptcha-response' ] ; if ( ! $ recaptchaelement -> verify ( $ response ) ) { $ errors [ 'recaptcha_element' ] = get_string ( 'incorrectpleasetryagain' , 'auth' ) ; } } else { $ errors [ 'recaptcha_element' ] = get_string ( 'missingrecaptchachallengefield' ) ; } } $ errors += signup_validate_data ( $ data , $ files ) ; return $ errors ; }
Validate user supplied data on the signup form.

@param array $data array of ("fieldname"=>value) of submitted data
@param array $files array of uploaded files "element_name"=>tmp_file_path
@return array of "element_name"=>"error_description" if there are errors,
or an empty array if everything is OK (true allowed for backwards compatibility too).
Validate user supplied data on the signup form .