Changeset 2784 for trunk/bp-core/bp-core-activation.php
- Timestamp:
- 02/23/2010 08:55:18 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/bp-core-activation.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-activation.php
r2697 r2784 76 76 add_action( 'wp', 'bp_core_screen_activation', 3 ); 77 77 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 */ 84 function 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 } 91 if ( !is_admin() && empty( $_GET['e'] ) ) 92 add_filter( 'update_welcome_user_email', 'bp_core_filter_user_welcome_email' ); 78 93 79 94 /*** 80 * bp_core_ disable_welcome_email()95 * bp_core_filter_blog_welcome_email() 81 96 * 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. 88 99 */ 89 function bp_core_disable_welcome_email() { 100 function 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 */ 90 102 if ( '' == locate_template( array( 'registration/register.php' ), false ) && '' == locate_template( array( 'register.php' ), false ) ) 91 return true;103 return $welcome_email; 92 104 93 return false;105 return str_replace( $password, __( '[User Set]', 'buddypress' ), $welcome_email ); 94 106 } 95 107 if ( !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 ); 97 109 98 110 // Notify user of signup success.
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)