Skip to:
Content

bbPress.org

Changeset 5510


Ignore:
Timestamp:
09/11/2014 03:11:17 PM (10 years ago)
Author:
johnjamesjacoby
Message:

Only allow direct modification of reply forum meta when there is a mismatch with the topic forum.

This prevents moderators and keymasters from creating mismatches and leaves the tool available only for repairs (usually after a migration from a different platform.) Fixes #2270.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/metaboxes.php

    r5464 r5510  
    473473    $reply_topic_id = bbp_get_reply_topic_id( $post_id );
    474474    $reply_forum_id = bbp_get_reply_forum_id( $post_id );
    475 
     475    $topic_forum_id = bbp_get_topic_forum_id( $reply_topic_id );
    476476
    477477    /** Status ****************************************************************/
     
    491491    /** Forum *****************************************************************/
    492492
    493     // Allow individual manipulation of reply forum
    494     if ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate' ) ) : ?>
     493    // Only allow individual manipulation of reply forum if there is a mismatch
     494    if ( ( $reply_forum_id !== $topic_forum_id ) && ( current_user_can( 'edit_others_replies' ) || current_user_can( 'moderate' ) ) ) : ?>
    495495
    496496        <p>
Note: See TracChangeset for help on using the changeset viewer.