Redirect doesn't work after extends CWebUser

Hi, i have a problem with login form. After i extends CWebUser and using it, the login form won’t redirect. this is my code:




// components/WebUser.php

class WebUser extends CWebUser

{

    protected function afterLogin($fromCookie) {

        parent::afterLogin($fromCookie);

        file_put_contents(Yii::getPathOfAlias('webroot').'/afterLogin.txt',

            "hello, after Login event\n".date('Y-m-d H:i:s'));

    }

}


// config/main.php

..

'user'=>array(

    'class' => 'WebUser',

    'allowAutoLogin'=>true,

),

..


// SiteController.php

public function actionLogin() {

    $model=new LoginForm;

    if(isset($_POST['LoginForm'])) {

        $model->attributes = $_POST['LoginForm'];

        if($model->validate() && $model->login()) {

            $this->redirect(array('admin'));

        }

     }

}



sorry for my bad english :). thanks

Would not it be called like this for the url:




$this->redirect($this->createUrl('admin'));



are you sure this


if($model->validate() && $model->login())

evaluates to true?

yes, of course. i just copy it from yii demo :D. when not using my own WebUser, it’s no problem