Make WordPress Core

Changeset 6385 for trunk/wp-login.php


Ignore:
Timestamp:
12/15/2007 05:31:16 AM (17 years ago)
Author:
ryan
Message:

Pluggable random password generator from pishmishy. fixes #5401

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-login.php

    r6364 r6385  
    111111                do_action('retrieve_password', $user_login);
    112112
    113                 // Generate something random for a password... md5'ing current time with a rand salt
     113                // Generate something random for a key...
    114114                $key = substr( md5( uniqid( microtime() ) ), 0, 8);
    115                 // Now insert the new pass md5'd into the db
     115                // Now insert the new md5 key into the db
    116116                $wpdb->query("UPDATE $wpdb->users SET user_activation_key = '$key' WHERE user_login = '$user_login'");
    117117                $message = __('Someone has asked to reset the password for the following site and username.') . "\r\n\r\n";
     
    183183    do_action('password_reset');
    184184
    185     // Generate something random for a password... md5'ing current time with a rand salt
    186     $new_pass = substr( md5( uniqid( microtime() ) ), 0, 7);
     185    // Generate something random for a password...
     186    $new_pass = wp_generate_password();
    187187    $new_hash = wp_hash_password($new_pass);
    188188    $wpdb->query("UPDATE $wpdb->users SET user_pass = '$new_hash', user_activation_key = '' WHERE ID = '$user->ID'");
     
    242242
    243243        if ( empty( $errors ) ) {
    244             $user_pass = substr( md5( uniqid( microtime() ) ), 0, 7);
     244            $user_pass = wp_generate_password();
    245245
    246246            $user_id = wp_create_user( $user_login, $user_pass, $user_email );
Note: See TracChangeset for help on using the changeset viewer.