Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.
Help keep Vanilla free:if ( $Comment->Context->Session->UserID < 1 && !$Comment->Context->Session->User->Permission('PERMISSION_EDIT_COMMENTS') )if ( $Comment->Context->Session->UserID > 0 || !$Comment->Context->Session->User->Permission('PERMISSION_EDIT_COMMENTS') )
if (in_array($Context->SelfUrl, array("post.php"))) {
// DELEGATION FUNCTION TO VALIDATE EDIT
function DiscussionForm_DiceRoller_EditValidation( &$DiscussionForm ) {
$pba = $DiscussionForm->PostBackAction;
// PREVENT ACCESS TO THE EDIT FORM AND SAVE OPERATIONS FOR COMMENTS
// WHICH MEET A CERTAIN CONDITION
if ( $DiscussionForm->Comment->CommentID != 0
&& ($pba=='' || $pba=='SaveDiscussion' || $pba=='SaveComment') ) {
// CHECK THE CONDITION
if ( !$DiscussionForm->Context->Session->User->Permission('PERMISSION_EDIT_DISCUSSIONS') ) {
// BREAK THE EDIT ATTEMPT
$DiscussionForm->Context->WarningCollector->Add(
$DiscussionForm->Context->GetDefinition("NoEditWarning") );
$DiscussionForm->FatalError = 1;
return;
}
}
}
// Add function todelegate
$Context->AddToDelegate('DiscussionForm', 'PostLoadData', 'DiscussionForm_DiceRoller_EditValidation' );
}
1 to 15 of 15