Restrict addGrant() to current request only

This commit is contained in:
Kijin Sung 2017-03-02 23:24:28 +09:00
parent e4fe2430d3
commit 9143493f13
6 changed files with 22 additions and 14 deletions

View file

@ -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