/** * @inheritdoc */ public function afterSave($insert, $changedAttributes) { parent::afterSave($insert, $changedAttributes); if ($insert) { if ($this->profile !== null) { $this->profile->save(false); } if ($this->module->requireEmailConfirmation === true) { $this->send(); } } }
/** * @inheritdoc */ public function afterSave($insert, $changedAttributes) { parent::afterSave($insert, $changedAttributes); if ($insert) { if ($this->profile !== null) { $this->profile->save(false); } $auth = Yii::$app->authManager; $role = $auth->getRole(self::ROLE_DEFAULT); $auth->assign($role, $this->id); if ($this->module->requireEmailConfirmation === true) { $this->send(); } } }
/** * @inheritdoc */ public function afterSave($insert, $changedAttributes) { parent::afterSave($insert, $changedAttributes); if ($this->profile !== null) { $this->profile->save(false); } $auth = Yii::$app->authManager; $name = $this->role ? $this->role : self::ROLE_DEFAULT; $role = $auth->getRole($name); if (!$insert) { $auth->revokeAll($this->id); } $auth->assign($role, $this->id); }
/** * @inheritdoc */ public function afterSave($insert, $changedAttributes) { parent::afterSave($insert, $changedAttributes); if ($this->profile !== null) { $this->profile->save(false); } }