removing menu

if fond solution problem is in main.php

You don`t need stuffUser Extending, you had problems bacause your stuffUser not Initializes, but i have found solution, tested and worked as a charm :)




'user'=>array(

		        'class'=>'CWebUser',

			'allowAutoLogin'=>true,

		),

'admin'=>array(

		        'class'=>'CWebUser',

			'allowAutoLogin'=>true,

),




Because you have to store for each CWebUser Class OBjectis in variable Yii::app()->user, Yii::app()->admin,

CMENU like this




array('label'=>'My Companies', 'url'=>array('/wsmembersdetails/index'),'visible'=>(!Yii::app()->admin->isGuest && !Yii::app()->user->isGuest) ,

EDIT: One more thing,

1.You need both models and (CActiveForm) for logging,

2.You need both extended UserIdentity,

@Igor:

I hate to say it, but your comments look like you don’t really read the other posts - and what’s even worth - you don’t really test what you are posting. Your assumption that the staffUser is not initialized is simply not correct. And your solution is missing a changed stateKeyPrefix, so it will not work either.

Don’t get me wrong, this is really no personal offense, but maybe you could take more care before you confuse people with incorrect advice.

Ok, you will not see post from me anymore,

Btw ive tested this solution on this domain

http://www.myproperty24.info/index.php

Please, it really was not my intention to forbid you to post :)

I know, how urged one can be to share some knowledge - but it takes some discipline to not post things that might confuse people. All i ask for, is to first read (and understand) what others posted before you, before you hurry and write your own comment.

So, please stay, and keep on posting in this sense, ok? Promised? :)

One word about your solution:

It’s the same as mine, except that you renamed ‘staffUser’ with ‘admin’ - and forgot stateKeyPrefix. If you don’t add another stateKeyPrefix, the two user states will interfere with each other - and thus the solution will not work reliable.