Forget Password link triggers login rule, login rule confuses user by taking them to the wrong screen

deverman - June 3, 2009 - 08:30
Project:Rules
Version:6.x-1.x-dev
Component:Rules Engine
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

I have a series of login rules for the first few times a user logs in. I check which roles they have and assign them a new role to keep track of where they are int he process and send them to a pathroute to ask for some information. This part fails if they use the forgot password screen because they should be sent to the account edit screen instead of through my sequence. I haven't found a way to check for this special case in rules does anyone have a suggestion?

#1

joostvdl - June 16, 2009 - 15:34

Subscribe

#2

opensanta - July 20, 2009 - 23:22
Version:6.x-1.0-rc2» 6.x-1.x-dev

Perhaps we could add an event to an event when "user" requests new password. Since they wouldn't be logged in when this happens, it would have to be based on the submitted user name. This way, you could add the user to another role that tracks their status in your registration workflow.

Would this do the trick?

#3

deverman - July 21, 2009 - 07:50

This can probably work I can assign another role to the user and then check if that role exists before doing a redirect on login. It should also apply to the users email because I use loggin toboggan and require users to login with email addresses instead of user names.

#4

capellic - October 1, 2009 - 13:29

I am having the same issue.

My website requires users to be approved. When the user clicks on the one-time login link and is asked to change their password, they are giving a message at the top of the content body to go fill out their profile (per my rule which is triggered on login).

Another solution for me would be to show the message on a particular page but only once a day -- not every time the user visits the page.

#5

BlackD - October 20, 2009 - 10:55

I had the same issue, and searched for an answer for a while (even trying other modules for redirecting on logon). Finally I found this solution that works for Rules.
What you do is add a condition for your redirect rule, with the following php-evaluation:

if (arg(0) == 'user' && arg(1) == 'reset') {
return false;
} else {
return true;
}

This checks if the user is using a one-time password, if that is the case the redirect rule is not triggered.
Hope this helps!

#6

capellic - October 20, 2009 - 17:12

Brilliant! Thanks for the tip!

#7

deverman - October 22, 2009 - 14:14

Great thank you so much!

 
 

Drupal is a registered trademark of Dries Buytaert.