This topic is locked

Keep User Database in seperate table

11/27/2013 6:23:24 AM
PHPRunner General questions
A
angelcause author

How can I create a simple user database containing, Name, Designation, Username and Password and use it in all my databases. This way I will have only 1 database in general in my MYSQL to edit for all my users in my overall databases.

S
Stoneman 12/3/2013



How can I create a simple user database containing, Name, Designation, Username and Password and use it in all my databases. This way I will have only 1 database in general in my MYSQL to edit for all my users in my overall databases.


I use views in mysql to do this. A mysql View is essentially a copy of a table. Mysql will let you create a view of a table in a different database from the one you are working in. To make this work do the following.

PHP Runner uses four tables for Dynamic access control
1= project_uggroups - Stores Group ID and Name

2= project_ugmembers - Stores Username and Which Groups They Belong

3= project_ugrights - Stores Page access Mask by Group ID

4= project_users - Stores Username, password, active, etc
I create a mysql view to link to the users table in the master database from the new project database (table#4). I then use this view as the users table when I create a new Project. I let PHP runner create the other three tables (Tables 1,2,3) when I create the project. I select myself as admin. After I have everything working correctly I delete the project_uggroups and project_ugmembers tables and create a mysql view with the same names linking to the master database ugmembers and uggroups tables. DO NOT delete the project_ugrights table. The PHP Runner project will remove any pages not part of that specific project, so this needs to stay as an active part of each project. The users table, the uggroups table, and the ugmembers tables can all be shared by having a master and creating a MYSQL view to it from each project.

I hope this helps.
Ed