Make WordPress Core

Changeset 2718


Ignore:
Timestamp:
07/17/2005 06:59:14 PM (21 years ago)
Author:
ryan
Message:

Cap migration.

File:
1 edited

Legend:

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

    r2714 r2718  
    55        global $user_ID;
    66
    7         if ( !user_can_create_draft($user_ID) )
     7        if ( ! current_user_can('edit_posts') )
    88                die( __('You are not allowed to create posts or drafts on this blog.') );
    99
     
    2222        }
    2323
    24         if ( !user_can_edit_user($user_ID, $_POST['post_author']) )
     24        if ( ($_POST['post_author'] != $_POST['user_ID']) && ! current_user_can('edit_others_posts') )
    2525                die( __('You cannot post as this user.') );
    2626       
    27         if ( 'publish' == $_POST['post_status'] && (!user_can_create_post($user_ID)) )
     27        if ( 'publish' == $_POST['post_status'] && ! current_user_can('publish_posts') )
    2828                $_POST['post_status'] = 'draft';
    2929       
     
    3535        if ('' != $_POST['savepage']) $_POST['post_status'] = 'static';
    3636               
    37         if (user_can_set_post_date($user_ID) && (!empty($_POST['edit_date']))) {
     37        if ( !empty($_POST['edit_date']) ) {
    3838                $aa = $_POST['aa'];
    3939                $mm = $_POST['mm'];
     
    6666        $post_ID = (int) $_POST['post_ID'];
    6767
    68         if (!user_can_edit_post($user_ID, $post_ID, $blog_ID))
     68        if ( ! current_user_can('edit_post', $post_ID) )
    6969                die( __('You are not allowed to edit this post.') );
    7070
     
    8484        }
    8585
    86         if ( !user_can_edit_user($user_ID, $_POST['post_author']) )
     86        if ( ($_POST['post_author'] != $_POST['user_ID']) && ! current_user_can('edit_others_posts') )
    8787                die( __('You cannot post as this user.') );
    8888
    89         if (user_can_set_post_date($user_ID) && (!empty($_POST['edit_date']))) {
     89        if ( !empty($_POST['edit_date']) ) {
    9090                $aa = $_POST['aa'];
    9191                $mm = $_POST['mm'];
     
    126126        $comment_post_ID = (int) $_POST['comment_post_ID'];
    127127
    128         if (!user_can_edit_post_comments($user_ID, $comment_post_ID))
     128        if ( ! current_user_can('edit_post', $comment_post_ID) )
    129129                die( __('You are not allowed to edit comments on this post, so you cannot edit this comment.') );
    130130
     
    136136        $_POST['comment_ID'] = (int) $_POST['comment_ID'];
    137137 
    138         if (user_can_edit_post_date($user_ID, $post_ID) && (!empty($_POST['edit_date']))) {
     138        if ( !empty($_POST['edit_date']) ) {
    139139                $aa = $_POST['aa'];
    140140                $mm = $_POST['mm'];
Note: See TracChangeset for help on using the changeset viewer.