How do i alter user_pass_submit
lasac - September 25, 2009 - 22:47
How do i alter this
<?php
function user_pass_submit($form, &$form_state) {
global $language;
$account = $form_state['values']['account'];
// Mail one time login URL and instructions using current language.
_user_mail_notify('password_reset', $account, $language);
watchdog('user', 'Password reset instructions mailed to %name at %email.', array('%name' => $account->name, '%email' => $account->mail));
drupal_set_message(t('Further instructions have been sent to your e-mail address.'));
$form_state['redirect'] = 'user';
return;
}
?>The
$form_state['redirect'] = 'user';needs to redirect to a other path, i created my own password request template but it keeps redirecting to /user after submiting. So i need to change the form_state but i just can't figure out how...

I presume you are trying to
I presume you are trying to do this with a custom module?
Perhaps try something like this:
<?php
mymodule_form_user_pass_alter(&$form, &$form_state) {
$form['#submit'][] = 'mymodule_pass_submit';
}
mymodule_pass_submit($form, &$form_state) {
$form_state['redirect'] = 'other-path';
}
?>
i would want to alter it
i would want to alter it trough template.php. I am not makeing a custom module.
I don't think there's an
I don't think there's an intelligent way to do it through the theming layer. This really is something for a module to do.
dude your briljant! That
dude your briljant! That completely did the trick. I made it into a module and now it works. If i could i would send kudos to you.
bump
bump... above did not do the trick.