Ticket #24633: 24633.2.patch
File 24633.2.patch, 4.7 KB (added by , 11 years ago) |
---|
-
wp-admin/admin-ajax.php
58 58 'wp-remove-post-lock', 'dismiss-wp-pointer', 'upload-attachment', 'get-attachment', 59 59 'query-attachments', 'save-attachment', 'save-attachment-compat', 'send-link-to-editor', 60 60 'send-attachment-to-editor', 'save-attachment-order', 'heartbeat', 'get-revision-diffs', 61 'save-user-color-scheme', 61 'save-user-color-scheme', 'generate_password', 62 62 ); 63 63 64 64 // Register core Ajax calls. -
wp-admin/includes/ajax-actions.php
2264 2264 update_user_option( $user_id, 'admin_color', $color_scheme, true ); 2265 2265 wp_send_json_success(); 2266 2266 } 2267 2268 function wp_ajax_generate_password() { 2269 die( wp_generate_password() ); 2270 } 2271 No newline at end of file -
wp-admin/includes/user.php
157 157 158 158 if ( $update ) { 159 159 $user_id = wp_update_user( $user ); 160 161 // Encourage the user to reset their password 162 if( ! empty( $_POST['reset_password'] ) ) { 163 update_user_option( $user_id, 'default_password_nag', true, true ); 164 } 165 166 // Send the new, plaintext password to the user 167 if( ! empty( $_POST['send_password'] ) ) { 168 $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); 169 $message = sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n"; 170 $message .= sprintf( __( 'Password: %s' ), $pass1 ) . "\r\n"; 171 $message .= wp_login_url() . "\r\n"; 172 173 wp_mail( $user->user_email, sprintf( __( '[%s] Your username and password' ), $blogname ), $message ); 174 } 175 160 176 } else { 161 177 $user_id = wp_insert_user( $user ); 162 178 wp_new_user_notification( $user_id, isset( $_POST['send_password'] ) ? wp_unslash( $pass1 ) : '' ); -
wp-admin/js/user-profile.js
35 35 $('#pass1').val('').keyup( check_pass_strength ); 36 36 $('#pass2').val('').keyup( check_pass_strength ); 37 37 $('#pass-strength-result').show(); 38 $('#generate-password').on('click', function() { 39 $.post( ajaxurl, { action: 'generate_password' }, function( response ) { 40 $('#pass1,#pass2').val( response ).trigger('keyup'); 41 }); 42 }); 38 43 $('.color-palette').click( function() { 39 44 $(this).siblings('input[name="admin_color"]').prop('checked', true); 40 45 }); -
wp-admin/user-edit.php
384 384 <tr> 385 385 <th scope="row"><label for="pass2"><?php _e('Repeat New Password'); ?></label></th> 386 386 <td> 387 <input name="pass2" type="password" id="pass2" size="16" value="" autocomplete="off" /> <span class="description" for="pass2"><?php _e("Type your new password again."); ?></span> 388 <br /> 389 <div id="pass-strength-result"><?php _e('Strength indicator'); ?></div> 390 <p class="description indicator-hint"><?php _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).'); ?></p> 387 <input name="pass2" type="password" id="pass2" size="16" value="" autocomplete="off" /> <span class="description" for="pass2"><?php _e("Type your new password again."); ?></span> 388 <br /> 389 <div id="pass-strength-result"><?php _e('Strength indicator'); ?></div> 390 <p class="description indicator-hint"><?php _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).'); ?></p> 391 <br/> 392 <input type="button" name="generate-password" id="generate-password" value="<?php _e( 'Generate Password' ); ?>" class="button hide-if-no-js" /> 391 393 </td> 392 394 </tr> 395 <tr class="hide-if-no-js"> 396 <th scope="row"><label for="send_password"><?php _e( 'Send Password?' ) ?></label></th> 397 <td> 398 <label for="send_password"> 399 <input type="checkbox" name="send_password" id="send_password" /> <?php _e( 'Send this password to the user by email.'); ?> 400 </label> 401 <br/> 402 <label for="reset_password"> 403 <input type="checkbox" name="reset_password" id="reset_password" /> <?php _e( 'Encourage the user to change their password, once logged in.' ); ?> 404 </label> 405 </td> 406 </tr> 393 407 <?php endif; ?> 394 408 </table> 395 409