Skip to:
Content

BuddyPress.org

Changeset 3734


Ignore:
Timestamp:
01/18/2011 09:17:21 PM (13 years ago)
Author:
djpaul
Message:

Tell users if they've been marked as a spammer, or haven't activated their account yet, when they try to log in. Fixes #2575

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r3728 r3734  
    293293}
    294294
    295 /** 
    296  * Creates a default component slug from a WP page root_slug 
    297  * 
     295/**
     296 * Creates a default component slug from a WP page root_slug
     297 *
    298298 * Since 1.3, BP components get their root_slug (the slug used immediately
    299299 * following the root domain) from the slug of a corresponding WP page.
    300  * 
     300 *
    301301 * E.g. if your BP installation at example.com has its members page at
    302302 * example.com/community/people, $bp->members->root_slug will be 'community/people'.
     
    305305 * use elsewhere in the URL, by returning the content after the final '/'
    306306 * in the root_slug ('people' in the example above).
    307  * 
     307 *
    308308 * Filter on 'bp_core_component_slug_from_root_slug' to override this method
    309309 * in general, or define a specific component slug constant (e.g. BP_MEMBERS_SLUG)
    310310 * to override specific component slugs.
    311  * 
    312  * @package BuddyPress Core 
    313  * @since 1.3 
    314  * 
    315  * @param str $root_slug The root slug, which comes from $bp->pages->[component]->slug 
    316  * @return str $slug The short slug for use in the middle of URLs 
    317  */ 
    318 function bp_core_component_slug_from_root_slug( $root_slug ) { 
    319     $slug_chunks = explode( '/', $root_slug ); 
     311 *
     312 * @package BuddyPress Core
     313 * @since 1.3
     314 *
     315 * @param str $root_slug The root slug, which comes from $bp->pages->[component]->slug
     316 * @return str $slug The short slug for use in the middle of URLs
     317 */
     318function bp_core_component_slug_from_root_slug( $root_slug ) {
     319    $slug_chunks = explode( '/', $root_slug );
    320320    $slug        = array_pop( $slug_chunks );
    321    
    322     return apply_filters( 'bp_core_component_slug_from_root_slug', $slug, $root_slug ); 
    323 } 
     321
     322    return apply_filters( 'bp_core_component_slug_from_root_slug', $slug, $root_slug );
     323}
    324324
    325325/**
     
    854854        'screen_function' => &$screen_function
    855855    );
    856    
     856
    857857    if ( ( $bp->current_action == $slug && $bp->current_component == $parent_slug ) && $user_has_access ) {
    858858        if ( !is_object( $screen_function[0] ) )
     
    17971797
    17981798    if ( ( is_multisite() && (int)$user->spam ) || 1 == (int)$user->user_status )
    1799         bp_core_redirect( $bp->root_domain );
     1799        return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Your account has been marked as a spammer.', 'buddypress' ) );
    18001800    else
    18011801        return $auth_obj;
    18021802}
    1803 add_filter( 'authenticate', 'bp_core_boot_spammer', 11, 2 );
     1803add_filter( 'authenticate', 'bp_core_boot_spammer', 30, 2 );
    18041804
    18051805/**
  • trunk/bp-core/bp-core-signup.php

    r3718 r3734  
    602602
    603603    if ( 2 == $user_status )
    604         bp_core_redirect( $bp->root_domain );
     604        return new WP_Error( 'bp_account_not_activated', __( '<strong>ERROR</strong>: Your account has not been activated. Check your email for the activation link.', 'buddypress' ) );
    605605    else
    606606        return $auth_obj;
    607607}
    608 add_filter( 'authenticate', 'bp_core_signup_disable_inactive', 11, 2 );
     608add_filter( 'authenticate', 'bp_core_signup_disable_inactive', 30, 2 );
    609609
    610610/* Kill the wp-signup.php if custom registration signup templates are present */
Note: See TracChangeset for help on using the changeset viewer.