Yii:规则检查不同的场景

i want to check different validation in one controller.

i have problem is,

when user is registering first time at that time i want to do following validation

 array('name, email, password, location, confirm_password', 'required','on'=>'create'), 
 array('confirm_password', 'compare', 'compareAttribute' =>  'password','on'=>'create,fbuser'),     
 array('email','unique','on'=>'create'),

and if user is already registered with FB and trying to register at that time i want to do following validation (i don't want to validate email address in this case)

   array('name, password, location, confirm_password', 'required','on'=>'fbuser'), 
   array('confirm_password', 'compare', 'compareAttribute' => 'password','on'=>'create,fbuser'),

this is my controller method...

    public function actionCreate()
    {
            $model=new AppUser('create');

            if(!Yii::app()->user->isGuest)
                $this->redirect('/');

            if(Yii::app()->request->isPostRequest)
            {
                    if($model->isFbUser($_POST['email'])){
                        $model->scenario = 'fbuser';
                        if($model->validate())
                            $this->redirect(array('/Appuser/fbauth','email'=> $_POST['email']));
                    }
                    else
                        $model->scenario = 'create';

                    $model->attributes=$_POST;
                    if($model->save())
                            $this->redirect('/login');
            }

            $this->render('create',array(
                    'model'=>$model,
            ));
    }

but its not validating properly.

can anyone help me to solve it?

Thanks in advance

I think the problem might be, that in the if (isFbUser) clause you do not assign the post data to the model before validating.

Your use of scenarios looks good to me.