Make WordPress Core


Ignore:
Timestamp:
03/14/2005 12:48:11 AM (21 years ago)
Author:
ryan
Message:

Don't let users who cannot publish edit published posts, even their own. Make consistent use of user_can_create_post(). http://mosquito.wordpress.org/view.php?id=1004 Props: MC_incubus

File:
1 edited

Legend:

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

    r2426 r2441  
    6262        $post_status = 'draft';
    6363    // Double-check
    64     if ( 'publish' == $post_status && (!user_can_create_post($user_ID)) && 2 != get_option('new_users_can_blog') )
     64    if ( 'publish' == $post_status && (!user_can_create_post($user_ID)) )
    6565        $post_status = 'draft';
    6666    $comment_status = $_POST['comment_status'];
     
    230230        die ( __('You are not allowed to view other users\' private posts.') );
    231231
     232    if ( 'publish' == $post_status && (!user_can_create_post($user_ID)) ) {
     233         _e('You are not allowed to edit published posts.');
     234         break;
     235    }
     236
    232237    if ($post_status == 'static') {
    233238        $page_template = get_post_meta($post_ID, '_wp_page_template', true);
     
    306311    if (isset($_POST['publish'])) $post_status = 'publish';
    307312    // Double-check
    308     if ( 'publish' == $post_status && (!user_can_create_post($user_ID)) && 2 != get_option('new_users_can_blog') )
     313    if ( 'publish' == $post_status && (!user_can_create_post($user_ID)) )
    309314        $post_status = 'draft';
    310315
Note: See TracChangeset for help on using the changeset viewer.