/**
  * @inheritdoc
  */
 public function actionRegister()
 {
     $model = new RegisterForm();
     if ($model->load(Yii::$app->request->post()) && $model->validate()) {
         $registerStatus = $model->register();
     } else {
         return $this->render('register', ['model' => $model]);
     }
 }
Example #2
0
 /**
  * @inheritdoc
  */
 public function actionRegister()
 {
     $model = new RegisterForm();
     if ($model->load(Yii::$app->request->post()) && $model->validate()) {
         $model->RegisterType = 3;
         $registerStatus = $model->register();
         Yii::$app->getSession()->setFlash('success', 'Successfully Registered.');
         // 	if ($model->sendEmail()) {
         //                 Yii::$app->getSession()->setFlash('success', 'Successfully Registered.');
         //             } else {
         //                 Yii::$app->getSession()->setFlash('error', 'Sorry, we are unable to reset password for email provided.');
         //             }
         //echo "Registration successfully";
         return $this->render('register', ['model' => $model]);
     }
     return $this->render('register', ['model' => $model]);
 }
 /**
  * /register
  *
  * @return string|\yii\web\Response
  */
 public function actionIndex()
 {
     if ($this->member) {
         return $this->goHome();
     }
     if (!$this->params['registrationsOpen']) {
         $this->notifyError('Registrations are currently closed');
         return $this->goHome();
     }
     $model = new RegisterForm();
     $errors = null;
     if ($this->request->method == 'POST') {
         // populate model attributes with user inputs
         $model->load($this->request->post());
         if ($model->validate() && $model->register()) {
             $this->notifySuccess('Complete your registration by opening the email sent to ' . $model->email);
             return $this->redirect('/login');
         } else {
             // validation failed: $errors is an array containing error messages
             $errors = $model->errors;
         }
     }
     return $this->render('index', ['model' => $model, 'errors' => $errors]);
 }
Example #4
0
 public function actionRegister()
 {
     $model = new RegisterForm();
     if ($model->load(Yii::$app->request->post()) && $model->validate()) {
         return $this->render('congratulations');
     }
     return $this->render('register', ['model' => $model]);
 }