I want to create a rule:
When the user changes the new password, the system should force the user to log out and then use his new password to login.
I know the event to choose after updating an existing user account. The next part is to be added in the ELEMENTS PHP source code to detect it?
I have tried this code. It fails, the user can no longer change the new login password.
function mytheme_form_alter(&$form, &$form_state, $form_id) {
if ($form_id =='user_pass'){
$form['#submit'][] = 'mytheme_password_redirect';
}
}
/**
* Redirects user after password reset form is filled
*/
function mytheme_password_redirect(&$form, &$form_state){
$form_state['redirect'] = 'user/lougout';
}