2 types of CURRENT_USERS
2 posts by 2 authors in: Forums > CMS Builder
Last Post: October 4, 2011 (RSS)
we have 2 sections of the website, one section for retailers and one section for sales reps. Very simply, want to redirect upon login, IF the CURRENT_USER is a 'type' = retailer we want them to go to one place, and the same when the 'type' is sales.
But we also need to add verification code int he header to check to makes sure they are retailers and sales.
we tried a few things, but can't find the best way that works to do it. what do you suggest?
But we also need to add verification code int he header to check to makes sure they are retailers and sales.
we tried a few things, but can't find the best way that works to do it. what do you suggest?
John Tedesco
Creative Director
JAM Graphics
Creative Director
JAM Graphics
Re: [jtedescojam] 2 types of CURRENT_USERS
By robin - October 4, 2011
Hey John,
If you add a "type" menu to the accounts section, that data will automatically be added to the CURRENT_USER variable ($CURRENT_USER['type']). You can use that to verify a users type at the top of a page.
On login, you can set your website membership "WEBSITE_LOGIN_POST_LOGIN_URL" to direct to something like "logindispatch.php". Then redirect users from there to the correct place. e.g. The code might look something like:
Hope that helps,
Robin
If you add a "type" menu to the accounts section, that data will automatically be added to the CURRENT_USER variable ($CURRENT_USER['type']). You can use that to verify a users type at the top of a page.
On login, you can set your website membership "WEBSITE_LOGIN_POST_LOGIN_URL" to direct to something like "logindispatch.php". Then redirect users from there to the correct place. e.g. The code might look something like:
if($CURRENT_USER['type']=='retailer') {
redirectBrowserToURL('retailerpage.php');
}
Hope that helps,
Robin
Robin
Programmer
interactivetools.com
Programmer
interactivetools.com