I need to write a php snippit or something... that does the following:

If you login from the front page login block, re-direct to the front page (currently goes to user page)

if you login from any page other than the front page, preserve destination.

I know i can use an elseif statement for this but I don't have any idea how to say "if front" or do the preserve destination bit.....

Any guidance?

Rebecca

Comments

mithy’s picture

You can set to always preserve destination and then unset it for certain cases:

unset($_GET['destination'])

beckyjohnson’s picture

OK, That sounds interesting. Do I have to write the($_GET['destination']) in function?

Rebecca

mithy’s picture

I do not understand what you mean exactly. Unset is a function. You have to use it in a snippet in the condition where you do not want to preserve the destination.

beckyjohnson’s picture

I was thinking about this and what i don't really understand is why preserve destination doesn't work in the first place, on the front page. If you login from the front page, it takes you to the user page, and doesn't leave you on the front page..... ugh