Skip to:
Content

bbPress.org


Ignore:
Timestamp:
09/10/2011 07:30:45 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Introduce bbp_is_user_active() and bbp_is_user_inactive() to help with spammed and deleted user checks. See #1630 and r3503.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-user-template.php

    r3485 r3504  
    11551155 * @uses is_user_logged_in()
    11561156 * @uses bbp_allow_anonymous()
     1157 * @uses bbp_is_user_active()
    11571158 * @uses current_user_can()
    11581159 * @uses apply_filters()
     
    11741175
    11751176    // User is logged in
    1176     elseif ( !bbp_is_user_spammer() && !bbp_is_user_deleted() && current_user_can( 'publish_topics' ) )
     1177    elseif ( bbp_is_user_active() && current_user_can( 'publish_topics' ) )
    11771178        $retval = true;
    11781179
     
    11891190 * @uses is_user_logged_in()
    11901191 * @uses bbp_allow_anonymous()
     1192 * @uses bbp_is_user_active()
    11911193 * @uses current_user_can()
    11921194 * @uses apply_filters()
     
    12081210
    12091211    // User is logged in
    1210     elseif ( !bbp_is_user_spammer() && !bbp_is_user_deleted() && current_user_can( 'publish_replies' ) )
     1212    elseif ( bbp_is_user_active() && current_user_can( 'publish_replies' ) )
    12111213        $retval = true;
    12121214
     
    12881290
    12891291    // Looking at a single forum & forum is open
    1290     if ( ( bbp_is_single_forum() || is_page() || is_single() ) && bbp_is_forum_open() ) {
     1292    if ( ( bbp_is_single_forum() || is_page() || is_single() ) && bbp_is_forum_open() )
    12911293        $retval = bbp_current_user_can_publish_topics();
    12921294
    12931295    // User can edit this topic
    1294     } elseif ( bbp_is_topic_edit() ) {
     1296    elseif ( bbp_is_topic_edit() )
    12951297        $retval = current_user_can( 'edit_topic', bbp_get_topic_id() );
    1296     }
    12971298
    12981299    // Allow access to be filtered
     
    13231324
    13241325    // Looking at a single topic, topic is open, and forum is open
    1325     if ( ( bbp_is_single_topic() || is_page() || is_single() ) && bbp_is_topic_open() && bbp_is_forum_open() ) {
     1326    if ( ( bbp_is_single_topic() || is_page() || is_single() ) && bbp_is_topic_open() && bbp_is_forum_open() )
    13261327        $retval = bbp_current_user_can_publish_replies();
    13271328
    13281329    // User can edit this topic
    1329     } elseif ( bbp_is_reply_edit() ) {
     1330    elseif ( bbp_is_reply_edit() )
    13301331        $retval = current_user_can( 'edit_reply', bbp_get_reply_id() );
    1331     }
    13321332
    13331333    // Allow access to be filtered
Note: See TracChangeset for help on using the changeset viewer.