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

@ -2259,7 +2259,7 @@ Bạn có thể quản lý thành viên bằng cách tạo những nhóm mới,
<value xml:lang="en"><![CDATA[Set the number of trial limit. Limit the number of trial to sign in from a IP address.]]></value>
</item>
<item name="about_login_trial_limit2">
<value xml:lang="ko"><![CDATA[지정된 횟수의 로그인을 허용하는 시간을 정하십시오. 짧은 시간 동안 하나의 아이피(IP)에서 시도할 수 있는 로그인 횟수에 제한을 둡니다.]]></value>
<value xml:lang="ko"><![CDATA[지정된 횟수의 로그인을 허용하는 시간을 정하십시오. 짧은 시간 동안 하나의 아이피(IP)에서 시도할 수 있는 로그인 횟수에 제한을 둡니다. 시간은 가장 마지막 로그인 시도의 시각으로부터의 시간을 기준으로 측정합니다.]]></value>
<value xml:lang="en"><![CDATA[Set the time limit to try the written times of sign in. Limit the number of trial to sign in during the span of time, from a IP address.]]></value>
</item>
<item name="msg_kr_address">

View file

@ -350,8 +350,31 @@
$output = executeQuery('member.getLoginCountByIp', $args);
if($output->data && $output->data->count)
{
//update
// 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