Changeset 5074
- Timestamp:
- 03/21/07 22:15:20 (1 year ago)
- Files:
-
- trunk/xmlrpc.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/xmlrpc.php
r5054 r5074 847 847 extract($actual_post); 848 848 849 if ( ('publish' == $post_status) && !current_user_can('publish_posts') ) 850 return new IXR_Error(401, 'Sorry, you do not have the right to publish this post.'); 851 849 852 $post_title = xmlrpc_getposttitle($content); 850 853 $post_category = xmlrpc_getpostcategory($content); … … 1073 1076 1074 1077 set_current_user(0, $user_login); 1075 if ( !current_user_can('edit_post', $post_ID) )1076 return new IXR_Error(401, 'Sorry, you can not edit this post.');1077 1078 $postdata = wp_get_single_post($post_ID, ARRAY_A);1079 extract($postdata);1080 $this->escape($postdata);1081 1078 1082 1079 // The post_type defaults to post, but could also be page. … … 1088 1085 $post_type = "page"; 1089 1086 } 1087 1088 // Edit page caps are checked in editPage. Just check post here. 1089 if ( ( 'post' == $post_type ) && !current_user_can('edit_post', $post_ID) ) 1090 return new IXR_Error(401, 'Sorry, you can not edit this post.'); 1091 1092 $postdata = wp_get_single_post($post_ID, ARRAY_A); 1093 extract($postdata); 1094 $this->escape($postdata); 1090 1095 1091 1096 // Let WordPress manage slug if none was provided. … … 1159 1164 $post_more = $content_struct['mt_text_more']; 1160 1165 $post_status = $publish ? 'publish' : 'draft'; 1166 1167 if ( ('publish' == $post_status) ) { 1168 if ( ( 'page' == $post_type ) && !current_user_can('publish_pages') ) 1169 return new IXR_Error(401, 'Sorry, you do not have the right to publish this page.'); 1170 else if ( !current_user_can('publish_posts') ) 1171 return new IXR_Error(401, 'Sorry, you do not have the right to publish this post.'); 1172 } 1161 1173 1162 1174 if ($post_more) {
