Ticket #32430: 32430.diff
| File 32430.diff, 5.1 KB (added by , 11 years ago) |
|---|
-
src/wp-includes/pluggable.php
1656 1656 /** 1657 1657 * Notify the blog admin of a user changing password, normally via email. 1658 1658 * 1659 * Notify the user of any change to their password, also via email. 1660 * 1659 1661 * @since 2.7.0 1660 1662 * 1661 1663 * @param object $user User Object 1662 1664 */ 1663 1665 function wp_password_change_notification(&$user) { 1664 // send a copy ofpassword change notification to the admin1666 // send password change notification to the admin 1665 1667 // but check to see if it's the admin whose password we're changing, and skip this 1666 1668 if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) { 1667 1669 $message = sprintf(__('Password Lost and Changed for user: %s'), $user->user_login) . "\r\n"; … … 1669 1671 // we want to reverse this for the plain text arena of emails. 1670 1672 $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); 1671 1673 wp_mail(get_option('admin_email'), sprintf(__('[%s] Password Lost/Changed'), $blogname), $message); 1674 1675 //send password change notification to the user 1676 } else { 1677 /* translators: Do not translate USERNAME, ADMIN_EMAIL, EMAIL, SITENAME, SITEURL: those are placeholders. */ 1678 $email_text = __( 'Howdy ###USERNAME###, 1679 1680 This notice is confirming you recently changed your password on ###SITENAME###. 1681 1682 If you did not change your password, please contact the Site Administrator at 1683 ###ADMIN_EMAIL### 1684 1685 This email has been sent to ###EMAIL### 1686 1687 Regards, 1688 All at ###SITENAME### 1689 ###SITEURL###' ); 1690 1691 /** 1692 * Filter the email text sent when the user's password is changed. 1693 * 1694 * The following strings have a special meaning and will get replaced dynamically: 1695 * ###USERNAME### The current user's username. 1696 * ###ADMIN_EMAIL### The link to click on to confirm the email change. 1697 * ###EMAIL### The new email. 1698 * ###SITENAME### The name of the site. 1699 * ###SITEURL### The URL to the site. 1700 * 1701 * @since 4.3 1702 * 1703 * @param string $email_text Text in the email. 1704 */ 1705 $content = apply_filters( 'user_password_change_email_content', $email_text ); 1706 1707 $content = str_replace( '###USERNAME###', $user->user_login, $content ); 1708 $content = str_replace( '###ADMIN_EMAIL###', get_option( 'admin_email' ), $content ); 1709 $content = str_replace( '###EMAIL###', $user->user_email, $content ); 1710 $content = str_replace( '###SITENAME###', get_option( 'blogname' ), $content ); 1711 $content = str_replace( '###SITEURL###', get_option( 'siteurl' ), $content ); 1712 1713 wp_mail( $user->user_email, sprintf( __( '[%s] Notice of Password Change' ), wp_specialchars_decode( get_option( 'blogname' ) ) ), $content ); 1672 1714 } 1673 1715 } 1674 1716 endif; -
src/wp-includes/user.php
2121 2121 // If password is changing, hash it now. 2122 2122 if ( ! empty($userdata['user_pass']) ) { 2123 2123 $plaintext_pass = $userdata['user_pass']; 2124 $userdata['user_pass'] = wp_hash_password( $userdata['user_pass']);2124 $userdata['user_pass'] = wp_hash_password( $userdata['user_pass'] ); 2125 2125 } 2126 2126 2127 wp_cache_delete( $user[ 'user_email' ], 'useremail');2127 wp_cache_delete( $user[ 'user_email' ], 'useremail' ); 2128 2128 2129 if ( $user['user_email'] !== $userdata['user_email'] ) { 2130 $email_text = __( 'Howdy ###USERNAME###, 2131 2132 This notice is confirming you recently changed your email on ###SITENAME###. 2133 2134 If you did not change your email, please contact the Site Administrator at 2135 ###ADMIN_EMAIL### 2136 2137 This email has been sent to ###EMAIL### 2138 2139 Regards, 2140 All at ###SITENAME### 2141 ###SITEURL###' ); 2142 2143 /** 2144 * Filter the email text sent when the user's email is changed. 2145 * 2146 * The following strings have a special meaning and will get replaced dynamically: 2147 * ###USERNAME### The current user's username. 2148 * ###ADMIN_EMAIL### The link to click on to confirm the email change. 2149 * ###EMAIL### The new email. 2150 * ###SITENAME### The name of the site. 2151 * ###SITEURL### The URL to the site. 2152 * 2153 * @since 4.3 2154 * 2155 * @param string $email_text Text in the email. 2156 */ 2157 $content = apply_filters( 'user_email_change_email_content', $email_text ); 2158 2159 $content = str_replace( '###USERNAME###', $user->user_login, $content ); 2160 $content = str_replace( '###ADMIN_EMAIL###', get_option( 'admin_email' ), $content ); 2161 $content = str_replace( '###EMAIL###', $user->user_email, $content ); 2162 $content = str_replace( '###SITENAME###', get_option( 'blogname' ), $content ); 2163 $content = str_replace( '###SITEURL###', get_option( 'siteurl' ), $content ); 2164 2165 wp_mail( $user['user_email'], sprintf( __( '[%s] Notice of Email Change' ), wp_specialchars_decode( get_option( 'blogname' ) ) ), $content ); 2166 } 2167 2129 2168 // Merge old and new fields with new fields overwriting old ones. 2130 $userdata = array_merge( $user, $userdata);2169 $userdata = array_merge( $user, $userdata ); 2131 2170 $user_id = wp_insert_user($userdata); 2132 2171 2133 2172 // Update the cookies if the password changed.