I'm using Google reCAPTCHA on joomla admini login section, Validation works fine.
Captcha validation added to administrator/components/com_login/models/login.php
$privatekey = "myprivatekey";
$resp = recaptcha_check_answer (
$privatekey,
$_SERVER["REMOTE_ADDR"],
JRequest::getVar('recaptcha_challenge_field', '', 'method', 'recaptcha_challenge_field'),
JRequest::getVar('recaptcha_response_field', '', 'method', 'recaptcha_response_field')
);
if (!$resp->is_valid) {
//die('Incorrect Captcha...');
}else{
$credentials = array(
'username' => JRequest::getVar('username', '', 'method', 'username'),
'password' => JRequest::getVar('passwd', '', 'post', 'string', JREQUEST_ALLOWRAW)
);
$this->setState('credentials', $credentials);
}
What should I use instead of //die('Incorrect Captcha...');
to output Invalid Captcha! Error in login page?