* check timestamp for check entry token.
This commit is contained in:
@@ -1750,11 +1750,15 @@ EOD;
|
||||
/* Change for task #5384. */
|
||||
if(isset($queryString['time']))
|
||||
{
|
||||
$timestamp = $queryString['time'];
|
||||
if(strlen($timestamp) > 10) $timestamp = substr($timestamp, 0, 10);
|
||||
if(strlen($timestamp) != 10 or $timestamp{0} >= '4') $this->response('ERROR_TIMESTAMP');
|
||||
|
||||
$result = $this->get->token == md5($entry->code . $entry->key . $queryString['time']);
|
||||
if($result)
|
||||
{
|
||||
if($queryString['time'] <= $entry->calledTime) $this->response('CALLED_TIME');
|
||||
$this->loadModel('entry')->updateTime($entry->code, $queryString['time']);
|
||||
if($timestamp <= $entry->calledTime) $this->response('CALLED_TIME');
|
||||
$this->loadModel('entry')->updateTime($entry->code, $timestamp);
|
||||
unset($_GET['time']);
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -16,3 +16,4 @@ $config->entry->errcode['ACCOUNT_UNBOUND'] = 403;
|
||||
$config->entry->errcode['EMPTY_ENTRY'] = 404;
|
||||
$config->entry->errcode['CALLED_TIME'] = 405;
|
||||
$config->entry->errcode['INVALID_ACCOUNT'] = 406;
|
||||
$config->entry->errcode['ERROR_TIMESTAMP'] = 407;
|
||||
|
||||
@@ -54,3 +54,5 @@ $lang->entry->errmsg['IP_DENIED'] = 'IP ist unzulässig.';
|
||||
$lang->entry->errmsg['ACCOUNT_UNBOUND'] = 'Account is not bound.';
|
||||
$lang->entry->errmsg['INVALID_ACCOUNT'] = 'Account is not exists';
|
||||
$lang->entry->errmsg['EMPTY_ENTRY'] = 'Key des Eintrags fehlt.';
|
||||
$lang->entry->errmsg['CALLED_TIME'] = 'Token has expired';
|
||||
$lang->entry->errmsg['ERROR_TIMESTAMP'] = 'Timestamp Error';
|
||||
|
||||
@@ -55,3 +55,4 @@ $lang->entry->errmsg['ACCOUNT_UNBOUND'] = 'Account is not bound.';
|
||||
$lang->entry->errmsg['INVALID_ACCOUNT'] = 'Invalid account.';
|
||||
$lang->entry->errmsg['EMPTY_ENTRY'] = 'Application does not exist.';
|
||||
$lang->entry->errmsg['CALLED_TIME'] = 'Token has expired';
|
||||
$lang->entry->errmsg['ERROR_TIMESTAMP'] = 'Timestamp Error';
|
||||
|
||||
@@ -55,3 +55,4 @@ $lang->entry->errmsg['ACCOUNT_UNBOUND'] = '未绑定用户';
|
||||
$lang->entry->errmsg['INVALID_ACCOUNT'] = '用户不存在';
|
||||
$lang->entry->errmsg['EMPTY_ENTRY'] = '应用不存在';
|
||||
$lang->entry->errmsg['CALLED_TIME'] = 'Token已失效';
|
||||
$lang->entry->errmsg['ERROR_TIMESTAMP'] = '错误的时间戳。';
|
||||
|
||||
@@ -55,3 +55,4 @@ $lang->entry->errmsg['ACCOUNT_UNBOUND'] = '未綁定用戶';
|
||||
$lang->entry->errmsg['INVALID_ACCOUNT'] = '用戶不存在';
|
||||
$lang->entry->errmsg['EMPTY_ENTRY'] = '應用不存在';
|
||||
$lang->entry->errmsg['CALLED_TIME'] = 'Token已失效';
|
||||
$lang->entry->errmsg['ERROR_TIMESTAMP'] = '錯誤的時間戳。';
|
||||
|
||||
Reference in New Issue
Block a user