Thanks for Your patience Killermonk, unfortunately Your latest script doesn’t work, the error message given by FF-browser is (was):
PHP Error
Description
Invalid argument supplied for foreach()
Source File
/home…/web/protected/framework/web/auth/CPhpAuthManager.php(449)
00437: $this->saveToFile($items,$this->authFile);
00438: }
00439:
00440: /**
00441: * Loads authorization data.
00442: */
00443: public function load()
00444: {
00445: $this->clearAll();
00446:
00447: $items=$this->loadFromFile($this->authFile);
00448:
00449: foreach($items as $name=>$item)
It seems that the problem is with empty file …protected/data/auth.php I’ve created with proper access rights but without any content. CPhpAuthManager is trying to loadFromFile($this->authFile); and execute it with foreach($items as $name=>$item) THIS LINE IS POINNTED AS ERROR. May be I should fill some initial data to this file but I don’t know the format.
OK, above is the history already!!! I’ve deleted empty auth.php and Yii has created his own with the content:
<?php
return array (
‘zobaczWszystko’ =>
array (
'type' => 0,
'description' => 'pokaz/show wszystkich',
'bizRule' => NULL,
'data' => NULL,
),
‘podgladacz’ =>
array (
'type' => 2,
'description' => '',
'bizRule' => NULL,
'data' => NULL,
'children' =>
array (
0 => 'zobaczWszystko',
),
'assignments' =>
array (
'apiano' =>
array (
'bizRule' => NULL,
'data' => NULL,
),
),
),
);
But it doesn’t resolve the problem, the error message is the same as before, it seems the “if (Yii…checkAccess(…))” is still false.
I’ve not found any mention about …protected/data/auth.php in the GUIDE (OK, I’ve found 2 small mentions in CPI). I hadn’t …protected/data path at all, because I don’t use sqlite, which database file sqlitedatabasename.db is placed in there. Where can I find any doc/giude/help about the mechanism of persistence of AccesItems? I thought they are persistent objects of Yii framework, not kept in the file accessible by UserControler checkAccess() function. I have the auth.php file with (I hope) proper content (created by Yii) and… it doesn’t work.
Now, the access hierarchy is loaded from the auth.php file in the UserIdentity.php, checked if not changed and left unchanged, am I right? Exactly the same meaning has the php code (createOperation, createRole and Assign). I cannot see the connection/communication between AccesItems created in …UserIdentity.php and checkAccess(AccessItem) in …UserControler. Do You see it?
What to do then?
Regards
Greg