Improve and simplify session status detection

This commit is contained in:
Kijin Sung 2015-07-12 22:00:32 +09:00
parent 3f40434bbd
commit 42d864641f
6 changed files with 28 additions and 24 deletions

View file

@ -847,7 +847,7 @@ class documentController extends document
if($_SESSION['readed_document'][$document_srl]) return false;
// Pass if the author's IP address is as same as visitor's.
if($oDocument->get('ipaddress') == $_SERVER['REMOTE_ADDR'] && Context::getInstance()->isSessionStarted)
if($oDocument->get('ipaddress') == $_SERVER['REMOTE_ADDR'] && Context::getSessionStatus())
{
$_SESSION['readed_document'][$document_srl] = true;
return false;
@ -886,7 +886,7 @@ class documentController extends document
}
// Register session
if(!$_SESSION['banned_document'][$document_srl] && Context::getInstance()->isSessionStarted)
if(!$_SESSION['banned_document'][$document_srl] && Context::getSessionStatus())
{
$_SESSION['readed_document'][$document_srl] = true;
}