Skip to content

Commit

Permalink
Merge pull request #68 from davidegiunchidiennea/master
Browse files Browse the repository at this point in the history
fix auth error on 4.2.3
  • Loading branch information
Arsenal21 authored Nov 29, 2016
2 parents 7fe2af5 + 29977b6 commit 58180f4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions all-in-one-wp-security/classes/wp-security-user-login.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function __construct()
{
$this->key_login_msg = 'aiowps_login_msg_id';
// As a first authentication step, check if user's IP is locked.
add_filter('authenticate', array($this, 'block_ip_if_locked'), 1, 0);
add_filter('authenticate', array($this, 'block_ip_if_locked'), 1, 1);
// Check whether user needs to be manually approved after default WordPress authenticate hooks (with priority 20).
add_filter('authenticate', array($this, 'check_manual_registration_approval'), 30, 1);
// Check login captcha
Expand All @@ -26,8 +26,10 @@ function __construct()
* user's IP is currently locked.
*
* @global AIO_WP_Security $aio_wp_security
* @param WP_Error|WP_User $user
* @return WP_User
*/
function block_ip_if_locked()
function block_ip_if_locked($user)
{
global $aio_wp_security;
$user_locked = $this->check_locked_user();
Expand All @@ -41,7 +43,9 @@ function block_ip_if_locked()
$error_msg .= $this->get_unlock_request_form();
}
wp_die($error_msg, __('Service Temporarily Unavailable', 'all-in-one-wp-security-and-firewall'), 503);
}
} else {
return $user;
}
}
/**
* Check login captcha (if enabled).
Expand Down Expand Up @@ -560,4 +564,4 @@ function get_unlock_request_form()
$unlock_request_form .= '<button type="submit" name="aiowps_unlock_request" id="aiowps_unlock_request" class="button">'.__('Request Unlock', 'all-in-one-wp-security-and-firewall').'</button></div></form>';
return $unlock_request_form;
}
}
}

0 comments on commit 58180f4

Please sign in to comment.