Beispiel #1
0
 public function actionSignup()
 {
     $model = new SignupForm($this->module->defaultRole);
     if ($model->load(Yii::$app->request->post())) {
         if ($user = $model->signup()) {
             Yii::$app->getSession()->setFlash('success', Module::t('module', 'FLASH_EMAIL_CONFIRM_REQUEST'));
             return $this->goHome();
         }
     }
     return $this->render('signup', ['model' => $model]);
 }
Beispiel #2
0
 public function actionSignup()
 {
     if (Yii::$app->params['signUp']) {
         $model = new SignupForm($this->module->defaultRole);
         if ($model->load(Yii::$app->request->post())) {
             if ($user = $model->signup()) {
                 Yii::$app->getSession()->setFlash('success', Module::t('module', 'FLASH_EMAIL_CONFIRM_REQUEST'));
                 return $this->goHome();
             }
         }
         return $this->render('signup', ['model' => $model]);
     } else {
         throw new ForbiddenHttpException('У вас нет права доступа к этой странице.');
     }
 }
Beispiel #3
0
 public function testNotCorrectSignup()
 {
     $model = new SignupForm('user', ['username' => 'admin', 'email' => '*****@*****.**', 'password' => 'some_password', 'verifyCode' => 'testme']);
     expect('username and email are in use, user should not be created', $model->signup())->null();
 }