Ticket #2870: install.php.diff
File install.php.diff, 4.0 KB (added by , 19 years ago) |
---|
-
install.php
104 104 <td><input name="weblog_title" type="text" id="weblog_title" size="25" /></td> 105 105 </tr> 106 106 <tr> 107 <th><?php _e('Your username:'); ?></th> 108 <td><input name="admin_username" type="text" id="admin_username" size="25" /></td> 109 </tr> 110 <tr> 111 <th><?php _e('Your password:'); ?></th> 112 <td><input name="admin_password" type="password" id="admin_password" size="25" /></td> 113 </tr> 114 <tr> 107 115 <th><?php _e('Your e-mail:'); ?></th> 108 116 <td><input name="admin_email" type="text" id="admin_email" size="25" /></td> 109 117 </tr> … … 120 128 121 129 // Fill in the data we gathered 122 130 $weblog_title = stripslashes($_POST['weblog_title']); 131 $admin_username = stripslashes($_POST['admin_username']); 132 $admin_password = stripslashes($_POST['admin_password']); 123 133 $admin_email = stripslashes($_POST['admin_email']); 124 134 // check e-mail address 135 if (empty($admin_username)) { 136 die (__("<strong>ERROR</strong>: please type a username"));} 137 if (empty($admin_password)) { 138 die (__("<strong>ERROR</strong>: please type a password"));} 125 139 if (empty($admin_email)) { 126 140 die (__("<strong>ERROR</strong>: please type your e-mail address")); 127 141 } else if (!is_email($admin_email)) { … … 174 188 $wp_rewrite->flush_rules(); 175 189 176 190 // Set up admin user 177 $random_password = substr(md5(uniqid(microtime())), 0, 6);178 191 $display_name_array = explode('@', $admin_email); 179 192 $display_name = $display_name_array[0]; 180 $wpdb->query("INSERT INTO $wpdb->users (ID, user_login, user_pass, user_email, user_registered, display_name, user_nicename) VALUES ( '1', ' admin', MD5('$random_password'), '$admin_email', NOW(), '$display_name', 'admin')");193 $wpdb->query("INSERT INTO $wpdb->users (ID, user_login, user_pass, user_email, user_registered, display_name, user_nicename) VALUES ( '1', '$admin_username', MD5('$admin_password'), '$admin_email', NOW(), '$display_name', '$admin_username')"); 181 194 $wpdb->query("INSERT INTO $wpdb->usermeta (user_id, meta_key, meta_value) VALUES ({$wpdb->insert_id}, '{$table_prefix}user_level', '10');"); 182 195 $admin_caps = serialize(array('administrator' => true)); 183 196 $wpdb->query("INSERT INTO $wpdb->usermeta (user_id, meta_key, meta_value) VALUES ({$wpdb->insert_id}, '{$table_prefix}capabilities', '{$admin_caps}');"); … … 189 202 190 203 You can log in to the administrator account with the following information: 191 204 192 Username: admin193 Password: %2\$s205 Username: $admin_username 206 Password: $admin_password 194 207 195 208 We hope you enjoy your new weblog. Thanks! 196 209 197 210 --The WordPress Team 198 211 http://wordpress.org/ 199 "), $guessurl, $ random_password);212 "), $guessurl, $admin_password); 200 213 201 214 @wp_mail($admin_email, __('New WordPress Blog'), $message, $message_headers); 202 215 … … 205 218 206 219 <p><em><?php _e('Finished!'); ?></em></p> 207 220 208 <p><?php printf(__('Now you can <a href="%1$s">log in</a> with the <strong>username</strong> "<code> admin</code>" and <strong>password</strong> "<code>%2$s</code>".'), '../wp-login.php', $random_password); ?></p>209 <p><?php _e('<strong><em>Note that password</em></strong> carefully! I t is a <em>random</em> password that was generated just for you. If you lose it, you will have to delete the tables from the database yourself, and re-install WordPress. So to review:'); ?>221 <p><?php printf(__('Now you can <a href="%1$s">log in</a> with the <strong>username</strong> "<code>'.$admin_username.'</code>" and <strong>password</strong> "<code>%2$s</code>".'), '../wp-login.php', $admin_password); ?></p> 222 <p><?php _e('<strong><em>Note that password</em></strong> carefully! If you lose it, you will have to delete the tables from the database yourself, and re-install WordPress. So to review:'); ?> 210 223 </p> 211 224 <dl> 212 225 <dt><?php _e('Username'); ?></dt> 213 <dd><code> admin</code></dd>226 <dd><code><?php echo $admin_username; ?></code></dd> 214 227 <dt><?php _e('Password'); ?></dt> 215 <dd><code><?php echo $ random_password; ?></code></dd>228 <dd><code><?php echo $admin_password; ?></code></dd> 216 229 <dt><?php _e('Login address'); ?></dt> 217 230 <dd><a href="../wp-login.php">wp-login.php</a></dd> 218 231 </dl>