Changeset 6384 for trunk/src/includes/replies/functions.php
- Timestamp:
- 03/20/2017 10:44:00 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/replies/functions.php
r6369 r6384 179 179 180 180 // User cannot create replies 181 if ( ! current_user_can( 'publish_replies' ) ) {181 if ( ! current_user_can( 'publish_replies' ) ) { 182 182 bbp_add_error( 'bbp_reply_permission', __( '<strong>ERROR</strong>: You do not have permission to reply.', 'bbpress' ) ); 183 183 } … … 271 271 272 272 // Forum is closed and user cannot access 273 if ( bbp_is_forum_closed( $forum_id ) && ! current_user_can( 'edit_forum', $forum_id ) ) {273 if ( bbp_is_forum_closed( $forum_id ) && ! current_user_can( 'edit_forum', $forum_id ) ) { 274 274 bbp_add_error( 'bbp_new_reply_forum_closed', __( '<strong>ERROR</strong>: This forum has been closed to new replies.', 'bbpress' ) ); 275 275 } 276 276 277 277 // Forum is private and user cannot access 278 if ( bbp_is_forum_private( $forum_id ) ) { 279 if ( !current_user_can( 'read_private_forums' ) ) { 280 bbp_add_error( 'bbp_new_reply_forum_private', __( '<strong>ERROR</strong>: This forum is private and you do not have the capability to read or create new replies in it.', 'bbpress' ) ); 281 } 278 if ( bbp_is_forum_private( $forum_id ) && ! current_user_can( 'read_forum', $forum_id ) ) { 279 bbp_add_error( 'bbp_new_reply_forum_private', __( '<strong>ERROR</strong>: This forum is private and you do not have the capability to read or create new replies in it.', 'bbpress' ) ); 282 280 283 281 // Forum is hidden and user cannot access 284 } elseif ( bbp_is_forum_hidden( $forum_id ) ) { 285 if ( !current_user_can( 'read_hidden_forums' ) ) { 286 bbp_add_error( 'bbp_new_reply_forum_hidden', __( '<strong>ERROR</strong>: This forum is hidden and you do not have the capability to read or create new replies in it.', 'bbpress' ) ); 287 } 282 } elseif ( bbp_is_forum_hidden( $forum_id ) && ! current_user_can( 'read_forum', $forum_id ) ) { 283 bbp_add_error( 'bbp_new_reply_forum_hidden', __( '<strong>ERROR</strong>: This forum is hidden and you do not have the capability to read or create new replies in it.', 'bbpress' ) ); 288 284 } 289 285 } … … 572 568 573 569 // User cannot edit this reply 574 if ( ! current_user_can( 'edit_reply', $reply_id ) ) {570 if ( ! current_user_can( 'edit_reply', $reply_id ) ) { 575 571 bbp_add_error( 'bbp_edit_reply_permission', __( '<strong>ERROR</strong>: You do not have permission to edit that reply.', 'bbpress' ) ); 576 572 return; … … 614 610 615 611 // Forum is closed and user cannot access 616 if ( bbp_is_forum_closed( $forum_id ) && ! current_user_can( 'edit_forum', $forum_id ) ) {612 if ( bbp_is_forum_closed( $forum_id ) && ! current_user_can( 'edit_forum', $forum_id ) ) { 617 613 bbp_add_error( 'bbp_edit_reply_forum_closed', __( '<strong>ERROR</strong>: This forum has been closed to new replies.', 'bbpress' ) ); 618 614 } 619 615 620 616 // Forum is private and user cannot access 621 if ( bbp_is_forum_private( $forum_id ) ) { 622 if ( !current_user_can( 'read_private_forums' ) ) { 623 bbp_add_error( 'bbp_edit_reply_forum_private', __( '<strong>ERROR</strong>: This forum is private and you do not have the capability to read or create new replies in it.', 'bbpress' ) ); 624 } 617 if ( bbp_is_forum_private( $forum_id ) && ! current_user_can( 'read_forum', $forum_id ) ) { 618 bbp_add_error( 'bbp_edit_reply_forum_private', __( '<strong>ERROR</strong>: This forum is private and you do not have the capability to read or create new replies in it.', 'bbpress' ) ); 625 619 626 620 // Forum is hidden and user cannot access 627 } elseif ( bbp_is_forum_hidden( $forum_id ) ) { 628 if ( !current_user_can( 'read_hidden_forums' ) ) { 629 bbp_add_error( 'bbp_edit_reply_forum_hidden', __( '<strong>ERROR</strong>: This forum is hidden and you do not have the capability to read or create new replies in it.', 'bbpress' ) ); 630 } 621 } elseif ( bbp_is_forum_hidden( $forum_id ) && ! current_user_can( 'read_forum', $forum_id ) ) { 622 bbp_add_error( 'bbp_edit_reply_forum_hidden', __( '<strong>ERROR</strong>: This forum is hidden and you do not have the capability to read or create new replies in it.', 'bbpress' ) ); 631 623 } 632 624 } … … 889 881 890 882 } else { 891 if ( empty( $is_edit ) && ! current_user_can( 'throttle' ) ) {883 if ( empty( $is_edit ) && ! current_user_can( 'throttle' ) ) { 892 884 bbp_update_user_last_posted( $author_id ); 893 885 } … … 1362 1354 1363 1355 // Use cannot edit topic 1364 if ( ! current_user_can( 'edit_topic', $source_topic->ID ) ) {1356 if ( ! current_user_can( 'edit_topic', $source_topic->ID ) ) { 1365 1357 bbp_add_error( 'bbp_move_reply_source_permission', __( '<strong>ERROR</strong>: You do not have permission to edit the source topic.', 'bbpress' ) ); 1366 1358 } … … 1400 1392 1401 1393 // User cannot edit the destination topic 1402 if ( ! current_user_can( 'edit_topic', $destination_topic->ID ) ) {1394 if ( ! current_user_can( 'edit_topic', $destination_topic->ID ) ) { 1403 1395 bbp_add_error( 'bbp_move_reply_destination_permission', __( '<strong>ERROR</strong>: You do not have permission to edit the destination topic.', 'bbpress' ) ); 1404 1396 }
Note: See TracChangeset
for help on using the changeset viewer.