Web Applications Book - Trackstar Application

In chapter 7 - i am getting an error when doing the console application - I even went back and got the code from the website.

C:\xampp\htdocs\trackstar2\protected>yiic help rbac

exception ‘CException’ with message ‘Property “CConsoleApplication.authManager” is not defined.’ in C:\xampp\htdocs\yii\framework\base\CComponent.php:173

Stack trace:

#0 C:\xampp\htdocs\yii\framework\base\CModule.php(513): CComponent->__set(‘authManager’, Array)

#1 C:\xampp\htdocs\yii\framework\base\CApplication.php(150): CModule->configure(Array)

#2 C:\xampp\htdocs\yii\framework\YiiBase.php(125): CApplication->__construct(‘C:\xampp\htdocs…’)

#3 C:\xampp\htdocs\yii\framework\YiiBase.php(113): YiiBase::createApplication(‘CConsoleApplica…’, ‘C:\xampp\htdocs…’)

#4 C:\xampp\htdocs\yii\framework\yiic.php(23): YiiBase::createConsoleApplication(‘C:\xampp\htdocs…’)

#5 C:\xampp\htdocs\trackstar2\protected\yiic.php(11): require_once(‘C:\xampp\htdocs…’)

now if i remove the section from the chapter they say to add in console.php - i dont get the error, but not sure the app will work

‘authManager’=>array(

		'class' => 'CDbAuthManager',


	        'connectionID' => 'db',


		'itemTable' => 'tbl_auth_item',


		'itemChildTable' => 'tbl_auth_item_child',


		'assignmentTable' => 'tbl_auth_assignment',


),

any help will be appreciated - Thanks…

Hi

please change this

go to yii/framework/web/auth/CDbAuthManager.php on line 42

change this


public $assignmentTable='AuthAssignment';

to your db name


public $assignmentTable='your_db_name';

i am not sare it’s work or not…

Please don’t advise people to modify the framework directly. It’s asking for trouble later when upgrading. If necessary, just override the class.

Do you add that ‘authManager’ configuration in the ‘components’ array?

ok got it - the issue was I put the authManager in the wrong place a "parenthesis issue"

But thanks for the replies- got thru it!