Hi
I have a website setup that showcases video files made by a presentation company. Each client has their own specific page for the event that they held and each client has a unique email address. All video pages apart from an example page require the client be logged in.
I'd really appreciate a smarty code example that would allow me to redirect the client to a page based on their email address. If someone could post an example of 3 seperate email addresses redirecting to 3 seperate urls that would be fab.
Thanks
FEU redirect to page based on email address of user
Re: FEU redirect to page based on email address of user
There is a setting in preferences of FEU for redirect after login that will take smarty variables...
Re: FEU redirect to page based on email address of user
{if $ccuser->property('email_address') == 'username@domain1.com'}
{redirect_page page='domain1'}
{elseif $ccuser->property('email_address') == 'username@domain2.com'}
{redirect_page page='domain2'}
{elseif $ccuser->property('email_address') == 'username@domain3.com'}
{redirect_page page='domain3'}
{/if}
but Dr. CSS's method is more elegant and requires less administrative work...
{redirect_page page='domain1'}
{elseif $ccuser->property('email_address') == 'username@domain2.com'}
{redirect_page page='domain2'}
{elseif $ccuser->property('email_address') == 'username@domain3.com'}
{redirect_page page='domain3'}
{/if}
but Dr. CSS's method is more elegant and requires less administrative work...
Re: FEU redirect to page based on email address of user
Hi
That is exactly what I needed. Thanks very much.
regards,
Richard
That is exactly what I needed. Thanks very much.
regards,
Richard
Re: FEU redirect to page based on email address of user
Hi
I'm not having much luck with this. I've made a new template called loggedin and pasted the code example in specifying the email address and the full url of where the page should redirect to but I end up at my logged in page and it does not take me anywhere. I tried using the page alias instead of the full url but again the same result.
I'm obviously doing something wrong but I am not sure what that is. Some further assistance would be appreciated. Should I put this code on the login page instead ?
Thanks
I'm not having much luck with this. I've made a new template called loggedin and pasted the code example in specifying the email address and the full url of where the page should redirect to but I end up at my logged in page and it does not take me anywhere. I tried using the page alias instead of the full url but again the same result.
I'm obviously doing something wrong but I am not sure what that is. Some further assistance would be appreciated. Should I put this code on the login page instead ?
Thanks
Re: FEU redirect to page based on email address of user
Have you turned off caching for the page?
Re: FEU redirect to page based on email address of user
Yes I have disabled caching for the logged in page but not the login page.
I tried pasting the code example into the front end users login template but again the redirect isn't working.
I tried pasting the code example into the front end users login template but again the redirect isn't working.
Re: FEU redirect to page based on email address of user
What exactly happens? You say "it does not take me anywhere" - does it give an error, or nothing at all?handcoded wrote:Hi
I'm not having much luck with this. I've made a new template called loggedin and pasted the code example in specifying the email address and the full url of where the page should redirect to but I end up at my logged in page and it does not take me anywhere. I tried using the page alias instead of the full url but again the same result.
I'm obviously doing something wrong but I am not sure what that is. Some further assistance would be appreciated. Should I put this code on the login page instead ?
Thanks
If it were me, I would create a "redirect" page that contains only this Smarty code. This should be the page that all users are redirected to upon login (so the "redirect" page is the one that will be listed in the FEU admin panel as the page to redirect to after login). When they log in and are redirected here, this page automatically performs another redirect to the appropriate page based on the email address.
If you want to make sure that other users (without the correct email address) cannot directly access a given page, you need to have code in the page template that prevents them from viewing the page. This could get rather cumbersome if you have many pages and many email addresses to manage. I would suggest that you might want to use another criteria (such as group membership) for allowing/disallowing page access (and for the redirect).
Re: FEU redirect to page based on email address of user
Hi
I'll certianly give this a try. At present when logging in I am redirected to a logged in page which uses a custom template that contains the redirection code for email addresses but the redirection does not happen and no errors are shown.
Thanks
I'll certianly give this a try. At present when logging in I am redirected to a logged in page which uses a custom template that contains the redirection code for email addresses but the redirection does not happen and no errors are shown.
Thanks
Re: FEU redirect to page based on email address of user
can you post your redirect template?