Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/30/2010 09:13:14 PM (14 years ago)
Author:
boonebgorges
Message:

Improves error reporting after account activation. Along with [WP16954], fixes #2784. Props wpmuguru.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-signup.php

    r3621 r3622  
    223223        $user = apply_filters( 'bp_core_activate_account', bp_core_activate_signup( $_GET['key'] ) );
    224224
    225         /* If there was errors, add a message and redirect */
    226         if ( $user->errors ) {
    227             bp_core_add_message( __( 'There was an error activating your account, please try again.', 'buddypress' ), 'error' );
     225        /* If there were errors, add a message and redirect */
     226        if ( !empty( $user->errors ) ) {
     227            bp_core_add_message( $user->get_error_message(), 'error' );
    228228            bp_core_redirect( $bp->root_domain . '/' . BP_ACTIVATION_SLUG );
    229229        }
     
    435435        ) );
    436436
    437         if ( is_wp_error( $user_id ) || !$user_id ) {
     437        if ( empty( $user_id ) ) {
    438438            $errors->add( 'registerfail', sprintf( __('<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href="mailto:%s">webmaster</a> !', 'buddypress' ), get_option( 'admin_email' ) ) );
    439439            return $errors;
     
    495495        $user = wpmu_activate_signup( $key );
    496496
    497         /* If there was errors, add a message and redirect */
    498         if ( $user->errors ) {
    499             bp_core_add_message( __( 'There was an error activating your account, please try again.', 'buddypress' ), 'error' );
    500             bp_core_redirect( $bp->root_domain . '/' . BP_ACTIVATION_SLUG );
     497        /* If there were errors, add a message and redirect */
     498        if ( !empty( $user->errors ) ) {
     499            return $user;
    501500        }
    502501
Note: See TracChangeset for help on using the changeset viewer.