From 8457db37743552153bfce2c91e9d325f8118c9b1 Mon Sep 17 00:00:00 2001
From: ryan
Date: Wed, 13 May 2009 22:35:17 +0000
Subject: [PATCH] Add option to send password to users created from admin.
Props Denis-de-Bernardy. fixes #9669
git-svn-id: http://svn.automattic.com/wordpress/trunk@11319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
---
wp-admin/includes/user.php | 4 ++--
wp-admin/user-new.php | 5 +++++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php
index 0bce403029..d39c254729 100644
--- a/wp-admin/includes/user.php
+++ b/wp-admin/includes/user.php
@@ -183,7 +183,7 @@ function edit_user( $user_id = 0 ) {
$user_id = wp_update_user( get_object_vars( $user ));
} else {
$user_id = wp_insert_user( get_object_vars( $user ));
- wp_new_user_notification( $user_id );
+ wp_new_user_notification( $user_id, isset($_POST['send_password']) ? $pass1 : '' );
}
return $user_id;
}
@@ -830,4 +830,4 @@ function default_password_nag() {
echo '
';
}
-?>
+?>
\ No newline at end of file
diff --git a/wp-admin/user-new.php b/wp-admin/user-new.php
index 8eb940e35a..bacb910772 100644
--- a/wp-admin/user-new.php
+++ b/wp-admin/user-new.php
@@ -87,6 +87,7 @@ foreach ( array('user_login' => 'login', 'first_name' => 'firstname', 'last_name
if ( ! isset($$var) )
$$var = isset($_POST[$post_field]) ? stripslashes($_POST[$post_field]) : '';
}
+$new_user_send_password = !$_POST || isset($_POST['send_password']);
?>