summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Chatzimichos <tampakrap@gentoo.org>2011-08-26 17:45:47 +0300
committerTheo Chatzimichos <tampakrap@gentoo.org>2011-08-26 17:45:47 +0300
commit5270f951fb580d2c21ca8cb31174d3cc44166ef4 (patch)
tree1acdfea6fc65c60a0ef39cc4eb8d6eb074245265 /plugins/limit-login-attempts/limit-login-attempts.php
parentUpdate wp-importer and wp-syntax (diff)
downloadblogs-gentoo-5270f951fb580d2c21ca8cb31174d3cc44166ef4.tar.gz
blogs-gentoo-5270f951fb580d2c21ca8cb31174d3cc44166ef4.tar.bz2
blogs-gentoo-5270f951fb580d2c21ca8cb31174d3cc44166ef4.zip
Update limit-login-attempts, smart-youtube and wp-stats
Diffstat (limited to 'plugins/limit-login-attempts/limit-login-attempts.php')
-rwxr-xr-xplugins/limit-login-attempts/limit-login-attempts.php36
1 files changed, 20 insertions, 16 deletions
diff --git a/plugins/limit-login-attempts/limit-login-attempts.php b/plugins/limit-login-attempts/limit-login-attempts.php
index 0407a8ea..a92f5b62 100755
--- a/plugins/limit-login-attempts/limit-login-attempts.php
+++ b/plugins/limit-login-attempts/limit-login-attempts.php
@@ -6,7 +6,7 @@
Author: Johan Eenfeldt
Author URI: http://devel.kostdoktorn.se
Text Domain: limit-login-attempts
- Version: 1.6.1
+ Version: 1.6.2
Copyright 2008 - 2011 Johan Eenfeldt
@@ -85,7 +85,7 @@ $limit_login_nonempty_credentials = false; /* user and pwd nonempty */
* Startup
*/
-limit_login_setup();
+add_action('init', 'limit_login_setup');
/*
@@ -501,22 +501,26 @@ function limit_login_notify_email($user) {
/* Logging of lockout (if configured) */
function limit_login_notify_log($user) {
- $log = get_option('limit_login_logged');
- $ip = limit_login_get_address();
+ $log = $option = get_option('limit_login_logged');
if (!is_array($log)) {
- $log = array($ip => array($user => 1));
- add_option('limit_login_logged', $log, '', 'no'); /* no autoload */
- } else {
- /* can be written much simpler, if you do not mind php warnings */
- if (isset($log[$ip])) {
- if (isset($log[$ip][$user])) {
- $log[$ip][$user]++;
- } else {
- $log[$ip][$user] = 1;
- }
+ $log = array();
+ }
+ $ip = limit_login_get_address();
+
+ /* can be written much simpler, if you do not mind php warnings */
+ if (isset($log[$ip])) {
+ if (isset($log[$ip][$user])) {
+ $log[$ip][$user]++;
} else {
- $log[$ip] = array($user => 1);
+ $log[$ip][$user] = 1;
}
+ } else {
+ $log[$ip] = array($user => 1);
+ }
+
+ if ($option === false) {
+ add_option('limit_login_logged', $log, '', 'no'); /* no autoload */
+ } else {
update_option('limit_login_logged', $log);
}
}
@@ -855,7 +859,7 @@ function limit_login_option_page() {
/* Should we clear log? */
if (isset($_POST['clear_log'])) {
- update_option('limit_login_logged', '');
+ delete_option('limit_login_logged');
echo '<div id="message" class="updated fade"><p>'
. __('Cleared IP log', 'limit-login-attempts')
. '</p></div>';