Add information to Yii::app()->user by extending CWebUser (better version)

Comparing #6 with #8

Tags

Yii, user, rbac

Content

[...]
return parent::__get($name);
}

public function login($identity, $duration) {
$this->setState('__userInfo', $identity->getUser
info()->attributes()); parent::login($identity, $duration); }  
 
/* 
 
* Required to checkAccess function
 
* Yii::app()->user->checkAccess('operation')
 
*/
 
public function getId()
 
{
 
return $this->id;
 
}

}
?>
```

remember to set that class as Yii::app()->user class:
[...]