From 3f691174e249d316ae2f546b05ae8a0aa7effaa5 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sat, 20 Aug 2005 01:43:43 +0000 Subject: [PATCH] Set nickname during install. Props skippy and markjaquith. fixes #1568 git-svn-id: https://develop.svn.wordpress.org/trunk@2794 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/install.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-admin/install.php b/wp-admin/install.php index dab1d77dc8..f2cfb17bd0 100644 --- a/wp-admin/install.php +++ b/wp-admin/install.php @@ -171,7 +171,9 @@ $wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, p // Set up admin user $random_password = substr(md5(uniqid(microtime())), 0, 6); -$wpdb->query("INSERT INTO $wpdb->users (ID, user_login, user_pass, user_email, user_registered) VALUES ( '1', 'admin', MD5('$random_password'), '$admin_email', NOW() )"); +$display_name_array = explode('@', $admin_email); +$display_name = $display_name_array[0]; +$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', '$display_name')"); $wpdb->query("INSERT INTO $wpdb->usermeta (user_id, meta_key, meta_value) VALUES ({$wpdb->insert_id}, '{$table_prefix}user_level', '10');"); $admin_caps = serialize(array('administrator' => true)); $wpdb->query("INSERT INTO $wpdb->usermeta (user_id, meta_key, meta_value) VALUES ({$wpdb->insert_id}, '{$table_prefix}capabilities', '{$admin_caps}');");