mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
Restrict addGrant() to current request only
This commit is contained in:
parent
e4fe2430d3
commit
9143493f13
6 changed files with 22 additions and 14 deletions
|
|
@ -255,7 +255,11 @@ class commentController extends comment
|
|||
*/
|
||||
function addGrant($comment_srl)
|
||||
{
|
||||
$_SESSION['own_comment'][$comment_srl] = TRUE;
|
||||
$comment = getModel('comment')->getComment($comment_srl);
|
||||
if ($comment->isExists())
|
||||
{
|
||||
$comment->setGrant();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -568,18 +572,18 @@ class commentController extends comment
|
|||
}
|
||||
}
|
||||
|
||||
// grant autority of the comment
|
||||
if(!$manual_inserted)
|
||||
{
|
||||
$this->addGrant($obj->comment_srl);
|
||||
}
|
||||
|
||||
// call a trigger(after)
|
||||
ModuleHandler::triggerCall('comment.insertComment', 'after', $obj);
|
||||
|
||||
// commit
|
||||
$oDB->commit();
|
||||
|
||||
// grant autority of the comment
|
||||
if(!$manual_inserted)
|
||||
{
|
||||
$this->addGrant($obj->comment_srl);
|
||||
}
|
||||
|
||||
if(!$manual_inserted)
|
||||
{
|
||||
// send a message if notify_message option in enabled in the original article
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class commentItem extends Object
|
|||
|
||||
function isGranted()
|
||||
{
|
||||
if($_SESSION['own_comment'][$this->comment_srl])
|
||||
if($_SESSION['granted_comment'][$this->comment_srl])
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -130,7 +130,7 @@ class commentItem extends Object
|
|||
|
||||
function setGrantForSession()
|
||||
{
|
||||
$_SESSION['own_comment'][$this->comment_srl] = true;
|
||||
$_SESSION['granted_comment'][$this->comment_srl] = true;
|
||||
$this->setGrant();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class commentModel extends comment
|
|||
*/
|
||||
function isGranted($comment_srl)
|
||||
{
|
||||
return $_SESSION['own_comment'][$comment_srl];
|
||||
return $_SESSION['granted_comment'][$comment_srl];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -331,7 +331,11 @@ class documentController extends document
|
|||
*/
|
||||
function addGrant($document_srl)
|
||||
{
|
||||
$_SESSION['own_document'][$document_srl] = true;
|
||||
$oDocument = getModel('document')->getDocument($document_srl);
|
||||
if ($oDocument->isExists())
|
||||
{
|
||||
$oDocument->setGrant();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ class documentItem extends Object
|
|||
|
||||
function isGranted()
|
||||
{
|
||||
if ($_SESSION['own_document'][$this->document_srl])
|
||||
if ($_SESSION['granted_document'][$this->document_srl])
|
||||
{
|
||||
return $this->grant_cache = true;
|
||||
}
|
||||
|
|
@ -203,7 +203,7 @@ class documentItem extends Object
|
|||
|
||||
function setGrantForSession()
|
||||
{
|
||||
$_SESSION['own_document'][$this->document_srl] = true;
|
||||
$_SESSION['granted_document'][$this->document_srl] = true;
|
||||
$this->setGrant();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class documentModel extends document
|
|||
*/
|
||||
function isGranted($document_srl)
|
||||
{
|
||||
return $_SESSION['own_document'][$document_srl];
|
||||
return $_SESSION['granted_document'][$document_srl];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue