summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-admin/post.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-07-14 07:09:38 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-07-14 07:09:38 +0000
commit25a558f83f0dc55ffe4a849b1c652f227bef3e33 (patch)
tree14a7f1e8aa0688b6c5c2889b43def7debd760d71 /wp-inst/wp-admin/post.php
parente8e403c56f499f37aa39e91b9bdfe9f1b5e218e6 (diff)
Merged changes from WP SVN.
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@22 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-admin/post.php')
-rw-r--r--wp-inst/wp-admin/post.php20
1 files changed, 8 insertions, 12 deletions
diff --git a/wp-inst/wp-admin/post.php b/wp-inst/wp-admin/post.php
index e29156b..e77a4d6 100644
--- a/wp-inst/wp-admin/post.php
+++ b/wp-inst/wp-admin/post.php
@@ -69,9 +69,6 @@ case 'edit':
if ( !current_user_can('edit_post', $post_ID) )
die ( __('You are not allowed to edit this post.') );
- if ( !user_can_edit_post($user_ID, $post_ID) )
- die ( __('You are not allowed to view other users\' private posts.') );
-
$post = get_post_to_edit($post_ID);
if ($post->post_status == 'static')
@@ -120,9 +117,8 @@ case 'delete':
$post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']);
- if (!user_can_delete_post($user_ID, $post_id)) {
+ if ( !current_user_can('edit_post', $post_id) )
die( __('You are not allowed to delete this post.') );
- }
if (! wp_delete_post($post_id))
die( __('Error in deleting...') );
@@ -145,7 +141,7 @@ case 'editcomment':
if ( ! $comment = get_comment($comment) )
die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'javascript:history.go(-1)'));
- if ( !user_can_edit_post_comments($user_ID, $comment->comment_post_ID) )
+ if ( !current_user_can('edit_post', $comment->comment_post_ID) )
die( __('You are not allowed to edit comments on this post.') );
$comment = get_comment_to_edit($comment);
@@ -164,7 +160,7 @@ case 'confirmdeletecomment':
if ( ! $comment = get_comment($comment) )
die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
- if ( !user_can_delete_post_comments($user_ID, $comment->comment_post_ID) )
+ if ( !current_user_can('edit_post', $comment->comment_post_ID) )
die( __('You are not allowed to delete comments on this post.') );
echo "<div class='wrap'>\n";
@@ -207,7 +203,7 @@ case 'deletecomment':
if ( ! $comment = get_comment($comment) )
die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'post.php'));
- if (!user_can_delete_post_comments($user_ID, $commentdata['comment_post_ID']))
+ if ( !current_user_can('edit_post', $comment->comment_post_ID) )
die( __('You are not allowed to edit comments on this post.') );
wp_set_comment_status($comment->comment_ID, "delete");
@@ -238,7 +234,7 @@ case 'unapprovecomment':
if ( ! $comment = get_comment($comment) )
die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
- if ( !user_can_edit_post_comments($user_ID, $comment->comment_post_ID) )
+ if ( !current_user_can('edit_post', $comment->comment_post_ID) )
die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') );
wp_set_comment_status($comment->comment_ID, "hold");
@@ -258,7 +254,7 @@ case 'mailapprovecomment':
if ( ! $comment = get_comment($comment) )
die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
- if ( !user_can_edit_post_comments($user_ID, $comment->comment_post_ID) )
+ if ( !current_user_can('edit_post', $comment->comment_post_ID) )
die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
if ('1' != $comment->comment_approved) {
@@ -284,7 +280,7 @@ case 'approvecomment':
if ( ! $comment = get_comment($comment) )
die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
- if ( !user_can_edit_post_comments($user_ID, $commentdata['comment_post_ID']))
+ if ( !current_user_can('edit_post', $comment->comment_post_ID) )
die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
wp_set_comment_status($comment->comment_ID, "approve");
@@ -322,7 +318,7 @@ default:
<div class="updated"><p><?php printf(__('Post saved. <a href="%s">View site &raquo;</a>'), get_bloginfo('home')); ?></p></div>
<?php endif; ?>
<?php
- if ( user_can_create_draft($user_ID) ) {
+ if ( current_user_can('edit_posts') ) {
$action = 'post';
get_currentuserinfo();
if ( $drafts = get_users_drafts( $user_ID ) ) {