Hello,
sorry for bothering you…
i freshly installed Yii and tried to add the rights module… this is my main.php file:
<?php
// 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'=>'My Web Application',
// preloading 'log' component
'preload'=>array('log'),
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
'application.modules.rights.components.*',
),
// application components
'components'=>array(
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
'class'=>'RightsWebUser',
),
// 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(
'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
),
// uncomment the following to use a MySQL database
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=yii_digitaldealer',
'emulatePrepare' => true,
'username' => 'giorgio',
'password' => '17sf|ga13',
'charset' => 'utf8',
),
'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',
),
*/
),
),
),
'modules'=>array(
'rights'=>array(
'install'=>true, // Remove this row after running the module the first time.
'superUserRole'=>'Admin', // Only an example, this is the default value.
'defaultRoles'=>array('Guest'), // Only an example, this is the default value.
'superUsers'=>array(
1=>'admin',
2=>'demo',
),
),
),
// application-level parameters that can be accessed
// using Yii::app()->params['paramName']
'params'=>array(
// this is used in contact page
'adminEmail'=>'webmaster@example.com',
),
);
when i try to go to http://digitaldealer.wdev.wedoo.local/index.php?r=rights i get this:
CException
Description
Property "CPhpAuthManager.db" is not defined.
Source File
/home/digitaldealer/public_html/www/protected/modules/rights/components/RightsInstaller.php(30)
00018: public $db;
00019: /**
00020: * @var bool Whether Rights is installed or not?
00021: */
00022: public $isInstalled;
00023:
00024: /**
00025: * Initialization.
00026: */
00027: public function init()
00028: {
00029: $this->_authManager = Yii::app()->authManager;
00030: $this->db = $this->_authManager->db;
00031: $this->isInstalled = self::isInstalled();
00032:
00033: parent::init();
00034: }
00035:
00036: /**
00037: * Installs the Rights module.
00038: * @param string $superUserRole Name of the super user role
00039: * @param array $superUsers List of super users (id=>name)
00040: * @return bool
00041: */
00042: public function install($defaultRoles, $superUserRole, $superUsers)
Stack Trace
#0 /home/digitaldealer/public_html/www/protected/modules/rights/components/RightsInstaller.php(30): CComponent->__get('db')
#1 /home/digitaldealer/public_html/www/framework/base/CModule.php(380): RightsInstaller->init()
#2 /home/digitaldealer/public_html/www/protected/modules/rights/RightsModule.php(98): CModule->setComponent('installer', Object(RightsInstaller))
#3 /home/digitaldealer/public_html/www/protected/modules/rights/RightsModule.php(66): RightsModule->install()
#4 /home/digitaldealer/public_html/www/framework/base/CModule.php(73): RightsModule->init()
#5 /home/digitaldealer/public_html/www/framework/YiiBase.php(194): CModule->__construct('rights', NULL, Array)
#6 /home/digitaldealer/public_html/www/framework/base/CModule.php(258): YiiBase::createComponent('rights.RightsMo...', 'rights', NULL, Array)
#7 /home/digitaldealer/public_html/www/framework/web/CWebApplication.php(379): CModule->getModule('rights')
#8 /home/digitaldealer/public_html/www/framework/web/CWebApplication.php(318): CWebApplication->createController('rights')
#9 /home/digitaldealer/public_html/www/framework/web/CWebApplication.php(121): CWebApplication->runController('rights')
#10 /home/digitaldealer/public_html/www/framework/base/CApplication.php(135): CWebApplication->processRequest()
#11 /home/digitaldealer/public_html/www/index.php(13): CApplication->run()
#12 {main}
2010-07-28 12:50:01 Apache/2.2.9 (Debian) Yii Framework/1.1.3
can you please help me out?
should i add a user model… how? thanks a lot