Hi,
I have the rights module within my app.
I setup a standard webapp with yii, got everything working, rights module too.
Now my requirement is to use an email address for login purposes and as such have created a class that extends CBaseUserIdentity and UserIdentity extends that, have altered all my LoginForm model and UserIdentity, all that side is good, I login with email and password no problem.
I removed the rights tables to go for re-install as had changed superuser name in config to my email.
My user model is called Parent_Model and it resides in a module called identity so : application.modules.identity.models.Parent_Model.php in yii path terminology.
I have changed the rights userClass to Parent_Model.
When I call index.php?r=rights/install or index.php?r=rights all that is happening is a refresh to home page.
I have been trying to suss this for 3 hours solid and am completely clueless so far.
I included main.php config for your viewing pleasure.
<?php
// NEW MAIN.PHP CONFIG FILE //
// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'Maisie Princess',
'theme'=>'foundation522',
// preloading 'log' component
'preload'=>array('log'),
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
'application.vendors.*',
'application.modules.identity.models.*', // Authentication Models
'application.modules.rights.*', // RBAC Controller
'application.modules.rights.components.*', // RBAC Controller
),
'modules'=>array(
// uncomment the following to enable the Gii tool
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'giipass',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1','82.1.174.250'),
),
'rights'=>array(
'superuserName'=>'ron.appleton@gmail.com', // Name of the role with super user privileges.
'authenticatedName'=>'Authenticated', // Name of the authenticated user role.
'userIdColumn'=>'id', // Name of the user id column in the database.
'userNameColumn'=>'email', // Name of the email column in the database.
'enableBizRule'=>true, // Whether to enable authorization item business rules.
'enableBizRuleData'=>false, // Whether to enable data for business rules.
'displayDescription'=>true, // Whether to use item description instead of name.
'flashSuccessKey'=>'RightsSuccess', // Key to use for setting success flash messages.
'flashErrorKey'=>'RightsError', // Key to use for setting error flash messages.
'install'=>false, // Whether to install rights.
'baseUrl'=>'/rights', // Base URL for Rights. Change if module is nested.
'layout'=>'rights.views.layouts.main', // Layout to use for displaying Rights.
'appLayout'=>'application.themes.foundation522.views.layouts.main', // Application layout.
'cssFile'=>'rights.css', // Style sheet file to use for Rights.
'debug'=>false, // Whether to enable debug mode.
'userClass' => 'Parent_Model',
),
'identity' => array(),
'user' => array(),
'meritgenerator' => array(),
'treats' => array(),
),
// application components
'components'=>array(
'user'=>array(
'class'=>'RWebUser', // Allows super users access implicitly.
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
'authManager'=>array(
'class'=>'RDbAuthManager',
'connectionID'=>'db',
'itemTable'=>'AuthItem',
'itemChildTable'=>'AuthItemChild',
'assignmentTable'=>'AuthAssignment',
'rightsTable'=>'Rights',
),
// uncomment the following to enable URLs in path-format
/*
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
*/
'db'=>array(
EXCLUDED DETAILS!
),
'errorHandler'=>array(
// use 'site/error' action to display errors
'errorAction'=>'site/error',
),
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning',
),
// uncomment the following to show log messages on web pages
/*
array(
'class'=>'CWebLogRoute',
),
*/
),
),
),
// application-level parameters that can be accessed
// using Yii::app()->params['paramName']
'params'=>array(
// this is used in contact page
'adminEmail'=>'webmaster@example.com',
),
);
You will see that I am also using Foundation522, however have tried it without etcetera.
Any help greatly appreciated, Thanks
EDIT:
I thought it was worth mentioning that, all the changes had actually worked, having cleared the browsers history, temp files and cookies it began working properly.
So it is worth noting that the model does not actually have to be called User, neither does the username column need to be titled anything specific.
I Still have layout issues, in that Rights is coming up with a very plain page with no templating, but when I have time I will crack that, reading through here will probably solve that, a little more complicated by using foundation, but well worth it.
I would like to say that the fine grained control, and ability to set permissions within the controllers (If you want.) Makes rights the extension of choice for me as it is very straight forward to use and makes the learning curve very, very soft indeed, I am completely comfortable with only 3 days use, and rbac is a new concept to me.
I would like to see a detailed tutorial part to the user guide regarding using business rules, how to create and use, a dummies version if you like, but other than that, this extension is superb, and going to the extensions site also showed me that maintenance of the code is on going.
My hat is off to the team developing this, you on to a winner.
If you havn’t already, I would seriously consider putting a commercial support plan together for it.