diff --git a/wp-login.php b/wp-login.php index a912bb547..5ba6a368a 100644 --- a/wp-login.php +++ b/wp-login.php @@ -125,11 +125,16 @@ case 'resetpass' : // Generate something random for a password... md5'ing current time with a rand salt $key = $_GET['key']; + if ( empty($key) ) + die( __('Sorry, that key does not appear to be valid.') ); $user = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE user_activation_key = '$key'"); if ( !$user ) die( __('Sorry, that key does not appear to be valid.') ); do_action('password_reset'); +echo "doing password reset for : {$user->user_login}
"; +exit; + $new_pass = substr( md5( uniqid( microtime() ) ), 0, 7); $wpdb->query("UPDATE $wpdb->users SET user_pass = MD5('$new_pass'), user_activation_key = '' WHERE user_login = '$user->user_login'");