authentication - Redirect After Registration in Drupal -
After a login screen does a user know how to go back to "previous page" and a new account?
Actually this sequence is:
- User tries to get protected content
- redirected to login page
- If he logs it is redirected to the original page
- If he chooses to "create a new account" and fills it, he is taken to the home page < / Li>
How do we automatically redirect it to the original page (not a static page)
There are several ways to go about this in the navigation that is a login link for the most straight forward Somewhere to add the destination to the url. The code for this is something like this:
& lt ;? Php if (user_is_anonymous ()) {$ link = l (t ('login'), 'user / login', array ('query' => drupal_get_destination ())); }? & Gt;
You can also set a custom access denied page on admin / settings / error-reporting that can either go to callback that outputs the code above, or a simple php Code for the node that outputs.
Additionally, the user login block provided with the Drupal Core uses the same method to redirect successful login back to the same page.
Edit : Note that the above methods can hardly work for registration because there are more steps involved. Specifically, when a user needs to verify an email address, passing the initial destination via email will include modifying the main user registration process.
This will probably still work on the configured site to not confirm the email address. After this, it will be considered that 2 links: 1 for entry and another for registration, both of the destination information passing through.
may also be pursuable, though it does not yet provide correct registration. / P>
Comments
Post a Comment