Ticket #24633: 24633.patch
File 24633.patch, 4.6 KB (added by , 11 years ago) |
---|
-
wp-admin/admin-ajax.php
57 57 'wp-remove-post-lock', 'dismiss-wp-pointer', 'upload-attachment', 'get-attachment', 58 58 'query-attachments', 'save-attachment', 'save-attachment-compat', 'send-link-to-editor', 59 59 'send-attachment-to-editor', 'save-attachment-order', 'heartbeat', 'get-revision-diffs', 60 'generate_password', 60 61 ); 61 62 62 63 // Register core Ajax calls. -
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/includes/ajax-actions.php
2123 2123 } 2124 2124 wp_send_json_success( $return ); 2125 2125 } 2126 2127 function wp_ajax_generate_password() { 2128 die( wp_generate_password() ); 2129 } 2130 No newline at end of file -
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>