This topic is locked

Three Level Logins..

5/31/2007 21:58:30
PHPRunner General questions
M
michaelmac author

Hey Everyone
I have spent the last two weeks redesigning my web-page and I love PHPR. I had to use three GroupID to help me with my displaying my tables. GroupID's who are assigned "user" and "manager" use on the customerID I have in my password table. I want to use the same password table (login screen) and use a GroupID assigned "admin". The "admin" usesthe billTo and I have that working fine as a separate set of pages. What I want to do is use the AfterSucessful event to "branch" to the other pages I built for the "admin" only. What assignment variables get passed from login page to the menu.php. I mean, if the customer is a "manger" or lower, I am fine, they only can see what is their customerID, but if a customer is an "admin", I only want to look at their billTo value. I want to do this because currently I use two login screens, and I want to get it to one. Anyone have an idea of how to tackle this dilemma..
Thanks
Mike
PS.. in the password setup.. "user" and "manager" have that setting customerID=customerID
in that other setup for "admin" I have billTo=billTo.. so I hope you see my concerns

J
Jane 6/1/2007

Mike,
you can create custom views on the Datasource tables tab for the admin account.

Create admin and default account on the User group premissions dialog and set up permissions for the custom views for the admin only.

M
michaelmac author 6/4/2007

Mike,

you can create custom views on the Datasource tables tab for the admin account.

Create admin and default account on the User group premissions dialog and set up permissions for the custom views for the admin only.


Thanks Jane.. I realized that solution was my key after I posted this. What I was able to do was actually set up TWO projects with FOUR levels of access. The key was in the aftersuccessfullogin event... Sergey suggested I branch on whatever suited the situation. I was able to use the GroupID. I was able to use the check database then I used the go to a different page. I do want to point out that DO NOT USE THE WHOLE URL NAME, I lost whatever session variables I need to go to the other page in a different folder...
/Users -- is where I stored my main project.. it was set up for a "manager" and a "user"
if the user was a "admin" or "root".. the event sent them to
/Admin -- where I stored an exact copy of my main project with the exceptions of what pointed to what as far as filters go
one thing to note here if anyone uses this.. make sure to modify the logout on all the _list.php to send your code back to /Users/login.php... if not. you login screen is pointing at the wrong page.. or if you want.. I just realized as I typed this.. just modify the aftersuccessful login event to send your code to the /User depending on the GroupID level
Mike