the one-time-login URL versus my redirect-after-login dilemma. Please help

Events happening in the community are now at Drupal community events on www.drupal.org.
timebinder's picture

Hi,

I had a user run into this the other day: normally, when a user logs in, I redirect them to a landing page with relevant items on it. Works fine unless the user forgets their password, at which time they get the link to log in one time then ...

they are redirected to the landing page I have a rule for.

It seems as though I have to add a condition, though my attempts so far have failed. What is the right way to create a rule that says "anytime someone logs in from the one-time-login page, don't redirect them to the landing page...let them pass to the change password page"??

Any help would be very appreciated.

Comments

Qualification to above

timebinder's picture

Sorry, the rule that says:

"anytime someone logs in, redirect them to the landing page EXCEPT if they are coming from the one-time-login page"

Have you tried the Login

wipeout_dude's picture

Have you tried the Login Destination (http://drupal.org/project/login_destination) module? Makes this type of thing very easy to do..

Use PHP condition

bluetegu's picture

Hi,

Add PHP condition (you might need to enable the php core module) and add something along (drupal 7):

// redirect to landing page unless ...
return !(@$_REQUEST['form_id'] == 'user_pass_reset');

Hope it helps
Best,
Ron

How about the first-time login page?

HJulien's picture

I need to create a rule to distinguish multiple ways of logging in:

  1. After registration and validation the user goes to an internal dashboard page.
  2. First-time login (2 ways of doing it: link in email and copy & paste into login block on homepage) and reset needs to go to the user edit page to reset password.

    The form_id for user_pass_reset is one that I can use and I thank you for that.

I need to be able to identify the other cases. How do I find the form_id for:

  1. When the user clicks on the link in the first time login email?
  2. When the user copies and pastes the temporary password into the login block on the homepage?
  3. maybe have regular login in as the last 'else' in the php code and re-direct to the internal page?

Thanks

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: