Once you have installed and configured the rights extension in your application, you can change the table name from 'User' to any table name you want and similarly for 'username' column to any other column name.
Let say, we have table named 'Employee' with fields (id, name, email,...) and we want to use 'Employee' table name instead of 'User', 'email' column instead of 'username'.
To do so:
- First goto the main.php and add the following
'modules' => array(
...
'rights' => array(
'install' => false,
'userClass' => 'Employee',
'userNameColumn' => 'email',
),
...
),
- Secondly, goto to the /modules/rights/components/RAuthorizer.php and change the following code at line # 300
$superusers[] = $user->name;
with
$superusers[] = $user->email;
By doing so, the rights extension will starting using 'Employee' table instead of 'User' and 'email' fields instead of 'username'.
Others Tables
Can I do it to others tables?
@Mat_R
You can modify it anyway you want... the above is an example of using the Employee table instead of User, you can use any table instead of Employee
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.