/**
  * Creates a new User model.
  * If creation is successful, the browser will be redirected to the 'index' page.
  * @return mixed
  */
 public function actionCreate()
 {
     /** @var User $user */
     $user = \Yii::createObject(['class' => User::className(), 'scenario' => 'create']);
     $this->performAjaxValidation($user);
     if ($user->load(\Yii::$app->request->post()) && $user->create()) {
         $this->updateUser($user->id, BUser::getAuthName('ROLE_MEMBER'));
         \Yii::$app->getSession()->setFlash('success', \Yii::t('user', 'User has been created'));
         return $this->redirect(['index']);
     }
     return $this->render('create', ['user' => $user]);
 }