Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/08/2010 04:24:52 PM (16 years ago)
Author:
apeatling
Message:

Fixes #1854

File:
1 edited

Legend:

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

    r2617 r2635  
    8383 * email address is no longer necessary. It's also a terrible idea security wise.
    8484 *
     85 * The only exception to this is when an admin has generated an account for a user.
     86 *
    8587 * This will only disable the email if a custom registration template is being used.
    8688 */
     
    9193        return false;
    9294}
    93 add_filter( 'wpmu_welcome_user_notification', 'bp_core_disable_welcome_email' );
     95if ( !is_admin() && empty( $_GET['e'] ) )
     96        add_filter( 'wpmu_welcome_user_notification', 'bp_core_disable_welcome_email' );
    9497
    9598// Notify user of signup success.
     
    116119        return false;
    117120}
    118 add_filter( 'wpmu_signup_blog_notification', 'bp_core_activation_signup_blog_notification', 1, 7 );
     121if ( !is_admin() )
     122        add_filter( 'wpmu_signup_blog_notification', 'bp_core_activation_signup_blog_notification', 1, 7 );
    119123
    120124function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) {
     
    128132                $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    129133
     134        /* If this is an admin generated activation, add a param to email the user login details */
     135        if ( is_admin() )
     136                $email = '&e=1';
     137
    130138        $from_name = ( '' == get_site_option( "site_name" ) ) ? 'WordPress' : wp_specialchars( get_site_option( "site_name" ) );
    131139        $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    132         $message = sprintf( __( "Thanks for registering! To complete the activation of your account please click the following link:\n\n%s\n\n", 'buddypress' ), $activate_url, clean_url("http://{$domain}{$path}" ) );
     140        $message = sprintf( __( "Thanks for registering! To complete the activation of your account please click the following link:\n\n%s\n\n", 'buddypress' ), $activate_url . $email, clean_url("http://{$domain}{$path}" ) );
    133141        $subject = '[' . $from_name . '] ' . __( 'Activate Your Account', 'buddypress' );
    134142
     
    138146        return false;
    139147}
    140 add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 );
     148if ( !is_admin() || ( is_admin() && empty( $_POST['noconfirmation'] ) ) )
     149        add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 );
    141150
    142151?>
Note: See TracChangeset for help on using the changeset viewer.