On our site, we have a whole section that is protected and requires login. We don't have the login form on all the pages since we don't want to figure it so prominently. So upon clicking a link to any protected page (or being directed there from an email or other site), we have the normal code to redirect the user to login before they can see the protected content. Here's the redirect code:
Code: Select all
{if !$ccuser->loggedin() || ($ccuser->loggedin() && !$ccuser->memberof('Approved Members'))}
{redirect_page page='member-login'}
{/if}
I've read a few posts related to this, but none have a definitive solution that would allow the redirect to bring them back to the page they originally wanted, post-login. I've tried adding a "from" attribute to the redirect_page command, with and without the "redirect after login" FEU setting being set, but it just doesn't work. I've also tried putting some code in to save the page alias so I could use it for the redirect after login setting, without success.
Would greatly appreciate any help with this; I'm an admitted newbie with PHP and Smarty (I'm much more comfortable in the .NET/C# world). Thank you in advance!
Erik