Changeset 13134
- Timestamp:
- 02/14/2010 03:07:47 AM (15 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/install.css
r11857 r13134 1 html{background:#f7f7f7;}body{background:#fff;color:#333;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;margin:2em auto 0 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{padding-bottom:2px;font-size:12px;line-height:18px;}code{font-size:13px;}ul,ol{padding:5px 5px 5px 22px;}#logo{margin:6px 0 14px 0;border-bottom:none;}.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;} 1 html{background:#f7f7f7;}body{background:#fff;color:#333;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;margin:2em auto 0 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{padding-bottom:2px;font-size:12px;line-height:18px;}code{font-size:13px;}ul,ol{padding:5px 5px 5px 22px;}#logo{margin:6px 0 14px 0;border-bottom:none;}.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;} -
trunk/wp-admin/css/install.dev.css
r11857 r13134 132 132 133 133 #error-page code { font-family: Consolas, Monaco, Courier, monospace; } 134 135 #pass-strength-result { 136 background-color: #eee; 137 border-color: #ddd !important; 138 border-style: solid; 139 border-width: 1px; 140 float: left; 141 margin: 12px 5px 5px 1px; 142 padding: 5px; 143 text-align: center; 144 width: 200px; 145 } 146 147 #pass-strength-result.bad { 148 background-color: #ffb78c; 149 border-color: #ff853c !important; 150 } 151 152 #pass-strength-result.good { 153 background-color: #ffec8b; 154 border-color: #ffcc00 !important; 155 } 156 157 #pass-strength-result.short { 158 background-color: #ffa0a0; 159 border-color: #f04040 !important; 160 } 161 162 #pass-strength-result.strong { 163 background-color: #c3ff88; 164 border-color: #8dff1c !important; 165 } -
trunk/wp-admin/includes/upgrade.php
r13067 r13134 32 32 * @param bool $public Whether blog is public. 33 33 * @param null $deprecated Optional. Not used. 34 * @param string $user_password Optional. User's chosen password. Will default to a random password. 34 35 * @return array Array keys 'url', 'user_id', 'password', 'password_message'. 35 36 */ 36 function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated = '' ) {37 function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated = '', $user_password = '' ) { 37 38 global $wp_rewrite; 38 39 … … 61 62 // being shared among blogs. Just set the role in that case. 62 63 $user_id = username_exists($user_name); 63 if ( !$user_id ) { 64 $random_password = wp_generate_password(); 64 $user_password = trim($user_password); 65 if ( !$user_id && empty($user_password) ) { 66 $user_password = wp_generate_password(); 65 67 $message = __('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.'); 66 $user_id = wp_create_user($user_name, $random_password, $user_email); 67 update_user_option($user_id, 'default_password_nag', true, true); 68 $user_id = wp_create_user($user_name, $user_password, $user_email); 69 update_user_option($user_id, 'default_password_nag', true); 70 } else if ( !$user_id ) { 71 $message = __('<strong><em>Note that password</em></strong> carefully!'); 72 $user_id = wp_create_user($user_name, $user_password, $user_email); 68 73 } else { 69 $random_password = '';70 74 $message = __('User already exists. Password inherited.'); 71 75 } … … 78 82 $wp_rewrite->flush_rules(); 79 83 80 wp_new_blog_notification($blog_title, $guessurl, $user_id, $ random_password);84 wp_new_blog_notification($blog_title, $guessurl, $user_id, $user_password); 81 85 82 86 wp_cache_flush(); 83 87 84 return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $ random_password, 'password_message' => $message);88 return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message); 85 89 } 86 90 endif; -
trunk/wp-admin/install.php
r13124 r13134 20 20 /** Load WordPress Administration Upgrade API */ 21 21 require_once( dirname( __FILE__ ) . '/includes/upgrade.php' ); 22 23 /** Load wpdb */ 24 require_once(dirname(dirname(__FILE__)) . '/wp-includes/wp-db.php'); 22 25 23 26 $step = isset( $_GET['step'] ) ? $_GET['step'] : 0; … … 54 57 */ 55 58 function display_setup_form( $error = null ) { 59 global $wpdb; 60 $user_table = ( $wpdb->get_var("SHOW TABLES LIKE '$wpdb->users'") != null ) ? true : false; 61 56 62 // Ensure that Blogs appear in search engines by default 57 63 $blog_public = 1; … … 59 65 $blog_public = isset( $_POST['blog_public'] ); 60 66 67 $weblog_title = isset( $_POST['weblog_title'] ) ? trim( stripslashes( $_POST['weblog_title'] ) ) : ''; 68 $user_name = isset($_POST['user_name']) ? trim( stripslashes( $_POST['user_name'] ) ) : 'admin'; 69 $admin_password = isset($_POST['admin_password']) ? trim( stripslashes( $_POST['admin_password'] ) ) : ''; 70 $admin_email = isset( $_POST['admin_email'] ) ? trim( stripslashes( $_POST['admin_email'] ) ) : ''; 71 61 72 if ( ! is_null( $error ) ) { 62 73 ?> … … 67 78 <tr> 68 79 <th scope="row"><label for="weblog_title"><?php _e( 'Blog Title' ); ?></label></th> 69 <td><input name="weblog_title" type="text" id="weblog_title" size="25" value="<?php echo ( isset( $_POST['weblog_title'] ) ? esc_attr( $_POST['weblog_title'] ) : '' ); ?>" /></td> 70 </tr> 80 <td><input name="weblog_title" type="text" id="weblog_title" size="25" value="<?php echo esc_attr( $weblog_title ); ?>" /></td> 81 </tr> 82 <tr> 83 <th scope="row"><label for="user_name"><?php _e('User Name'); ?></label></th> 84 <td> 85 <?php 86 if ( $user_table ) { 87 _e('User(s) already exists.'); 88 } else { 89 ?><input name="user_name" type="text" id="user_login" size="25" value="<?php echo esc_attr( $user_name ); ?>" /><?php 90 } ?> 91 </td> 92 </tr> 93 <?php if ( ! $user_table ) : ?> 94 <tr> 95 <th scope="row"><label for="admin_password"><?php _e('Password'); ?></label></th> 96 <td> 97 <input name="admin_password" type="password" id="pass1" size="25" value="<?php echo esc_attr( $admin_password ); ?>" /> 98 <br /><?php _e('A password will be automatically generated for you if you leave this field blank.'); ?> 99 <br /><div id="pass-strength-result"><?php _e('Strength indicator'); ?></div> 100 <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 ! " ? $ % ^ & ).'); ?></p> 101 </td> 102 </tr> 103 <?php endif; ?> 71 104 <tr> 72 105 <th scope="row"><label for="admin_email"><?php _e( 'Your E-mail' ); ?></label></th> 73 <td><input name="admin_email" type="text" id="admin_email" size="25" value="<?php echo ( isset( $_POST['admin_email'] ) ? esc_attr( $_POST['admin_email'] ) : ''); ?>" /><br />106 <td><input name="admin_email" type="text" id="admin_email" size="25" value="<?php echo esc_attr( $admin_email ); ?>" /><br /> 74 107 <?php _e( 'Double-check your email address before continuing.' ); ?></td> 75 108 </tr> … … 126 159 display_header(); 127 160 // Fill in the data we gathered 128 $weblog_title = isset( $_POST['weblog_title'] ) ? stripslashes( $_POST['weblog_title'] ) : ''; 129 $admin_email = isset( $_POST['admin_email'] ) ? stripslashes( $_POST['admin_email'] ) : ''; 161 $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 $admin_email = isset( $_POST['admin_email'] ) ?trim( stripslashes( $_POST['admin_email'] ) ) : ''; 130 165 $public = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : 0; 131 166 // check e-mail address 132 167 $error = false; 133 if ( empty( $admin_email ) ) { 168 if ( empty( $user_name ) ) { 169 // TODO: poka-yoke 170 display_setup_form( __('you must provide a valid user name.') ); 171 $error = true; 172 } else if ( empty( $admin_email ) ) { 134 173 // TODO: poka-yoke 135 174 display_setup_form( __( 'you must provide an e-mail address.' ) ); … … 143 182 if ( $error === false ) { 144 183 $wpdb->show_errors(); 145 $result = wp_install( $weblog_title, 'admin', $admin_email, $public);184 $result = wp_install($weblog_title, $user_name, $admin_email, $public, '', $admin_password); 146 185 extract( $result, EXTR_SKIP ); 147 186 ?> … … 154 193 <tr> 155 194 <th><?php _e( 'Username' ); ?></th> 156 <td><code> admin</code></td>195 <td><code><?php echo esc_html($user_name); ?></code></td> 157 196 </tr> 158 197 <tr> … … 160 199 <td><?php 161 200 if ( ! empty( $password ) ) 162 echo "<code>$password</code><br />";201 echo '<code>'. esc_html($password) .'</code><br />'; 163 202 echo "<p>$password_message</p>"; ?> 164 203 </td> … … 174 213 ?> 175 214 <script type="text/javascript">var t = document.getElementById('weblog_title'); if (t){ t.focus(); }</script> 215 <script type="text/javascript" src="../wp-includes/js/jquery/jquery.js"></script> 216 <script type="text/javascript" src="js/password-strength-meter.js"></script> 217 <script type="text/javascript" src="js/user-profile.js"></script> 218 <script type="text/javascript" src="js/utils.js"></script> 219 <script type='text/javascript'> 220 /* <![CDATA[ */ 221 try{convertEntities(commonL10n);}catch(e){}; 222 var pwsL10n = { 223 empty: "Strength indicator", 224 short: "Very weak", 225 bad: "Weak", 226 good: "Medium", 227 strong: "Strong" 228 }; 229 try{convertEntities(pwsL10n);}catch(e){}; 230 /* ]]> */ 231 </script> 176 232 </body> 177 233 </html>
Note: See TracChangeset
for help on using the changeset viewer.