$request_new=l(t('Request new password'),'user/password',array('attributes'=>array('title'=>t('Request new password via e-mail.'))));
$current_pass_description=t('Enter your current password to change the %mail or %pass. !request_new.',array('%mail'=>$protected_values['mail'],'%pass'=>$protected_values['pass'],'!request_new'=>$request_new));
}
// The user must enter their current password to change to a new one.
'#markup'=>t('Password reset instructions will be mailed to %email. You must log out to use the password reset link in the e-mail.',array('%email'=>$user->mail)),
'#suffix'=>'</p>',
);
}
$form['submit']=array('#type'=>'submit','#value'=>t('E-mail new password'));
// user, which invalidates further use of the one-time login link.
user_login_finalize();
drupal_set_message(t('You have just used your one-time login link. It is no longer necessary to use this link to log in. Please change your password.'));
drupal_goto('user/'.$user->uid.'/edit');
// Let the user's password be changed without the current password check.
$form['message']=array('#markup'=>t('<p>This is a one-time login for %user_name and will expire on %expiration_date.</p><p>Click on this button to log in to the site and change your password.</p>',array('%user_name'=>$account->name,'%expiration_date'=>format_date($timestamp+$timeout))));
...
...
@@ -219,7 +234,6 @@ function template_preprocess_user_profile_category(&$variables) {
* @ingroup forms
* @see user_account_form()
* @see user_account_form_validate()
* @see user_account_form_submit()
* @see user_profile_form_validate()
* @see user_profile_form_submit()
* @see user_cancel_confirm_form_submit()
...
...
@@ -283,6 +297,10 @@ function user_profile_form_submit($form, &$form_state) {
user_save($account,$edit,$category);
$form_state['values']['uid']=$account->uid;
if($category=='account'&&!empty($edit['pass'])){
// Remove the password reset tag since a new password was saved.
unset($_SESSION['pass_reset_'.$account->uid]);
}
// Clear the page cache because pages can contain usernames and/or profile information: