Hi guys.
I’m trying to figure out the "best" way for doing this without undermining a lot of what MODx does for me.
I have two types of webusers
guests
regular users
investors
both have to be logged in to get to the page within the site, however investors have additional pages they can get access to. The way we have it setup right now where the unauthorized page includes a login form.
What I want to do is :
1) if a user who is not logged tries to access a secured page, they are redirected to a login page.
2) If a "regular user" tries to access an "investor page", they are redirected to a "you don’t have access to investor pages" - i.e. I want a specific message not just a general access denied
3) If a guest user tries to access a regular user page , I want to encourage them to register (our guest users have a minimal profile, a regular user has a full profile and we want to encourage them to register) so I want to redirect guest users to a "please register" page.
The way it works right now is if ANYONE hits a page they are not authorized for they get the page with the login form. EVEN if they are already logged in. If I could tell what page them came from I could do a decision on that referring page, i.e. say "hey the page you came from was for investors so display this chunk, if for regular users, display this other chunk based on the page they "tried" to access,
but I tried :
$url = $_REQUEST["refurl"];
if (isset($url))
echo "url is " . $url;
else
echo "refurl is not set";
and the refurl never seems to be set .
Any ideas on the BEST way to do this? One thing was to insecure the special pages and figure out what groups the user is in and redirect if they shouldn’t have access but that undermines the modx security model and make a bunch of unnecessary work.
Any ideas would be a great help, thankyou.
thanks
Grant