Originally I had the path issue where the URL to reset the password was incorrect, which I've fix but now the issue is that password reset form has two fields, password and password confirm but when saving an error occurs saying, "Your current password is missing or incorrect; it's required to change the ."

It expects a third field where I to enter my existing password! which seem illogical for a password reset process, I I knew the password why would I be doing a password reset.

Any ideas on how to resolve this?

Comments

chaloum’s picture

the problem is that the form element, current_pass_required_values is hidden but active and when using the password reset the index pass ($protected_values['pass']) isn't defined.

So to fix the problem here is my solution change the code around line 28 in the password_policy_password_tab.pages.inc, from this

$protected_values = array();
$current_pass_description = '';
// The user may only change their own password without their current
// password if they logged in via a one-time login link.
if (!$pass_reset) {
$protected_values['mail'] = t('E-mail address');
$protected_values['pass'] = t('Password');
$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));
} //remove this line
// The user must enter their current password to change to a new one.
$form['current_pass_required_values'] = array(
'#type' => 'value',
'#value' => array('pass' => $protected_values['pass']),
);
}

to

$protected_values = array();
$current_pass_description = '';
// The user may only change their own password without their current
// password if they logged in via a one-time login link.
if (!$pass_reset) {
$protected_values['mail'] = t('E-mail address');
$protected_values['pass'] = t('Password');
$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.
$form['current_pass_required_values'] = array(
'#type' => 'value',
'#value' => array('pass' => $protected_values['pass']),
);
} //and move it to here.

the idea is to move the current password form element in to the password reset test ( if (!$pass_reset) ) so it doesn't get rendered in the form if the process is a password reset. but does display if $pass_reset is empty

erikwebb’s picture