Make WordPress Core


Ignore:
Timestamp:
07/01/2015 02:47:24 PM (11 years ago)
Author:
markjaquith
Message:

New password change/set UI.

  • Generate the password for the user
  • More tightly integrate password strength meter
  • Warn on weak passwords

see #32589

props MikeHansenMe, adamsilverstein, binarykitten

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/user-edit.php

    r32974 r33023  
    463463        <td>
    464464                <input class="hidden" value=" " /><!-- #24364 workaround -->
    465                 <input type="password" name="pass1" id="pass1" class="regular-text" size="16" value="" autocomplete="off" />
    466                 <p class="description"><?php _e( 'If you would like to change the password type a new one. Otherwise leave this blank.' ); ?></p>
     465                <button type="button" class="button button-secondary wp-generate-pw hide-if-no-js"><?php _e( 'Generate new password' ); ?></button>
     466                <div class="wp-pwd hide-if-js">
     467                        <input type="password" name="pass1" id="pass1" class="regular-text" value="" autocomplete="off" data-pw="<?php echo esc_attr( wp_generate_password( 24 ) ); ?>" />
     468                        <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0">
     469                                <span class="dashicons dashicons-visibility"></span>
     470                                <span class="text">hide</span>
     471                        </button>
     472                        <div style="display:none" id="pass-strength-result"></div>
     473                </div>
    467474        </td>
    468475</tr>
    469 <tr class="user-pass2-wrap">
     476<tr class="user-pass2-wrap hide-if-js">
    470477        <th scope="row"><label for="pass2"><?php _e( 'Repeat New Password' ); ?></label></th>
    471478        <td>
    472         <input name="pass2" type="password" id="pass2" class="regular-text" size="16" value="" autocomplete="off" />
     479        <input name="pass2" type="password" id="pass2" class="regular-text" value="" autocomplete="off" />
    473480        <p class="description"><?php _e( 'Type your new password again.' ); ?></p>
    474         <br />
    475         <div id="pass-strength-result"><?php _e( 'Strength indicator' ); ?></div>
    476         <p class="description indicator-hint"><?php echo wp_get_password_hint(); ?></p>
    477481        </td>
    478482</tr>
    479 <?php endif; ?>
    480 
    481 <?php
    482 // This is a temporary hook for WordPress 4.3 development. Do not use it or document it.
    483 do_action( '__temp_password_field', $profileuser );
    484 ?>
     483<tr class="pw-weak">
     484        <th><label for="pw-weak"><?php _e( 'Confirm Password' ); ?></label></th>
     485        <td>
     486        <input type="checkbox" name="pw-weak" class="pw-checkbox" />
     487        <?php _e( 'Confirm use of weak password' ); ?>
     488        </td>
     489</tr>
     490<?php endif; ?>
    485491
    486492<?php
Note: See TracChangeset for help on using the changeset viewer.