Ticket #2910: install.php.2.diff
| File install.php.2.diff, 3.2 KB (added by darkfate, 7 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> 107 111 <th><?php _e('Your e-mail:'); ?></th> 108 112 <td><input name="admin_email" type="text" id="admin_email" size="25" /></td> 109 113 </tr> … … 120 124 121 125 // Fill in the data we gathered 122 126 $weblog_title = stripslashes($_POST['weblog_title']); 127 $admin_username = stripslashes($_POST['admin_username']); 123 128 $admin_email = stripslashes($_POST['admin_email']); 124 129 // check e-mail address 130 if (empty($admin_username)) { 131 die (__("<strong>ERROR</strong>: please type your username"));} 125 132 if (empty($admin_email)) { 126 133 die (__("<strong>ERROR</strong>: please type your e-mail address")); 127 134 } else if (!is_email($admin_email)) { … … 177 184 $random_password = substr(md5(uniqid(microtime())), 0, 6); 178 185 $display_name_array = explode('@', $admin_email); 179 186 $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')");187 $wpdb->query("INSERT INTO $wpdb->users (ID, user_login, user_pass, user_email, user_registered, display_name, user_nicename) VALUES ( '1', '$admin_username', MD5('$random_password'), '$admin_email', NOW(), '$display_name', '$admin_username')"); 181 188 $wpdb->query("INSERT INTO $wpdb->usermeta (user_id, meta_key, meta_value) VALUES ({$wpdb->insert_id}, '{$table_prefix}user_level', '10');"); 182 189 $admin_caps = serialize(array('administrator' => true)); 183 190 $wpdb->query("INSERT INTO $wpdb->usermeta (user_id, meta_key, meta_value) VALUES ({$wpdb->insert_id}, '{$table_prefix}capabilities', '{$admin_caps}');"); … … 189 196 190 197 You can log in to the administrator account with the following information: 191 198 192 Username: admin199 Username: $admin_username 193 200 Password: %2\$s 194 201 195 202 We hope you enjoy your new weblog. Thanks! … … 205 212 206 213 <p><em><?php _e('Finished!'); ?></em></p> 207 214 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>215 <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', $random_password); ?></p> 209 216 <p><?php _e('<strong><em>Note that password</em></strong> carefully! It 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:'); ?> 210 217 </p> 211 218 <dl> 212 219 <dt><?php _e('Username'); ?></dt> 213 <dd><code> admin</code></dd>220 <dd><code><?php echo $admin_username; ?></code></dd> 214 221 <dt><?php _e('Password'); ?></dt> 215 222 <dd><code><?php echo $random_password; ?></code></dd> 216 223 <dt><?php _e('Login address'); ?></dt>