示例#1
0
 public function actionIndex()
 {
     if (!config('register.allow')) {
         throw new CHttpException(404, Yii::t('main', 'Регистрация отключена.'));
     }
     $formModel = new RegisterForm();
     if (!$formModel->gs_list) {
         throw new CHttpException(404, Yii::t('main', 'Регистрация невозможна из за отсутствия серверов.'));
     }
     if (isset($_POST['RegisterForm'])) {
         $formModel->setAttributes($_POST['RegisterForm']);
         if ($formModel->validate()) {
             $formModel->registerAccount();
             $this->refresh();
         }
     }
     $this->render('//register', array('model' => $formModel));
 }