FEU redirect to page based on email address of user

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
handcoded
Forum Members
Forum Members
Posts: 123
Joined: Thu Dec 06, 2007 2:26 pm

FEU redirect to page based on email address of user

Post by handcoded »

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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: FEU redirect to page based on email address of user

Post by Dr.CSS »

There is a setting in preferences of FEU for redirect after login that will take smarty variables...
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: FEU redirect to page based on email address of user

Post by jmcgin51 »

{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...
handcoded
Forum Members
Forum Members
Posts: 123
Joined: Thu Dec 06, 2007 2:26 pm

Re: FEU redirect to page based on email address of user

Post by handcoded »

Hi

That is exactly what I needed. Thanks very much.

regards,
Richard
handcoded
Forum Members
Forum Members
Posts: 123
Joined: Thu Dec 06, 2007 2:26 pm

Re: FEU redirect to page based on email address of user

Post by handcoded »

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
andershz
Forum Members
Forum Members
Posts: 49
Joined: Fri Nov 21, 2008 9:30 pm

Re: FEU redirect to page based on email address of user

Post by andershz »

Have you turned off caching for the page?
handcoded
Forum Members
Forum Members
Posts: 123
Joined: Thu Dec 06, 2007 2:26 pm

Re: FEU redirect to page based on email address of user

Post by handcoded »

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.
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: FEU redirect to page based on email address of user

Post by jmcgin51 »

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
What exactly happens? You say "it does not take me anywhere" - does it give an error, or nothing at all?

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).
handcoded
Forum Members
Forum Members
Posts: 123
Joined: Thu Dec 06, 2007 2:26 pm

Re: FEU redirect to page based on email address of user

Post by handcoded »

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
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: FEU redirect to page based on email address of user

Post by jmcgin51 »

can you post your redirect template?
Post Reply

Return to “Modules/Add-Ons”