mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-22 05:15:29 +09:00
If cache-friendly behavior is enabled, don't update session when reading document or comment
This commit is contained in:
parent
1c5424358d
commit
caf01354df
3 changed files with 12 additions and 2 deletions
|
|
@ -131,7 +131,10 @@ class commentItem extends Object
|
||||||
|
|
||||||
function setAccessible()
|
function setAccessible()
|
||||||
{
|
{
|
||||||
$_SESSION['accessibled_comment'][$this->comment_srl] = TRUE;
|
if(Context::getInstance()->isSessionStarted)
|
||||||
|
{
|
||||||
|
$_SESSION['accessibled_comment'][$this->comment_srl] = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isEditable()
|
function isEditable()
|
||||||
|
|
|
||||||
|
|
@ -843,6 +843,9 @@ class documentController extends document
|
||||||
$trigger_output = ModuleHandler::triggerCall('document.updateReadedCount', 'before', $oDocument);
|
$trigger_output = ModuleHandler::triggerCall('document.updateReadedCount', 'before', $oDocument);
|
||||||
if(!$trigger_output->toBool()) return $trigger_output;
|
if(!$trigger_output->toBool()) return $trigger_output;
|
||||||
|
|
||||||
|
// Pass if cache-friendly mode is enabled and session is not started
|
||||||
|
if(Context::getInstance()->isSessionStarted == FALSE) return false;
|
||||||
|
|
||||||
// Pass if read count is increaded on the session information
|
// Pass if read count is increaded on the session information
|
||||||
if($_SESSION['readed_document'][$document_srl]) return false;
|
if($_SESSION['readed_document'][$document_srl]) return false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -732,6 +732,7 @@ class documentItem extends Object
|
||||||
// If admin priviledge is granted on parent posts, you can read its child posts.
|
// If admin priviledge is granted on parent posts, you can read its child posts.
|
||||||
$accessible = array();
|
$accessible = array();
|
||||||
$comment_list = array();
|
$comment_list = array();
|
||||||
|
$setAccessibleComments = Context::getInstance()->isSessionStarted;
|
||||||
foreach($output->data as $key => $val)
|
foreach($output->data as $key => $val)
|
||||||
{
|
{
|
||||||
$oCommentItem = new commentItem();
|
$oCommentItem = new commentItem();
|
||||||
|
|
@ -741,7 +742,10 @@ class documentItem extends Object
|
||||||
// If the comment is set to private and it belongs child post, it is allowable to read the comment for who has a admin privilege on its parent post
|
// If the comment is set to private and it belongs child post, it is allowable to read the comment for who has a admin privilege on its parent post
|
||||||
if($val->parent_srl>0 && $val->is_secret == 'Y' && !$oCommentItem->isAccessible() && $accessible[$val->parent_srl]===true)
|
if($val->parent_srl>0 && $val->is_secret == 'Y' && !$oCommentItem->isAccessible() && $accessible[$val->parent_srl]===true)
|
||||||
{
|
{
|
||||||
$oCommentItem->setAccessible();
|
if($setAccessibleComments)
|
||||||
|
{
|
||||||
|
$oCommentItem->setAccessible();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$comment_list[$val->comment_srl] = $oCommentItem;
|
$comment_list[$val->comment_srl] = $oCommentItem;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue