Make WordPress Core


Ignore:
Timestamp:
11/06/2003 12:34:41 AM (23 years ago)
Author:
mikelittle
Message:

Fix for comment deletion priileges.
Bug reported by Michael Renzmann

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/wp-post.php

    r524 r527  
    351351            die ('Cheatin’ uh?');
    352352
     353
    353354        $comment = $HTTP_GET_VARS['comment'];
    354355        $p = $HTTP_GET_VARS['p'];
     356
     357        $postdata = get_postdata($p) or die('Oops, no post with this ID. <a href="wp-post.php">Go back</a>!');
    355358        $commentdata = get_commentdata($comment) or die('Oops, no comment with this ID. <a href="wp-post.php">Go back</a>!');
     359
     360        $authordata = get_userdata($postdata['Author_ID']);
     361        if ($user_level < $authordata->user_level)
     362            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>!');
    356363
    357364        $result = $wpdb->query("DELETE FROM $tablecomments WHERE comment_ID=$comment");
Note: See TracChangeset for help on using the changeset viewer.