Changeset 2718
- Timestamp:
- 07/17/2005 06:59:14 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/admin-functions.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-functions.php
r2714 r2718 5 5 global $user_ID; 6 6 7 if ( ! user_can_create_draft($user_ID) )7 if ( ! current_user_can('edit_posts') ) 8 8 die( __('You are not allowed to create posts or drafts on this blog.') ); 9 9 … … 22 22 } 23 23 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') ) 25 25 die( __('You cannot post as this user.') ); 26 26 27 if ( 'publish' == $_POST['post_status'] && (!user_can_create_post($user_ID)) )27 if ( 'publish' == $_POST['post_status'] && ! current_user_can('publish_posts') ) 28 28 $_POST['post_status'] = 'draft'; 29 29 … … 35 35 if ('' != $_POST['savepage']) $_POST['post_status'] = 'static'; 36 36 37 if ( user_can_set_post_date($user_ID) && (!empty($_POST['edit_date']))) {37 if ( !empty($_POST['edit_date']) ) { 38 38 $aa = $_POST['aa']; 39 39 $mm = $_POST['mm']; … … 66 66 $post_ID = (int) $_POST['post_ID']; 67 67 68 if ( !user_can_edit_post($user_ID, $post_ID, $blog_ID))68 if ( ! current_user_can('edit_post', $post_ID) ) 69 69 die( __('You are not allowed to edit this post.') ); 70 70 … … 84 84 } 85 85 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') ) 87 87 die( __('You cannot post as this user.') ); 88 88 89 if ( user_can_set_post_date($user_ID) && (!empty($_POST['edit_date']))) {89 if ( !empty($_POST['edit_date']) ) { 90 90 $aa = $_POST['aa']; 91 91 $mm = $_POST['mm']; … … 126 126 $comment_post_ID = (int) $_POST['comment_post_ID']; 127 127 128 if ( !user_can_edit_post_comments($user_ID, $comment_post_ID))128 if ( ! current_user_can('edit_post', $comment_post_ID) ) 129 129 die( __('You are not allowed to edit comments on this post, so you cannot edit this comment.') ); 130 130 … … 136 136 $_POST['comment_ID'] = (int) $_POST['comment_ID']; 137 137 138 if ( user_can_edit_post_date($user_ID, $post_ID) && (!empty($_POST['edit_date']))) {138 if ( !empty($_POST['edit_date']) ) { 139 139 $aa = $_POST['aa']; 140 140 $mm = $_POST['mm'];
Note: See TracChangeset
for help on using the changeset viewer.