Ticket #32428: 32428.diff
File 32428.diff, 2.5 KB (added by , 9 years ago) |
---|
-
src/wp-includes/pluggable.php
1692 1692 * @param int $user_id User ID. 1693 1693 * @param string $plaintext_pass Optional. The user's plaintext password. Default empty. 1694 1694 */ 1695 function wp_new_user_notification($user_id, $plaintext_pass = '') { 1695 function wp_new_user_notification( $user_id, $plaintext_pass = '' ) { 1696 global $wpdb, $wp_hasher; 1696 1697 $user = get_userdata( $user_id ); 1697 1698 1698 1699 // The blogname option is escaped with esc_html on the way into the database in sanitize_option 1699 1700 // we want to reverse this for the plain text arena of emails. 1700 $blogname = wp_specialchars_decode( get_option('blogname'), ENT_QUOTES);1701 $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); 1701 1702 1702 $message = sprintf( __('New user registration on your site %s:'), $blogname) . "\r\n\r\n";1703 $message .= sprintf( __('Username: %s'), $user->user_login) . "\r\n\r\n";1704 $message .= sprintf( __('E-mail: %s'), $user->user_email) . "\r\n";1703 $message = sprintf( __( 'New user registration on your site %s:' ), $blogname ) . "\r\n\r\n"; 1704 $message .= sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n\r\n"; 1705 $message .= sprintf( __( 'E-mail: %s' ), $user->user_email ) . "\r\n"; 1705 1706 1706 @wp_mail( get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);1707 @wp_mail( get_option( 'admin_email' ), sprintf( __( '[%s] New User Registration' ), $blogname ), $message ); 1707 1708 1708 if ( empty( $plaintext_pass) )1709 if ( empty( $plaintext_pass ) ) { 1709 1710 return; 1711 } 1710 1712 1711 $message = sprintf(__('Username: %s'), $user->user_login) . "\r\n"; 1712 $message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n"; 1713 $message .= wp_login_url() . "\r\n"; 1713 $key = wp_generate_password( 20, false ); 1714 $hashed = $wp_hasher->HashPassword( $key ); 1715 $wpdb->update( $wpdb->users, array( 'user_activation_key' => $hashed ), array( 'user_login' => $user->user_login ) ); 1716 $link = network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user->user_login ), 'login' ); 1714 1717 1715 wp_mail($user->user_email, sprintf(__('[%s] Your username and password'), $blogname), $message); 1718 $message = sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n"; 1719 $message .= sprintf( __( 'Set Password: %s' ), $link ) . "\r\n"; 1716 1720 1721 wp_mail( $user->user_email, sprintf( __( '[%s] Your username and password' ), $blogname ), $message ); 1717 1722 } 1718 1723 endif; 1719 1724