Issue 1816, Check if there is too much long before time login access, and if it is, re-count the access from one.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10814 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
misol 2012-07-01 11:43:54 +00:00
parent ecc549da07
commit b653494b15
2 changed files with 26 additions and 3 deletions

View file

@ -350,8 +350,31 @@
$output = executeQuery('member.getLoginCountByIp', $args);
if($output->data && $output->data->count)
{
//update
$args->count = $output->data->count + 1;
// Create a member model object
$oMemberModel = &getModel('member');
$config = $oMemberModel->getMemberConfig();
$last_update = $output->data->last_update;
$year = substr($last_update,0,4);
$month = substr($last_update,4,2);
$day = substr($last_update,6,2);
$hour = substr($last_update,8,2);
$min = substr($last_update,10,2);
$sec = substr($last_update,12,2);
$last_update = mktime($hour,$min,$sec,$month,$day,$year);
$term = intval(time()-$last_update);
//update, if IP address access in a short time, update count. If not, make count 1.
if($term < $config->max_error_count_time)
{
$args->count = $output->data->count + 1;
}
else
{
$args->count = 1;
}
unset($oMemberModel);
unset($config);
$output = executeQuery('member.updateLoginCountByIp', $args);
}
else