Ticket #32589: 32589.9.patch
File 32589.9.patch, 6.6 KB (added by , 9 years ago) |
---|
-
src/wp-admin/js/user-profile.js
7 7 pw_field2 = $('#pass2'), 8 8 pw_togglebtn = pw_new.find('.wp-hide-pw'), 9 9 pw_generatebtn = pw_new.find('button.wp-generate-pw'), 10 pw_cancelbtn = pw_new.find('button.wp-cancel-pw'), 10 11 pw_2 = $('.user-pass2-wrap'), 11 12 parentform = pw_new.closest('form'), 12 13 pw_strength = $('#pass-strength-result'), 13 14 pw_submitbtn_edit = $('#submit'), 14 15 pw_submitbtn_new = $( '#createusersub' ), 15 16 pw_checkbox = $('.pw-checkbox'), 16 pw_weak = $('.pw-weak') 17 pw_weak = $('.pw-weak'), 18 pw_update_lock = false 17 19 ; 18 20 21 var beforeunload = function() { 22 if ( true === pw_update_lock ) { 23 return userProfileL10n.warn; 24 } 25 } 26 19 27 var generatePassword = window.generatePassword = function() { 20 28 if ( typeof zxcvbn !== 'function' ) { 21 29 setTimeout( generatePassword, 50 ); … … 88 96 pw_generatebtn.hide(); 89 97 pw_line.show(); 90 98 generatePassword(); 99 pw_update_lock = true; 91 100 }); 92 101 102 pw_line.on( 'click', 'button.wp-cancel-pw', function(){ 103 pw_generatebtn.show(); 104 pw_line.hide(); 105 pw_update_lock = false; 106 }); 107 108 pw_submitbtn_edit.on( 'click', function() { 109 pw_update_lock = false; 110 }) 111 93 112 pw_togglebtn.on( 'click', function() { 94 113 var show = pw_togglebtn.attr( 'data-toggle' ); 95 114 if ( show == 1 ) { … … 108 127 pw_field.focus(); 109 128 pw_field[0].setSelectionRange(100, 100); 110 129 }); 130 131 $( window ).on( 'beforeunload', beforeunload ); 111 132 }); 112 133 113 134 function check_pass_strength() { -
src/wp-admin/user-edit.php
452 452 <td><textarea name="description" id="description" rows="5" cols="30"><?php echo $profileuser->description; // textarea_escaped ?></textarea> 453 453 <p class="description"><?php _e('Share a little biographical information to fill out your profile. This may be shown publicly.'); ?></p></td> 454 454 </tr> 455 455 </table> 456 456 <?php 457 457 /** This filter is documented in wp-admin/user-new.php */ 458 458 $show_password_fields = apply_filters( 'show_password_fields', true, $profileuser ); 459 459 if ( $show_password_fields ) : 460 460 ?> 461 <h3><?php _e('Account Management') ?></h3> 462 <table class="form-table"> 461 463 <tr id="password" class="user-pass1-wrap"> 462 464 <th><label for="pass1"><?php _e( 'New Password' ); ?></label></th> 463 465 <td> 464 466 <input class="hidden" value=" " /><!-- #24364 workaround --> 465 <button type="button" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Generate new password' ); ?></button>467 <button type="button" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Generate Password' ); ?></button> 466 468 <div class="wp-pwd hide-if-js"> 467 469 <input type="password" name="pass1" id="pass1" class="regular-text" value="" autocomplete="off" data-pw="<?php echo esc_attr( wp_generate_password( 24 ) ); ?>" /> 468 470 <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0"> 469 471 <span class="dashicons dashicons-visibility"></span> 470 472 <span class="text"><?php _e( 'Hide' ); ?></span> 471 473 </button> 474 <button type="button" class="button button-secondary wp-cancel-pw hide-if-no-js" data-toggle="0"> 475 <span class="text"><?php _e( 'Cancel' ); ?></span> 476 </button> 472 477 <div style="display:none" id="pass-strength-result"></div> 473 478 </div> 474 479 </td> … … 483 488 <tr class="pw-weak"> 484 489 <th><?php _e( 'Confirm Password' ); ?></th> 485 490 <td> 486 <label for="pw_weak">491 <label> 487 492 <input type="checkbox" name="pw_weak" class="pw-checkbox" id="pw-weak" /> 488 493 <?php _e( 'Confirm use of weak password' ); ?> 489 494 </label> … … 494 499 <?php 495 500 if ( IS_PROFILE_PAGE && count( $sessions->get_all() ) === 1 ) : ?> 496 501 <tr class="user-sessions-wrap hide-if-no-js"> 497 <th> </th>502 <th><?php _e( 'Sessions' ); ?></th> 498 503 <td aria-live="assertive"> 499 <div class="destroy-sessions"><button type="button" disabled class="button button-secondary"><?php _e( ' Log Out of All Other Sessions' ); ?></button></div>504 <div class="destroy-sessions"><button type="button" disabled class="button button-secondary"><?php _e( 'Sign-out Everywhere' ); ?></button></div> 500 505 <p class="description"> 501 506 <?php _e( 'You are only logged in at this location.' ); ?> 502 507 </p> … … 504 509 </tr> 505 510 <?php elseif ( IS_PROFILE_PAGE && count( $sessions->get_all() ) > 1 ) : ?> 506 511 <tr class="user-sessions-wrap hide-if-no-js"> 507 <th> </th>512 <th><?php _e( 'Sessions' ); ?></th> 508 513 <td aria-live="assertive"> 509 <div class="destroy-sessions"><button type="button" class="button button-secondary" id="destroy-sessions"><?php _e( ' Log Out of All Other Sessions' ); ?></button></div>514 <div class="destroy-sessions"><button type="button" class="button button-secondary" id="destroy-sessions"><?php _e( 'Sign-out Everywhere' ); ?></button></div> 510 515 <p class="description"> 511 516 <?php _e( 'Left your account logged in at a public computer? Lost your phone? This will log you out everywhere except your current browser.' ); ?> 512 517 </p> -
src/wp-admin/user-new.php
407 407 <span class="dashicons dashicons-visibility"></span> 408 408 <span class="text"><?php _e( 'Hide' ); ?></span> 409 409 </button> 410 <button type="button" class="button button-secondary wp-cancel-pw hide-if-no-js" data-toggle="0"> 411 <span class="text"><?php _e( 'Cancel' ); ?></span> 412 </button> 410 413 <div style="display:none" id="pass-strength-result"></div> 411 414 </div> 412 415 <p><span class="description"><?php _e( 'A password reset link will be sent to the user via email.' ); ?></span></p> … … 421 424 <tr class="pw-weak"> 422 425 <th><?php _e( 'Confirm Password' ); ?></th> 423 426 <td> 424 <label for="pw-weak">425 <input type="checkbox" name="pw -weak" class="pw-checkbox" id="pw-weak" />427 <label> 428 <input type="checkbox" name="pw_weak" class="pw-checkbox" id="pw-weak" /> 426 429 <?php _e( 'Confirm use of weak password' ); ?> 427 430 </label> 428 431 </td> -
src/wp-includes/script-loader.php
374 374 375 375 $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter', 'wp-util' ), false, 1 ); 376 376 did_action( 'init' ) && $scripts->localize( 'user-profile', 'userProfileL10n', array( 377 'show' => __( 'Show' ), 378 'hide' => __( 'Hide' ), 377 'show' => __( 'Show' ), 378 'hide' => __( 'Hide' ), 379 'cancel' => __( 'Cancel' ), 380 'warn' => __( 'Doing so now will leave your password unchanged.' ), 379 381 ) ); 380 382 381 383 $scripts->add( 'language-chooser', "/wp-admin/js/language-chooser$suffix.js", array( 'jquery' ), false, 1 );