Yii Framework Forum: Please Help Me ! - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Please Help Me !

#1 User is offline   ahmad albab 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 07-January 14

Posted 07 January 2014 - 04:04 AM

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 "CAccessRule.0users" 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
115 $r->$name=array_map('strtolower',$value);
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 */
0

#2 User is offline   nineinchnick 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 622
  • Joined: 12-September 11
  • Location:Bialystok, Poland

Posted 07 January 2014 - 07:15 AM

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.
Don't be a dick.
0

#3 User is offline   ahmad albab 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 07-January 14

Posted 08 January 2014 - 12:05 AM

View Postnineinchnick, on 07 January 2014 - 07:15 AM, said:

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...
0

#4 User is offline   Argent 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 81
  • Joined: 23-February 13
  • Location:Hungary

Posted 08 January 2014 - 07:05 AM

Please copy here the your accessRules function from the controller:
public function accessRules() {
.......
}

0

#5 User is offline   ahmad albab 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 07-January 14

Posted 08 January 2014 - 10:16 PM

View PostArgent, on 08 January 2014 - 07:05 AM, said:

"Please copy here the your accessRules function from the controller:"

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('*'),
			),
		);
}

0

#6 User is offline   nineinchnick 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 622
  • Joined: 12-September 11
  • Location:Bialystok, Poland

Posted 09 January 2014 - 04:12 AM

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 :-)
Don't be a dick.
0

#7 User is offline   ahmad albab 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 39
  • Joined: 07-January 14

Posted 11 January 2014 - 08:55 PM

View Postnineinchnick, on 09 January 2014 - 04:12 AM, said:

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 :-)



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
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users