Skip to:
Content

BuddyPress.org

Changeset 2773


Ignore:
Timestamp:
02/23/2010 12:01:04 PM (14 years ago)
Author:
apeatling
Message:

Fixes #2043

Location:
branches/1.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-core/bp-core-activation.php

    r2697 r2773  
    7676add_action( 'wp', 'bp_core_screen_activation', 3 );
    7777
     78/***
     79 * bp_core_filter_user_welcome_email()
     80 *
     81 * Replace the generated password in the welcome email.
     82 * This will not filter when the site admin registers a user.
     83 */
     84function bp_core_filter_user_welcome_email( $welcome_email ) {
     85    /* Don't touch the email if we don't have a custom registration template */
     86    if ( '' == locate_template( array( 'registration/register.php' ), false ) && '' == locate_template( array( 'register.php' ), false ) )
     87        return $welcome_email;
     88
     89    return str_replace( 'PASSWORD', __( '[User Set]', 'buddypress' ), $welcome_email );
     90}
     91if ( !is_admin() && empty( $_GET['e'] ) )
     92    add_filter( 'update_welcome_user_email', 'bp_core_filter_user_welcome_email' );
    7893
    7994/***
    80  * bp_core_disable_welcome_email()
     95 * bp_core_filter_blog_welcome_email()
    8196 *
    82  * Since the user now chooses their password, sending it over clear-text to an
    83  * email address is no longer necessary. It's also a terrible idea security wise.
    84  *
    85  * The only exception to this is when an admin has generated an account for a user.
    86  *
    87  * This will only disable the email if a custom registration template is being used.
     97 * Replace the generated password in the welcome email.
     98 * This will not filter when the site admin registers a user.
    8899 */
    89 function bp_core_disable_welcome_email() {
     100function bp_core_filter_blog_welcome_email( $welcome_email, $blog_id, $user_id, $password ) {
     101    /* Don't touch the email if we don't have a custom registration template */
    90102    if ( '' == locate_template( array( 'registration/register.php' ), false ) && '' == locate_template( array( 'register.php' ), false ) )
    91         return true;
     103        return $welcome_email;
    92104
    93     return false;
     105    return str_replace( $password, __( '[User Set]', 'buddypress' ), $welcome_email );
    94106}
    95107if ( !is_admin() && empty( $_GET['e'] ) )
    96     add_filter( 'wpmu_welcome_user_notification', 'bp_core_disable_welcome_email' );
     108    add_filter( 'update_welcome_email', 'bp_core_filter_blog_welcome_email', 10, 4 );
    97109
    98110// Notify user of signup success.
  • branches/1.2/bp-themes/bp-default/registration/register.php

    r2695 r2773  
    175175                        <p><input type="checkbox" name="signup_with_blog" id="signup_with_blog" value="1"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes, I\'d like to create a new blog', 'buddypress' ) ?></p>
    176176
    177                         <div id="blog-details">
     177                        <div id="blog-details"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?>class="show"<?php endif; ?>>
    178178
    179179                            <label for="signup_blog_url"><?php _e( 'Blog URL', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
     
    298298    <script type="text/javascript">
    299299        jQuery(document).ready( function() {
    300             if ( jQuery('div#blog-details').length )
     300            if ( jQuery('div#blog-details').length && !jQuery('div#blog-details').hasClass('show') )
    301301                jQuery('div#blog-details').toggle();
    302302
Note: See TracChangeset for help on using the changeset viewer.