mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-29 07:12:15 +09:00
Refresh isAccessible() if document or comment is updated
https://www.xetown.com/qna/510717
This commit is contained in:
parent
3d16272d01
commit
6df32746c3
2 changed files with 57 additions and 25 deletions
|
|
@ -133,7 +133,7 @@ class commentItem extends Object
|
|||
{
|
||||
if(Context::getSessionStatus())
|
||||
{
|
||||
$_SESSION['accessibled_comment'][$this->comment_srl] = TRUE;
|
||||
$_SESSION['accessible'][$this->comment_srl] = $this->get('last_update');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -163,12 +163,12 @@ class commentItem extends Object
|
|||
|
||||
function isAccessible()
|
||||
{
|
||||
if($_SESSION['accessibled_comment'][$this->comment_srl])
|
||||
if (isset($_SESSION['accessible'][$this->comment_srl]) && $_SESSION['accessible'][$this->comment_srl] === $this->get('last_update'))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if($this->isGranted() || !$this->isSecret())
|
||||
if (!$this->isSecret() || $this->isGranted())
|
||||
{
|
||||
$this->setAccessible();
|
||||
return TRUE;
|
||||
|
|
@ -176,7 +176,7 @@ class commentItem extends Object
|
|||
|
||||
$oDocumentModel = getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($this->get('document_srl'));
|
||||
if($oDocument->isGranted())
|
||||
if ($oDocument->isExists() && $oDocument->isGranted())
|
||||
{
|
||||
$this->setAccessible();
|
||||
return TRUE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue