Generates a unique URL for a user to login and reset their password.
object $account: An object containing the user account, which must contain at least the following properties:
array $options: (optional) A keyed array of settings. Supported options are:
A unique URL that provides a one-time log in for the user, from which they can change their password.
function user_pass_reset_url($account, $options = array()) {
$timestamp = REQUEST_TIME;
$langcode = isset($options['langcode']) ? $options['langcode'] : user_preferred_langcode($account);
$url_options = array(
'absolute' => TRUE,
'language' => language_load($langcode),
);
return url("user/reset/{$account->uid}/{$timestamp}/" . user_pass_rehash($account->pass, $timestamp, $account->login), $url_options);
}