Generate Human Readable passwords as they are much more userfriendly. Fixes #13324 props Otto42.
git-svn-id: http://svn.automattic.com/wordpress/trunk@16284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9e30ccd803
commit
ae213c99ca
|
@ -64,7 +64,7 @@ function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated
|
|||
$user_password = trim($user_password);
|
||||
$email_password = false;
|
||||
if ( !$user_id && empty($user_password) ) {
|
||||
$user_password = wp_generate_password();
|
||||
$user_password = wp_generate_password( 12, false );
|
||||
$message = __('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.');
|
||||
$user_id = wp_create_user($user_name, $user_password, $user_email);
|
||||
update_user_option($user_id, 'default_password_nag', true, true);
|
||||
|
|
|
@ -57,7 +57,7 @@ if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) {
|
|||
$password = 'N/A';
|
||||
$user_id = email_exists($email);
|
||||
if ( !$user_id ) { // Create a new user with a random password
|
||||
$password = wp_generate_password();
|
||||
$password = wp_generate_password( 12, false );
|
||||
$user_id = wpmu_create_user( $domain, $password, $email );
|
||||
if ( false == $user_id )
|
||||
wp_die( __( 'There was an error creating the user.' ) );
|
||||
|
|
|
@ -31,7 +31,7 @@ if ( isset($_REQUEST['action']) && 'add-user' == $_REQUEST['action'] ) {
|
|||
elseif ( empty($user['email']) )
|
||||
wp_die( __( 'Missing email.' ) );
|
||||
|
||||
$password = wp_generate_password();
|
||||
$password = wp_generate_password( 12, false);
|
||||
$user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );
|
||||
|
||||
if ( false == $user_id )
|
||||
|
|
|
@ -779,7 +779,7 @@ function wpmu_activate_signup($key) {
|
|||
$meta = unserialize($signup->meta);
|
||||
$user_login = $wpdb->escape($signup->user_login);
|
||||
$user_email = $wpdb->escape($signup->user_email);
|
||||
$password = wp_generate_password();
|
||||
$password = wp_generate_password( 12, false );
|
||||
|
||||
$user_id = username_exists($user_login);
|
||||
|
||||
|
|
|
@ -320,7 +320,7 @@ function register_new_user( $user_login, $user_email ) {
|
|||
if ( $errors->get_error_code() )
|
||||
return $errors;
|
||||
|
||||
$user_pass = wp_generate_password();
|
||||
$user_pass = wp_generate_password( 12, false);
|
||||
$user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
|
||||
if ( ! $user_id ) {
|
||||
$errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn’t register you... please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) );
|
||||
|
|
Loading…
Reference in New Issue