Ticket #33358: 33358.5.diff
File 33358.5.diff, 3.8 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/user.php
176 176 $user_id = wp_update_user( $user ); 177 177 } else { 178 178 $user_id = wp_insert_user( $user ); 179 wp_new_user_notification( $user_id );179 wp_new_user_notification( $user_id, 'both' ); 180 180 } 181 181 return $user_id; 182 182 } -
src/wp-admin/network/site-new.php
79 79 if ( false === $user_id ) 80 80 wp_die( __( 'There was an error creating the user.' ) ); 81 81 else 82 wp_new_user_notification( $user_id, $password);82 wp_new_user_notification( $user_id, 'both' ); 83 83 } 84 84 85 85 $wpdb->hide_errors(); -
src/wp-admin/network/site-users.php
77 77 if ( false === $user_id ) { 78 78 $update = 'err_new_dup'; 79 79 } else { 80 wp_new_user_notification( $user_id, $password);80 wp_new_user_notification( $user_id, 'both' ); 81 81 add_user_to_blog( $id, $user_id, $_POST['new_role'] ); 82 82 $update = 'newuser'; 83 83 } -
src/wp-admin/network/user-new.php
51 51 if ( ! $user_id ) { 52 52 $add_user_errors = new WP_Error( 'add_user_fail', __( 'Cannot add user.' ) ); 53 53 } else { 54 wp_new_user_notification( $user_id, $password);54 wp_new_user_notification( $user_id, 'both' ); 55 55 wp_redirect( add_query_arg( array('update' => 'added'), 'user-new.php' ) ); 56 56 exit; 57 57 } -
src/wp-includes/pluggable.php
1688 1688 * A new user registration notification is also sent to admin email. 1689 1689 * 1690 1690 * @since 2.0.0 1691 * @since 4.3.0 The `$plaintext_pass` parameter was changed to `$notify`. 1691 1692 * 1692 * @param int $user_id User ID. 1693 * @param int $user_id User ID. 1694 * @param string $notify Whether admin and user should be notified ('both') or 1695 * only the admin ('admin' or empty). 1693 1696 */ 1694 function wp_new_user_notification( $user_id) {1697 function wp_new_user_notification( $user_id, $notify = '' ) { 1695 1698 global $wpdb; 1696 1699 $user = get_userdata( $user_id ); 1697 1700 … … 1705 1708 1706 1709 @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message); 1707 1710 1711 if ( 'admin' === $notify || empty( $notify ) ) { 1712 return; 1713 } 1714 1708 1715 // Generate something random for a password reset key. 1709 1716 $key = wp_generate_password( 20, false ); 1710 1717 1718 /** This action is documented in wp-login.php */ 1711 1719 do_action( 'retrieve_password_key', $user->user_login, $key ); 1712 1720 1713 1721 // Now insert the key, hashed, into the DB. … … 1725 1733 $message .= wp_login_url() . "\r\n"; 1726 1734 1727 1735 wp_mail($user->user_email, sprintf(__('[%s] Your username and password info'), $blogname), $message); 1728 1729 1736 } 1730 1737 endif; 1731 1738 -
src/wp-includes/user.php
2619 2619 2620 2620 update_user_option( $user_id, 'default_password_nag', true, true ); //Set up the Password change nag. 2621 2621 2622 wp_new_user_notification( $user_id );2622 wp_new_user_notification( $user_id, 'both' ); 2623 2623 2624 2624 return $user_id; 2625 2625 }