* Added new event hook 'backend_loginfail' to track failed logins

(serendipity_event_externalauth can make use of it for fail2ban)
This commit is contained in:
Garvin Hicking 2011-05-31 14:02:02 +00:00
parent 272e55b943
commit 187941aac6
2 changed files with 10 additions and 0 deletions

View File

@ -3,6 +3,9 @@
Version 1.6 ()
------------------------------------------------------------------------
* Added new event hook 'backend_loginfail' to track failed logins
(serendipity_event_externalauth can make use of it for fail2ban)
* Fixed a bug in synchronizing new files with the same basename
but different extensions, where files with the same mimetype
would not get added (garvinhicking)

View File

@ -384,6 +384,7 @@ function serendipity_login($use_external = true) {
if (empty($serendipity['POST']['auto'])) {
serendipity_deleteCookie('author_information');
serendipity_deleteCookie('author_information_iv');
return false;
} else {
serendipity_issueAutologin(
@ -397,6 +398,9 @@ function serendipity_login($use_external = true) {
} elseif (isset($serendipity['COOKIE']['author_information'])) {
$cookie = serendipity_checkAutologin($serendipity['COOKIE']['author_information'], $serendipity['COOKIE']['author_information_iv']);
$data = array('ext' => $use_external, 'mode' => 1, 'user' => $cookie['username'], 'pass' => $cookie['password']);
serendipity_plugin_api::hook_event('backend_loginfail', $data);
if (is_array($cookie) && serendipity_authenticate_author($cookie['username'], $cookie['password'], false, $use_external)) {
return true;
} else {
@ -405,6 +409,9 @@ function serendipity_login($use_external = true) {
return false;
}
}
$data = array('ext' => $use_external, 'mode' => 2, 'user' => $serendipity['POST']['user'], 'pass' => $serendipity['POST']['pass']);
serendipity_plugin_api::hook_event('backend_loginfail', $data);
}
/**