Ejemplo n.º 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]);
 }
Ejemplo n.º 2
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();
 }