Changeset 2773
- Timestamp:
- 02/23/2010 12:01:04 PM (15 years ago)
- Location:
- branches/1.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-core/bp-core-activation.php
r2697 r2773 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. -
branches/1.2/bp-themes/bp-default/registration/register.php
r2695 r2773 175 175 <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> 176 176 177 <div id="blog-details" >177 <div id="blog-details"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?>class="show"<?php endif; ?>> 178 178 179 179 <label for="signup_blog_url"><?php _e( 'Blog URL', 'buddypress' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label> … … 298 298 <script type="text/javascript"> 299 299 jQuery(document).ready( function() { 300 if ( jQuery('div#blog-details').length )300 if ( jQuery('div#blog-details').length && !jQuery('div#blog-details').hasClass('show') ) 301 301 jQuery('div#blog-details').toggle(); 302 302
Note: See TracChangeset
for help on using the changeset viewer.