Persist (and mask) the password on the install screen if the install does not proceed due to errors.

If you forget or enter an invalid username/e-mail, the password choosing shouldn't start over.

fixes #33162
Built from https://develop.svn.wordpress.org/trunk@33495


git-svn-id: http://core.svn.wordpress.org/trunk@33462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Mark Jaquith 2015-07-29 19:22:26 +00:00
parent 05965d87e4
commit 61dd2bfdde
4 changed files with 15 additions and 10 deletions

View File

@ -137,9 +137,9 @@ function display_setup_form( $error = null ) {
</th> </th>
<td> <td>
<div class=""> <div class="">
<?php $initial_password = wp_generate_password( 18 ); ?> <?php $initial_password = isset( $_POST['admin_password'] ) ? stripslashes( $_POST['admin_password'] ) : wp_generate_password( 18 ); ?>
<input type="password" name="admin_password" id="pass1" class="regular-text" autocomplete="off" data-reveal="1" data-pw="<?php echo esc_attr( $initial_password ); ?>" aria-describedby="pass-strength-result" /> <input type="password" name="admin_password" id="pass1" class="regular-text" autocomplete="off" data-reveal="1" data-pw="<?php echo esc_attr( $initial_password ); ?>" aria-describedby="pass-strength-result" />
<button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>"> <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-start-masked="<?php echo (int) isset( $_POST['admin_password'] ); ?>" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>">
<span class="dashicons dashicons-hidden"></span> <span class="dashicons dashicons-hidden"></span>
<span class="text"><?php _e( 'Hide' ); ?></span> <span class="text"><?php _e( 'Hide' ); ?></span>
</button> </button>

View File

@ -12,6 +12,7 @@
$weakRow, $weakRow,
$weakCheckbox, $weakCheckbox,
$toggleButton,
$submitButtons, $submitButtons,
$submitButton, $submitButton,
currentPass; currentPass;
@ -22,7 +23,11 @@
} else { } else {
$pass1.val( $pass1.data( 'pw' ) ); $pass1.val( $pass1.data( 'pw' ) );
$pass1.trigger( 'pwupdate' ); $pass1.trigger( 'pwupdate' );
$pass1Wrap.addClass( 'show-password' ); if ( 1 !== parseInt( $toggleButton.data( 'start-masked' ), 10 ) ) {
$pass1Wrap.addClass( 'show-password' );
} else {
$toggleButton.trigger( 'click' );
}
} }
} }
@ -82,11 +87,11 @@
} }
function bindToggleButton() { function bindToggleButton() {
var toggleButton = $pass1Row.find('.wp-hide-pw'); $toggleButton = $pass1Row.find('.wp-hide-pw');
toggleButton.show().on( 'click', function () { $toggleButton.show().on( 'click', function () {
if ( 1 === parseInt( toggleButton.data( 'toggle' ), 10 ) ) { if ( 1 === parseInt( $toggleButton.data( 'toggle' ), 10 ) ) {
$pass1Wrap.addClass( 'show-password' ); $pass1Wrap.addClass( 'show-password' );
toggleButton $toggleButton
.data( 'toggle', 0 ) .data( 'toggle', 0 )
.attr({ .attr({
'aria-label': userProfileL10n.ariaHide 'aria-label': userProfileL10n.ariaHide
@ -105,7 +110,7 @@
} }
} else { } else {
$pass1Wrap.removeClass( 'show-password' ); $pass1Wrap.removeClass( 'show-password' );
toggleButton $toggleButton
.data( 'toggle', 1 ) .data( 'toggle', 1 )
.attr({ .attr({
'aria-label': userProfileL10n.ariaShow 'aria-label': userProfileL10n.ariaShow

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.3-beta4-33494'; $wp_version = '4.3-beta4-33495';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.