[英]Joomla Administration Login Custom Error
I'm using Google reCAPTCHA on joomla admini login section, Validation works fine. 我在joomla管理员登录部分上使用了Google reCAPTCHA,验证工作正常。
Captcha validation added to administrator/components/com_login/models/login.php
验证码验证已添加到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...');
我应该用什么代替//die('Incorrect Captcha...');
to output Invalid Captcha! 输出无效的验证码! Error in login page? 登录页面错误?
Try this- 尝试这个-
$app = JFactory::getApplication();
$app->enqueueMessage('Incorrect Captcha...', 'error');
$app->redirect(JURI::base());
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.