diff --git a/admin/deleteAny.php b/admin/deleteAny.php index b7e4c87..530b66b 100644 --- a/admin/deleteAny.php +++ b/admin/deleteAny.php @@ -26,19 +26,6 @@ if($_REQUEST['what']) { switch($_REQUEST['what']) { - case "comment": - $oComment = new Comment($_REQUEST['commentId']); - if( !$_SESSION['current']->isMaintainer($oComment->iVersionId) - && !$_SESSION['current']->isSuperMaintainer($oComment->iAppId) - && !$_SESSION['current']->hasPriv("admin") ) - { - errorpage(); - } else - { - $oComment->delete(); - redirect(BASE."appview.php?versionId=".$oComment->iVersionId); - } - break; case "category": // delete category and the apps in it $oCategory = new Category($_REQUEST['catId']); diff --git a/deletecomment.php b/deletecomment.php new file mode 100644 index 0000000..65e2a8a --- /dev/null +++ b/deletecomment.php @@ -0,0 +1,53 @@ +hasPriv("admin") + && !$_SESSION['current']->isMaintainer($oComment->iVersionId) + && !$_SESSION['current']->isSuperMaintainer($oComment->iAppId)) +{ + errorpage('You don\'t have sufficient privileges to delete this comment.'); + exit; +} + +if($_SESSION['current']->getPref("confirm_comment_deletion") != "no" && !isset($_REQUEST['int_delete_it'])) +{ + apidb_header("Delete Comment"); + $mesTitle = "Please state why you are deleting the following comment"; + echo "
\n"; + echo html_frame_start($mesTitle,500,"",0); + echo "
"; + echo html_frame_start($oComment->sSubject,500); + echo htmlify_urls($oComment->sBody), "

\n"; + echo html_frame_end(); + echo '',"\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo " \n"; + echo "
\n"; + echo html_frame_end(); + echo "\n"; + echo "iCommentId."\" />"; + echo "
"; + + apidb_footer(); +} else +{ + $oComment->delete($_REQUEST['str_why']); + redirect(apidb_fullurl("appview.php?versionId=".$oComment->iVersionId)); +} +?> diff --git a/include/comment.php b/include/comment.php index 637d880..4887c93 100644 --- a/include/comment.php +++ b/include/comment.php @@ -230,10 +230,8 @@ function view_app_comment($ob) || $_SESSION['current']->isSuperMaintainer($ob->appId)) { echo ""; - echo "
\n"; + echo "\n"; echo "commentId\" />"; - echo ""; - echo ""; echo "
\n"; echo ""; }