From 69333a5b1b79b5785f13ef3783091fd50a5b6d04 Mon Sep 17 00:00:00 2001 From: westi Date: Thu, 14 May 2009 06:54:33 +0000 Subject: [PATCH] Give better instructions when installing over an existing users table. Fixes #9569 based on patch from coffee2code. git-svn-id: http://svn.automattic.com/wordpress/trunk@11326 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/upgrade.php | 10 ++++++---- wp-admin/install.php | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 331e23415..a4d5abaec 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -20,7 +20,7 @@ require_once(ABSPATH . 'wp-admin/includes/schema.php'); if ( !function_exists('wp_install') ) : /** - * {@internal Missing Short Description}} + * Installs the blog * * {@internal Missing Long Description}} * @@ -31,7 +31,7 @@ if ( !function_exists('wp_install') ) : * @param string $user_email User's email. * @param bool $public Whether blog is public. * @param null $deprecated Optional. Not used. - * @return array Array keys 'url', 'user_id', 'password'. + * @return array Array keys 'url', 'user_id', 'password', 'password_message'. */ function wp_install($blog_title, $user_name, $user_email, $public, $deprecated='') { global $wp_rewrite; @@ -59,10 +59,12 @@ function wp_install($blog_title, $user_name, $user_email, $public, $deprecated=' $user_id = username_exists($user_name); if ( !$user_id ) { $random_password = wp_generate_password(); + $message = __('Note that password carefully! It is a random password that was generated just for you.'); $user_id = wp_create_user($user_name, $random_password, $user_email); update_usermeta($user_id, 'default_password_nag', true); } else { - $random_password = __('User already exists. Password inherited.'); + $random_password = ''; + $message = __('User already exists. Password inherited.'); } $user = new WP_User($user_id); @@ -76,7 +78,7 @@ function wp_install($blog_title, $user_name, $user_email, $public, $deprecated=' wp_cache_flush(); - return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $random_password); + return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $random_password, 'password_message' => $message); } endif; diff --git a/wp-admin/install.php b/wp-admin/install.php index 38a27bc46..cdbaab408 100644 --- a/wp-admin/install.php +++ b/wp-admin/install.php @@ -136,8 +136,10 @@ switch($step) { -
- '.__('Note that password carefully! It is a random password that was generated just for you.').'

'; ?> + '. $password .'
'; + } + echo '

'. $password_message .'

'; ?>