WordPress.org

Make WordPress Core

Changeset 13592


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

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

Location:
trunk/wp-admin
Files:
4 edited

Legend:

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

    r13517 r13592  
    1 html{background:#f9f9f9;}body{background:#fff;color:#333;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;margin:2em auto;width:700px;padding:1em 2em;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;border:1px solid #dfdfdf;}a{color:#2583ad;text-decoration:none;}a:hover{color:#d54e21;}h1{border-bottom:1px solid #dadada;clear:both;color:#666;font:24px Georgia,"Times New Roman",Times,serif;margin:5px 0 0 -4px;padding:0;padding-bottom:7px;}h2{font-size:16px;}p,li,dd,dt{padding-bottom:2px;font-size:12px;line-height:18px;}code{font-size:13px;}ul,ol,dl{padding:5px 5px 5px 22px;}a img{border:0;}abbr{border:0;font-variant:normal;}#logo{margin:6px 0 14px 0;border-bottom:none;text-align:center;}.step{margin:20px 0 15px;}.step,th{text-align:left;padding:0;}.submit input,.button,.button-secondary{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;text-decoration:none;font-size:14px!important;line-height:16px;padding:6px 12px;cursor:pointer;border:1px solid #bbb;color:#464646;-moz-border-radius:15px;-khtml-border-radius:15px;-webkit-border-radius:15px;border-radius:15px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-khtml-box-sizing:content-box;box-sizing:content-box;}.button:hover,.button-secondary:hover,.submit input:hover{color:#000;border-color:#666;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}.form-table{border-collapse:collapse;margin-top:1em;width:100%;}.form-table td{margin-bottom:9px;padding:10px;border-bottom:8px solid #fff;font-size:12px;}.form-table th{font-size:13px;text-align:left;padding:16px 10px 10px 10px;border-bottom:8px solid #fff;width:110px;vertical-align:top;}.form-table tr{background:#f3f3f3;}.form-table code{line-height:18px;font-size:18px;}.form-table p{margin:4px 0 0 0;font-size:11px;}.form-table input{line-height:20px;font-size:15px;padding:2px;}#error-page{margin-top:50px;}#error-page p{font-size:12px;line-height:18px;margin:25px 0 20px;}#error-page code{font-family:Consolas,Monaco,Courier,monospace;}#pass-strength-result{background-color:#eee;border-color:#ddd!important;border-style:solid;border-width:1px;float:left;margin:12px 5px 5px 1px;padding:5px;text-align:center;width:200px;}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important;}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;}
     1html{background:#f9f9f9;}body{background:#fff;color:#333;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;margin:2em auto;width:700px;padding:1em 2em;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;border:1px solid #dfdfdf;}a{color:#2583ad;text-decoration:none;}a:hover{color:#d54e21;}h1{border-bottom:1px solid #dadada;clear:both;color:#666;font:24px Georgia,"Times New Roman",Times,serif;margin:5px 0 0 -4px;padding:0;padding-bottom:7px;}h2{font-size:16px;}p,li,dd,dt{padding-bottom:2px;font-size:12px;line-height:18px;}code{font-size:13px;}ul,ol,dl{padding:5px 5px 5px 22px;}a img{border:0;}abbr{border:0;font-variant:normal;}#logo{margin:6px 0 14px 0;border-bottom:none;text-align:center;}.step{margin:20px 0 15px;}.step,th{text-align:left;padding:0;}.submit input,.button,.button-secondary{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;text-decoration:none;font-size:14px!important;line-height:16px;padding:6px 12px;cursor:pointer;border:1px solid #bbb;color:#464646;-moz-border-radius:15px;-khtml-border-radius:15px;-webkit-border-radius:15px;border-radius:15px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-khtml-box-sizing:content-box;box-sizing:content-box;}.button:hover,.button-secondary:hover,.submit input:hover{color:#000;border-color:#666;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}.form-table{border-collapse:collapse;margin-top:1em;width:100%;}.form-table td{margin-bottom:9px;padding:10px;border-bottom:8px solid #fff;font-size:12px;}.form-table th{font-size:13px;text-align:left;padding:16px 10px 10px 10px;border-bottom:8px solid #fff;width:130px;vertical-align:top;}.form-table tr{background:#f3f3f3;}.form-table code{line-height:18px;font-size:18px;}.form-table p{margin:4px 0 0 0;font-size:11px;}.form-table input{line-height:20px;font-size:15px;padding:2px;}#error-page{margin-top:50px;}#error-page p{font-size:12px;line-height:18px;margin:25px 0 20px;}#error-page code{font-family:Consolas,Monaco,Courier,monospace;}#pass-strength-result{background-color:#eee;border-color:#ddd!important;border-style:solid;border-width:1px;float:left;margin:12px 5px 5px 1px;padding:5px;text-align:center;width:200px;}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important;}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;}
  • trunk/wp-admin/css/install.dev.css

    r13517 r13592  
    112112    padding: 16px 10px 10px 10px;
    113113    border-bottom: 8px solid #fff;
    114     width: 110px;
     114    width: 130px;
    115115    vertical-align: top;
    116116}
  • trunk/wp-admin/includes/upgrade.php

    r13329 r13592  
    6363    $user_id = username_exists($user_name);
    6464    $user_password = trim($user_password);
     65    $email_password = false;
    6566    if ( !$user_id && empty($user_password) ) {
    6667        $user_password = wp_generate_password();
     
    6869        $user_id = wp_create_user($user_name, $user_password, $user_email);
    6970        update_user_option($user_id, 'default_password_nag', true);
     71        $email_password = true;
    7072    } else if ( !$user_id ) {
    71         $message = __('<strong><em>Note that password</em></strong> carefully!');
     73        // Password has been provided
     74        $message = __('<em>Your chosen password.</em>');
    7275        $user_id = wp_create_user($user_name, $user_password, $user_email);
    7376    } else {
    74         $message =  __('User already exists.  Password inherited.');
     77        $message =  __('User already exists. Password inherited.');
    7578    }
    7679
     
    8285    $wp_rewrite->flush_rules();
    8386
    84     wp_new_blog_notification($blog_title, $guessurl, $user_id, $user_password);
     87    wp_new_blog_notification($blog_title, $guessurl, $user_id, ($email_password ? $user_password : __('The password you chose during the install.') ) );
    8588
    8689    wp_cache_flush();
  • 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.