Hi there, I’m new to Yii and im currently trying to install the srbac_1_02 module.
When I point my browser to webroot/index.php?r=srbac/authItem/install, i get the following error
CDbException
Description
CDbCommand failed to prepare the SQL statement: SQLSTATE[HY000]: General error: 1 no such table: items
Source File
/Applications/XAMPP/xamppfiles/htdocs/yii/framework/db/CDbCommand.php(118)
I’m not sure if there’s something i’ve missed or need to configure. I’m gathering that’s it’s looking for the 3 tables specified in the authManager array.
Also, when I remove the authManager array from main.php config file, I am able to view the install page. But can’t install.
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 components
'components'=>array(
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning',
),
),
),
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
// uncomment the following to set up database
'db'=>array(
'connectionString'=>'sqlite:'.dirname(__FILE__).'/../data/data.db',
),
'authManager'=>array(
// The type of Manager (Database)
'class'=>'CDbAuthManager',
// The database connection used
'connectionID'=>'db',
// The itemTable name (default:authitem)
'itemTable'=>'items',
// The assignmentTable name (default:authassignment)
'assignmentTable'=>'assignments',
// The itemChildTable name (default:authitemchild)
'itemChildTable'=>'itemchildren',
),
),
// application modules
'modules'=>array(
'srbac'=>
array(
// Your application's user class (default: User)
"userclass"=>"User",
// Your users' table user_id column (default: userid)
"userid"=>"user_ID",
// your users' table username column (default: username)
"username"=>"username",
// If in debug mode (default: false)
// In debug mode every user (even guest) can admin srbac, also
//if you use internationalization untranslated words/phrases
//will be marked with a red star
"debug"=>true,
// The number of items shown in each page (default:15)
"pageSize"=>10,
// The name of the super user
"superUser" =>"Authority",
//The css file to use
"css"=>"srbac_red.css", // must be in srbac css folder
//The layout to use
"layout"=>"admin", // must be in protected/views/layouts/
//The not authorized page
"notAuthorizedView"=>"application.views.site.unauthorized",
)
),
// application-level parameters that can be accessed
// using Yii::app()->params['paramName']
'params'=>array(
// this is used in contact page
'adminEmail'=>'webmaster@example.com',
),
);
I haven’t dived into yii extensively yet. I did browse the docs on authManager but it doesn’t seem to require anymore configuration. Hmmm… not sure? And the base app seems to work fine when i visit it.