Simple update for hooks
-
I’d suggest the following mod, which adds almost no execution time or complexity and would have the side benefit of removing the scare notice, “This plugin hasn’t been updated in over two years”. It would allow plugin authors to implement logging.
@@ -367,6 +373,7 @@ $lockouts = array(); } if(isset($lockouts[$ip]) && time() < $lockouts[$ip]) { + do_action( 'limit_login_attempts_retry', $ip, 0, 'lockedout' ); return; } @@ -396,6 +403,9 @@ * Not lockout (yet!) * Do housecleaning (which also saves retry/valid values). */ + + do_action( 'limit_login_attempts_retry', $ip, $retries[$ip], 'ok' ); + limit_login_cleanup($retries, null, $valid); return; } @@ -412,11 +422,13 @@ * done as usual for whitelisted ips , but no lockout is done. */ if ($whitelisted) { + do_action( 'limit_login_attempts_retry', $ip, $retries[$ip], 'whitelisted' ); if ($retries[$ip] >= $retries_long) { unset($retries[$ip]); unset($valid[$ip]); } } else { + do_action( 'limit_login_attempts_retry', $ip, $retries[$ip], 'lockout' ); global $limit_login_just_lockedout; $limit_login_just_lockedout = true;
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Simple update for hooks’ is closed to new replies.