WordPress.org

Make WordPress Core

Ticket #10396: 10396_fix_a.diff

File 10396_fix_a.diff, 3.8 KB (added by dancole, 12 years ago)

Corrects mistakes in trunk

  • wp-admin/includes/upgrade.php

     
    6868                $user_id = wp_create_user($user_name, $user_password, $user_email);
    6969                update_user_option($user_id, 'default_password_nag', true);
    7070        } else if ( !$user_id ) {
    71                 $message = __('<strong><em>Note that password</em></strong> carefully!');
     71                $message = '';
    7272                $user_id = wp_create_user($user_name, $user_password, $user_email);
    7373        } else {
    7474                $message =  __('User already exists.  Password inherited.');
  • wp-admin/install.php

     
    9494                <tr>
    9595                        <th scope="row"><label for="admin_password"><?php _e('Password'); ?></label></th>
    9696                        <td>
    97                                 <input name="admin_password" type="password" id="pass1" size="25" value="<?php  echo esc_attr( $admin_password ); ?>" />
     97                                <input name="admin_password1" type="password" id="pass1" size="25" value="<?php  echo esc_attr( $admin_password ); ?>" />
    9898                                <br /><?php _e('A password will be automatically generated for you if you leave this field blank.'); ?>
     99                                <input name="admin_password2" type="password" id="pass2" size="25" value="<?php  echo esc_attr( $admin_password ); ?>" />
     100                                <br /><?php _e('Type your password again.'); ?>
    99101                                <br /><div id="pass-strength-result"><?php _e('Strength indicator'); ?></div>
    100102                                <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>
    101103                        </td>
     
    159161                display_header();
    160162                // Fill in the data we gathered
    161163                $weblog_title = isset( $_POST['weblog_title'] ) ? trim( stripslashes( $_POST['weblog_title'] ) ) : '';
    162                 $user_name = isset($_POST['user_name']) ? trim( stripslashes( $_POST['user_name'] ) ) : 'admin';
    163                 $admin_password = isset($_POST['admin_password']) ? trim( stripslashes( $_POST['admin_password'] ) ) : '';
     164                $user_name = isset( $_POST['user_name'] ) ? trim( stripslashes( $_POST['user_name'] ) ) : 'admin';
     165                $admin_password1 = isset( $_POST['admin_password1'] ) ? trim( stripslashes( $_POST['admin_password1'] ) ) : '';
     166                $admin_password2 = isset( $_POST['admin_password2'] ) ? trim( stripslashes( $_POST['admin_password2'] ) ) : '';
    164167                $admin_email  = isset( $_POST['admin_email']  ) ?trim( stripslashes( $_POST['admin_email'] ) ) : '';
    165168                $public       = isset( $_POST['blog_public']  ) ? (int) $_POST['blog_public'] : 0;
    166169                // check e-mail address
     
    169172                        // TODO: poka-yoke
    170173                        display_setup_form( __('you must provide a valid user name.') );
    171174                        $error = true;
     175                } else if ( $admin_password1 != $admin_password2) {
     176                        // TODO: poka-yoke
     177                        display_setup_form( __( 'Please enter the same password into the two password fields.' ) );
     178                        $error = true;
    172179                } else if ( empty( $admin_email ) ) {
    173180                        // TODO: poka-yoke
    174181                        display_setup_form( __( 'you must provide an e-mail address.' ) );
     
    181188
    182189                if ( $error === false ) {
    183190                        $wpdb->show_errors();
    184                         $result = wp_install($weblog_title, $user_name, $admin_email, $public, '', $admin_password);
     191                        $result = wp_install($weblog_title, $user_name, $admin_email, $public, '', $admin_password1);
    185192                        extract( $result, EXTR_SKIP );
    186193?>
    187194
     
    189196
    190197<p><?php _e( 'WordPress has been installed. Were you expecting more steps? Sorry to disappoint.' ); ?></p>
    191198
     199<?php if ( empty($admin_password1) ): ?>
    192200<table class="form-table">
    193201        <tr>
    194202                <th><?php _e( 'Username' ); ?></th>
     
    203211                </td>
    204212        </tr>
    205213</table>
     214<?php endif; ?>
    206215
    207216<p class="step"><a href="../wp-login.php" class="button"><?php _e( 'Log In' ); ?></a></p>
    208217