コード例 #1
0
ファイル: User.php プロジェクト: vova07/yii2-users-module
 /**
  * @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();
         }
     }
 }
コード例 #2
0
ファイル: User.php プロジェクト: rychkov-evgeniy/yii2-base
 /**
  * @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();
         }
     }
 }
コード例 #3
0
ファイル: User.php プロジェクト: lulliz/qast
 /**
  * @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);
 }
コード例 #4
0
ファイル: UserBackend.php プロジェクト: manyoubaby123/imshop
 /**
  * @inheritdoc
  */
 public function afterSave($insert, $changedAttributes)
 {
     parent::afterSave($insert, $changedAttributes);
     if ($this->profile !== null) {
         $this->profile->save(false);
     }
 }