Fix for comment deletion priileges.

Bug reported by Michael Renzmann


git-svn-id: http://svn.automattic.com/wordpress/trunk@527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
mikelittle 2003-11-06 00:34:41 +00:00
parent e1940bab18
commit 567a609308
1 changed files with 7 additions and 0 deletions

View File

@ -350,10 +350,17 @@ switch($action) {
if ($user_level == 0)
die ('Cheatin’ uh?');
$comment = $HTTP_GET_VARS['comment'];
$p = $HTTP_GET_VARS['p'];
$postdata = get_postdata($p) or die('Oops, no post with this ID. <a href="wp-post.php">Go back</a>!');
$commentdata = get_commentdata($comment) or die('Oops, no comment with this ID. <a href="wp-post.php">Go back</a>!');
$authordata = get_userdata($postdata['Author_ID']);
if ($user_level < $authordata->user_level)
die ('You don&#8217;t have the right to delete <strong>'.$authordata->user_nickname.'</strong>&#8217;s post comments. <a href="wp-post.php">Go back</a>!');
$result = $wpdb->query("DELETE FROM $tablecomments WHERE comment_ID=$comment");
if($HTTP_SERVER_VARS['HTTP_REFERER'] != "") {