From b91e7aa17148e27142188f55f74cc682e7a65aed Mon Sep 17 00:00:00 2001 From: Steve Allison Date: Thu, 21 Feb 2013 14:19:50 +0000 Subject: [PATCH] Move authenticate to end, remove isBanned() --- defense.php | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/defense.php b/defense.php index d61f584..31f2b20 100644 --- a/defense.php +++ b/defense.php @@ -206,17 +206,6 @@ class defense extends rcube_plugin { return $content } - /** - * Hooked function: authenticate($host, $user, $cookiecheck, $valid) - * Login attempt intercepted if IP is banned. - * - * @param var (untouched) - * @return var (untouched) - */ - public function hookAuthenticate($args) { - return $args; - } - /** * Hooked function: login_failed($host, $user, $code) * Log event to database @@ -281,18 +270,18 @@ class defense extends rcube_plugin { } - - + /** - * Return true if logs indicate given IP is banned + * Hooked function: authenticate($host, $user, $cookiecheck, $valid) + * Login attempt intercepted if IP is banned. * - * @param string ip - * @return bool - * + * @param var (untouched) + * @return var (untouched) */ - public function isBanned($ip) { - $query = "SELECT count(id) FROM " . $this->db_table . " WHERE ip = ? AND "; + public function hookAuthenticate($args) { + return $args; } + }