Changeset 2709
- Timestamp:
- 07/13/2005 10:26:26 PM (21 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 4 edited
-
admin-functions.php (modified) (1 diff)
-
edit-form-advanced.php (modified) (1 diff)
-
edit.php (modified) (2 diffs)
-
post.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-functions.php
r2705 r2709 498 498 <td><?php echo mysql2date('Y-m-d g:i a', $post->post_modified); ?></td> 499 499 <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit"><?php _e('View'); ?></a></td> 500 <td><?php if ( ($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { echo "<a href='post.php?action=edit&post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>501 <td><?php if ( ($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { echo "<a href='post.php?action=delete&post=$id' class='delete' onclick=\"return confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n \'OK\' to delete, \'Cancel\' to stop."), the_title('','',0)) . "')\">" . __('Delete') . "</a>"; } ?></td>500 <td><?php if ( current_user_can('edit_pages') ) { echo "<a href='post.php?action=edit&post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td> 501 <td><?php if ( current_user_can('edit_pages') ) { echo "<a href='post.php?action=delete&post=$id' class='delete' onclick=\"return confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n \'OK\' to delete, \'Cancel\' to stop."), the_title('','',0)) . "')\">" . __('Delete') . "</a>"; } ?></td> 502 502 </tr> 503 503 -
trunk/wp-admin/edit-form-advanced.php
r2702 r2709 156 156 if ('publish' != $post_status || 0 == $post_ID) { 157 157 ?> 158 <?php if ( user_can_create_post($user_ID) ) : ?>158 <?php if ( current_user_can('publish_posts') ) : ?> 159 159 <input name="publish" type="submit" id="publish" tabindex="10" value="<?php _e('Publish') ?>" /> 160 160 <?php endif; ?> -
trunk/wp-admin/edit.php
r2701 r2709 199 199 case 'control_edit': 200 200 ?> 201 <td><?php if ( user_can_edit_post($user_ID,$post->ID) ) { echo "<a href='post.php?action=edit&post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>201 <td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='post.php?action=edit&post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td> 202 202 <?php 203 203 break; … … 205 205 case 'control_delete': 206 206 ?> 207 <td><?php if ( user_can_edit_post($user_ID,$post->ID) ) { echo "<a href='post.php?action=delete&post=$id' class='delete' onclick=\"return confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n \'OK\' to delete, \'Cancel\' to stop."), wp_specialchars(get_the_title('', ''), 1) ) . "')\">" . __('Delete') . "</a>"; } ?></td>207 <td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='post.php?action=delete&post=$id' class='delete' onclick=\"return confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n \'OK\' to delete, \'Cancel\' to stop."), wp_specialchars(get_the_title('', ''), 1) ) . "')\">" . __('Delete') . "</a>"; } ?></td> 208 208 <?php 209 209 break; -
trunk/wp-admin/post.php
r2703 r2709 70 70 die ( __('You are not allowed to edit this post.') ); 71 71 72 if ( !user_can_edit_post($user_ID, $post_ID) )73 die ( __('You are not allowed to view other users\' private posts.') );74 75 72 $post = get_post_to_edit($post_ID); 76 73 … … 121 118 $post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']); 122 119 123 if ( !user_can_delete_post($user_ID, $post_id)) {120 if ( !current_user_can('edit_post', $post_id) ) 124 121 die( __('You are not allowed to delete this post.') ); 125 }126 122 127 123 if (! wp_delete_post($post_id)) … … 146 142 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'javascript:history.go(-1)')); 147 143 148 if ( ! user_can_edit_post_comments($user_ID, $comment->comment_post_ID) )144 if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 149 145 die( __('You are not allowed to edit comments on this post.') ); 150 146 … … 165 161 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 166 162 167 if ( ! user_can_delete_post_comments($user_ID, $comment->comment_post_ID) )163 if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 168 164 die( __('You are not allowed to delete comments on this post.') ); 169 165 … … 208 204 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'post.php')); 209 205 210 if ( !user_can_delete_post_comments($user_ID, $commentdata['comment_post_ID']))206 if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 211 207 die( __('You are not allowed to edit comments on this post.') ); 212 208 … … 239 235 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 240 236 241 if ( ! user_can_edit_post_comments($user_ID, $comment->comment_post_ID) )237 if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 242 238 die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') ); 243 239 … … 259 255 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 260 256 261 if ( ! user_can_edit_post_comments($user_ID, $comment->comment_post_ID) )257 if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 262 258 die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); 263 259 … … 285 281 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php')); 286 282 287 if ( ! user_can_edit_post_comments($user_ID, $commentdata['comment_post_ID']))283 if ( !current_user_can('edit_post', $comment->comment_post_ID) ) 288 284 die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); 289 285 … … 323 319 <?php endif; ?> 324 320 <?php 325 if ( user_can_create_draft($user_ID) ) {321 if ( current_user_can('edit_posts') ) { 326 322 $action = 'post'; 327 323 get_currentuserinfo();
Note: See TracChangeset
for help on using the changeset viewer.