The site I'm working on is using the Frontpage module to redirect anon users to a login page. And I know about using triggers to set an action to redirect after login, (set to one specific url). But here's the catch:
My users are each arriving at a different entrance url, eg: www.mysite/PersonsName
Is there a way to redirect back to the entrance url after login?
You can take the URL and explode by "/" like this:
Then, set up a session to keep the username he accessed like this:
And you can set up the page that he is being redirected to after the succesful login like this:
I hope this is what you were looking for.
you can put this code in your custom module implementing hook_user().
generally it's enough to set $_REQUEST['destination'] to you desidered destination page (this is what the module login_destination does i guess)
No need to code: this is performed, with various settings available, by the existing login_destination module.