Exemplo n.º 1
0
 /**
  * POST: /main/delete-comment
  */
 public function deleteCommentPost()
 {
     $commentId = $_REQUEST['CommentId'];
     $commentOnPageDAO = new CommentOnPageDAO();
     $comment = $commentOnPageDAO->getCommentOnPage($commentId);
     if (Authentication::isAuthenticated() && (Authentication::getUserEntity()->id == $comment->userId || Authentication::hasRoles(array('manager', 'admin')))) {
         $commentOnPageDAO->delete($commentId);
         echo 'success';
     }
 }