Welcome Guest, Not a member yet? Register   Sign In
Ion Auth login attempts exceeded
#1

I'm using Ben Edmund's Ion Auth for user authentication.

In it's config file, my settings are:
PHP Code:
$config['track_login_attempts'] = TRUE  
$config
['track_login_ip_address'] = TRUE;
$config['maximum_login_attempts'] = 5;
$config['lockout_time'] = 600

In my login method, I have this piece of code:
PHP Code:
$ip $this->input->ip_address();
if (
$this->ion_auth->is_max_login_attempts_exceeded($ip)) {
 
 $this->render_page('auth/login_attempts_exceeded');    


Unfortunately, it doesn't work. I can try to login numerous times with different usernames and password, but it will never show the page with information about a lock-out.
I want to lock out the user if there are too many unsuccessful login attempts from his ip address.
How can I accomplish that?
Reply
#2

(05-20-2017, 10:16 AM)Wouter60 Wrote: I'm using Ben Edmund's Ion Auth for user authentication.

In it's config file, my settings are:
PHP Code:
$config['track_login_attempts'] = TRUE  
$config
['track_login_ip_address'] = TRUE;
$config['maximum_login_attempts'] = 5;
$config['lockout_time'] = 600

In my login method, I have this piece of code:
PHP Code:
$ip $this->input->ip_address();
if (
$this->ion_auth->is_max_login_attempts_exceeded($ip)) {
 
 $this->render_page('auth/login_attempts_exceeded');    


Unfortunately, it doesn't work. I can try to login numerous times with different usernames and password, but it will never show the page with information about a lock-out.
I want to lock out the user if there are too many unsuccessful login attempts from his ip address.
How can I accomplish that?

This is the way to check if a user has exceeded the maximum login attempts

$identity = $this->input->post('identity');
if ($this->ion_auth->is_max_login_attempts_exceeded($identity))
{
$this->session->set_flashdata('message', 'You have too many login attempts');
redirect('auth/login');
}


You will want to edit the Auth.php controller and add this into the public function login().  This way if the usere can not login because of lockout then it will show a error message.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB