Joomla 2.5 如何检测失败的前端登录尝试

Joomla 2.5 how to detect failed front-end log-in attempt

我正在开发一个Joomla 2.5 系统插件,它需要在前端访问者尝试登录但失败时执行某些任务。

如何在我的系统插件中检测到用户身份验证失败?

有一个事件onUserLoginFailure你可以赶上。

onUserLoginFailure

Description: This event is triggered whenever a user authentication request is failed by any plugin.

Parameters: Two parameters. The credentials array for the user (see onAuthenticate), and the JAuthenticateResponse that caused the failure.

Return Value: Unknown. The return value appears to be ignored in any case.

Used in files: libraries/joomla/application/user/authentication.php

参考:onUserLoginFailure