[eluser]xtremer360[/eluser]
For some reason the test to see if if the current_time variable is bigger or smaller than the time to login is not right for some reason. I'm not sure what I'm missing. The lock_date property of the $user_data object stands for the exact datetime that the user made its last failed login attempt. So its always continuing on with the code and by passing with the rest of the submit function.
I thought about switching the great than sign in the if statement when comparing the two times but with those two I didn't think it would make sense.
Code:
$current_time = now();
$current_gmt_human_format = unix_to_human($current_time, TRUE, 'us');
/* Get user data from post username value */
$user_data = $this->users_model->get_by('username', $post_username);
if (count($user_data) > 0)
{
/* User was found in database */
if ($user_data->lock_date !== '0000-00-00 00:00:00')
{
/* User is locked out */
/* How long the user must wait to login */
$wait_time = 60 * 15;
/* Time user is able to login */
$time_to_login = human_to_unix($user_data->lock_date) + $wait_time;
//echo 'current time is...' . $current_time;
//echo '<br>';
//echo 'time to login is...' . $time_to_login;
//die();
if ($current_time < $time_to_login)
{
}
}
}
As per the request here is the data I have.
Code:
current readable format is...2013-05-23 08:03:44 PM
current time is...1369353824
user lock out...1369310405
wait time is...900
time to login is...1369311305