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
This commit is contained in:
ryan 2009-05-13 22:35:17 +00:00
parent c383ff7450
commit 8457db3774
2 changed files with 7 additions and 2 deletions

View File

@ -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 '</p></div>';
}
?>
?>

View File

@ -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']);
?>
<table class="form-table">
<tr class="form-field form-required">
@ -117,6 +118,10 @@ foreach ( array('user_login' => 'login', 'first_name' => 'firstname', 'last_name
<br />
<input name="pass2" type="password" id="pass2" autocomplete="off"/></td>
</tr>
<tr>
<th scope="row"><label for="send_password"><?php _e('Send Password?') ?></label></th>
<td><label for="send_password"><input type="checkbox" name="send_password" id="send_password" <?php checked($new_user_send_password, true); ?> /> <?php _e('Send this password to the new user by email.'); ?></label></td>
</tr>
<?php endif; ?>
<tr class="form-field">