0

I have a use case where I need to adjust the landing of the route, user/login to direct to a custom developed user/register page once clicked. What's the quickest method of doing this without overloading the core User module with changes?

1
  • hook_init function in your custom module or you cantry rules module for custom redirect of the path. Jan 1, 2015 at 4:09

2 Answers 2

0

You can also use Login Destination module to redirect without touching any code

The Login Destination module allows you to customize the destination that a user is redirected to after logging in, registering to the site (7.x), using a one-time login link or logging out (7.x). The destination can be an internal page or an external URL. It is possible to specify certain conditions like referring pages or user roles and make the destination depend upon them. You may use PHP snippets to provide custom conditions and destinations. It is also possible to keep users on the currently visited page after logging in or out.

0

You could easily use Rules if you don't want to touch code

event: drupal initializes

condition: url: user/login and user/register

action: redirect to your url

Rules:

The Rules module allows site administrators to define conditionally executed actions based on occurring events (known as reactive or ECA rules). It's a replacement with more features for the trigger module in core and the successor of the Drupal 5 workflow-ng module.

2
  • Is it possible with Rules to define behavior based on login from specific sources? I have a ctools-based Multi-step registration and it appears that when I use Triggers to route logged in users to the new URL, it was affecting users who registered with multi-step. Jan 6, 2015 at 23:02
  • so far as I know, it should pick it up, unless you are overriding the session data, you would be using core login functionality just in your own format - only takes about 6 minutes to find out if it would work...
    – Geoff
    Jan 7, 2015 at 4:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.