Ticket #6943: trunk_fix_page_permissions_jun2.diff
File trunk_fix_page_permissions_jun2.diff, 2.8 KB (added by , 16 years ago) |
---|
-
wp-admin/includes/post.php
63 63 // Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts. 64 64 if ( 'page' == $_POST['post_type'] ) { 65 65 if ( 'publish' == $_POST['post_status'] && !current_user_can( 'publish_pages' ) ) 66 $_POST['post_status'] = 'pending'; 66 if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_pages') ) 67 $_POST['post_status'] = 'pending'; 67 68 } else { 68 69 if ( 'publish' == $_POST['post_status'] && !current_user_can( 'publish_posts' ) ) : 69 70 // Stop attempts to publish new posts, but allow already published posts to be saved if appropriate. -
wp-admin/edit-page-form.php
78 78 </div> 79 79 80 80 <div class="inside"> 81 82 81 <p><strong><label for='post_status'><?php _e('Publish Status') ?></label></strong></p> 83 82 <p> 84 83 <select name='post_status' tabindex='4' id='post_status'> 85 <?php if ( current_user_can('publish_pages') ) : ?> 84 <?php // Show publish in dropdown if user can publish or if they can re-publish this page ('edit_published_pages') 85 // 'publish' option will be selected for published AND private posts (checkbox overrides dropdown) 86 if ( current_user_can('publish_pages') OR ( $post->post_status == 'publish' AND current_user_can('edit_page', $post->ID) ) ) : 87 ?> 86 88 <option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option> 87 <?php else: ?>88 <option<?php selected( $post->post_status, 'private' ); ?> value='private'><?php _e('Published') ?></option>89 89 <?php endif; ?> 90 90 <?php if ( 'future' == $post->post_status ) : ?> 91 91 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Pending') ?></option> … … 94 94 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Unpublished') ?></option> 95 95 </select> 96 96 </p> 97 <?php if ( current_user_can( 'publish_posts' ) ) : ?> 98 <p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex='4' /> <?php _e('Keep this page private') ?></label></p> 99 <?php endif; ?> 97 100 98 <p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex='4' /> <?php _e('Keep this page private') ?></label></p>99 101 <?php 100 102 if ($post_ID) { 101 103 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date