/** * Actions to be taken after logging in. * Overloads the parent method in order to mark superusers. * @param boolean whether the login is based on cookie. */ public function afterLogin($fromCookie) { parent::init($fromCookie); // Mark the user as a superuser if necessary. if (Rights::getAuthorizer()->isSuperuser($this->getId()) === true) { $this->isSuperuser = true; } }
/** * Initializes the component. */ public function init() { parent::init(); $this->setIsAdmin(in_array($this->name, $this->admins)); }
/** * Initializes the component. */ public function init() { parent::init(); $this->setIsAdmin(in_array($this->name, Yii::app()->authManager->admins)); }