Please Help Me !

can anyone help me? i don’t know what and where is the error…i’m also don’t know what is “CAccessRule.0users” and why line 115 had been highlight…since i’m new in using yii-framework…i hope i will get the answer a.s.a.p…thank you…(:

CException

Property "[color="#FF0000"]CAccessRule.0users[/color]" is not defined.

C:\BitNami\wappstack-5.4.22-0\apache2\htdocs\yii\framework\web\auth\CAccessControlFilter.php(115)

103 {

104 foreach($rules as $rule)

105 {

106 if(is_array($rule) && isset($rule[0]))

107 {

108 $r=new CAccessRule;

109 $r->allow=$rule[0]===‘allow’;

110 foreach(array_slice($rule,1) as $name=>$value)

111 {

112 if($name===‘expression’ || $name===‘roles’ || $name===‘message’ || $name===‘deniedCallback’)

113 $r->$name=$value;

114 else

[color="#FF0000"]115 $r->$name=array_map(‘strtolower’,$value);[/color]

116 }

117 $this->_rules[]=$r;

118 }

119 }

120 }

121

122 /**

123 * Performs the pre-action filtering.

124 * @param CFilterChain $filterChain the filter chain that the filter is on.

125 * @return boolean whether the filtering process should continue and the action

126 * should be executed.

127 */

Check out access control filter docs. When defining rules, each array item must contain an array with ‘access’ or ‘deny’ as first value and then other options as key=>array.

You probably mixed this up.

thank you nick…i already try to do it but that does not work… i already mix up everything but like i say, it’s does not work…

Please copy here the your accessRules function from the controller:




public function accessRules() {

.......

}



do you mean this accessRule?? i hope i give you the correct one…(:

I’m sorry to trouble you.




public function accessRules() {

return array(

			array('allow',  // allow all users to perform 'index' and 'view' actions

				'actions'=>array('index','view'),

				'0users'=>array('*'),

			),

			array('allow', // allow authenticated user to perform 'create' and 'update' actions

				'actions'=>array('create','update'),

				'users'=>array('@'),

			),

			array('allow', // allow admin user to perform 'admin' and 'delete' actions

				'actions'=>array('admin','delete'),

				'users'=>array('admin'),

			),

			array('deny',  // deny all users

				'users'=>array('*'),

			),

		);

}



You have a typo there, in the first rule it’s ‘0users’ instead of 'users. The error message you got was pretty detailed about it :slight_smile:

okay…i got it…hehe…thank you so much, nick…i’m seriously didn’t noticed about that since i don’t know how to read the errors…thank you so much…really appreciate it…:D