This topic is locked

How can I bypass menu.php based on login

1/24/2008 15:34:09
PHPRunner General questions
C
crimsondrac author

I had our site setup to bypass the menu.php page and take the user directly to a _list.php page. I recently created custom views for other users and was wondering if it would be possible to still bypass the menu.php, but redirect the users to a seperate _list.php page based upon their Access Group? Anyone got any ideas?
Thanks

J
Jane 1/25/2008

Hi,
use AfterSuccessfulLogin event and Redirect to another page action on the Events tab for this purpose.

M
marke 1/28/2008

I tried this . . . and got
Fatal error: Cannot pass parameter 3 by reference in C:\Program Files\xampplite\htdocs\NewRenewals\login.php on line 71
Tried lots of ways of defining the page location without luck
//** Redirect to another page ****

header("Location: tblpeople_list.php");

exit();
There must be something obvious that I am doing wrong

J
Jane 1/29/2008

Mark,
where do you use this code?

M
marke 1/29/2008

In the [b]After Successful Login[/b] event (Redirect to a new page - option)

J
Jane 1/29/2008

Mark,
please publish your project on Demo Account and post a URL to your pages here or send it to [email=support@xlinesoft.com]support@xlinesoft.com[/email] along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.

M
marke 1/29/2008

Jane
I have installed on demo - still has the same problem.
Mark

J
Jane 1/30/2008

Mark,
please send a URL to your page to [email=support@xlinesoft.com]support@xlinesoft.com[/email].

C
crimsondrac author 2/18/2008

OK, I am not sure I explained myself clearly. Let's say I have two user groups. We will call them Group A and Group B. Group A has more access rights so they can see more information. Group B sees only minimal information. So, I setup a custom view for Group A and B and setup the correct access for each group. Now, after a successful login, I want group A to get directed to a groupa_list.php and Group B to get redirected to groupb_list.php. The suggestion you provided only tells me how to redirect everyone, regardless of group, to an alternate page.
Shouldn't there be some type of an IF ELSE statement in there?

J
Jane 2/19/2008

Hi,
check $_SESSION["GroupID"] value in the AfterSuccessfulLogin event and redirect to the appropriate page:

if ($_SESSION["GroupID"]=="groupA")

{

header("Location: groupa_list.php");

exit();

}

else

{

header("Location: groupb_list.php");

exit();

}

C
crimsondrac author 2/21/2008

Hi,

check $_SESSION["GroupID"] value in the AfterSuccessfulLogin event and redirect to the appropriate page:


Worked like a dream. Thanks a bunch.