admin>>manager>>user

Hi, is there an easy/better/nice/good way how to implement this thing without having to bang my head at the wall? :lol:

I have a user table. it has 2 different set of username and password.

I have a staff table. it has a set of username and password too.

apparently, my app can log you in using the first set of username and password using the default implementation

of yii’s UserIdentity class, once you’re logged in with that first set of username and password, you’ll be redirected to a page where you can see the control panel link, if you click that, you get to see another login form while currently logged-in as the 1st set of username and password, my question is, how should I validate this 2nd set, if on the next level, I’ll be dealing again with a 3rd set of username and password ? :mellow:

The better way is to use RBAC.

Create only one table for user (with username and password), read this chapter of the definitive guide and enjoy the power of Yii’s rbac system.

You can also search the forum for RBAC, there are a lot of thread about it in wich you can find the answer to each your doubt.

If, after reading the definitive guide, some old thread and after trying a bit, you will find difficoulties, we will be pleased to give you further assistance.