Make WordPress Core


Ignore:
Timestamp:
03/05/2010 12:25:30 PM (14 years ago)
Author:
dd32
Message:

Do not display user specified password during install. Fixes #12479. See #10396 for feedback

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/install.php

    r13428 r13592  
    101101        <?php if ( ! $user_table ) : ?>
    102102        <tr>
    103             <th scope="row"><label for="admin_password"><?php _e('Password'); ?></label></th>
     103            <th scope="row">
     104                <p><label for="admin_password"><?php _e('Password'); ?></label></p>
     105                <p><label for="admin_password2"><?php _e('Re-enter Password'); ?></label></p></th>
    104106            <td>
    105                 <input name="admin_password" type="password" id="pass1" size="25" value="<?php  echo esc_attr( $admin_password ); ?>" />
    106                 <br /><?php _e('A password will be automatically generated for you if you leave this field blank.'); ?>
    107                 <br /><div id="pass-strength-result"><?php _e('Strength indicator'); ?></div>
     107                <p><input name="admin_password" type="password" id="pass1" size="25" value="" /></p>
     108                <p><input name="admin_password2" type="password" id="pass2" size="25" value="" /></p>
     109                <p><?php _e('A password will be automatically generated for you if you leave this field blank.'); ?></p>
     110                <div id="pass-strength-result"><?php _e('Strength indicator'); ?></div>
    108111                <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 ! " ? $ % ^ &amp; ).'); ?></p>
    109112            </td>
     
    170173        $user_name = isset($_POST['user_name']) ? trim( stripslashes( $_POST['user_name'] ) ) : 'admin';
    171174        $admin_password = isset($_POST['admin_password']) ? trim( stripslashes( $_POST['admin_password'] ) ) : '';
     175        $admin_password_check = isset($_POST['admin_password2']) ? trim( stripslashes( $_POST['admin_password2'] ) ) : '';
    172176        $admin_email  = isset( $_POST['admin_email']  ) ?trim( stripslashes( $_POST['admin_email'] ) ) : '';
    173177        $public       = isset( $_POST['blog_public']  ) ? (int) $_POST['blog_public'] : 0;
     
    177181            // TODO: poka-yoke
    178182            display_setup_form( __('you must provide a valid user name.') );
     183            $error = true;
     184        } elseif ( $admin_password != $admin_password_check ) {
     185            // TODO: poka-yoke
     186            display_setup_form( __( 'your passwords do not match. Please try again' ) );
    179187            $error = true;
    180188        } else if ( empty( $admin_email ) ) {
     
    206214        <th><?php _e( 'Password' ); ?></th>
    207215        <td><?php
    208         if ( ! empty( $password ) )
     216        if ( ! empty( $password ) && empty($admin_password_check) )
    209217            echo '<code>'. esc_html($password) .'</code><br />';
    210218        echo "<p>$password_message</p>"; ?>
Note: See TracChangeset for help on using the changeset viewer.