Esempio n. 1
0
 /**
  * Sign up Action
  *
  * @package     base-app
  * @version     2.0
  */
 public function signupAction()
 {
     if ($this->request->isPost() == TRUE) {
         $user = new Users();
         $signup = $user->signup();
         if ($signup instanceof Users) {
             $this->flashSession->notice($this->tag->linkTo(array('#', 'class' => 'close', 'title' => __("Close"), '×')) . '<strong>' . __('Success') . '!</strong> ' . __("Check Email to activate your account."));
         } else {
             $this->view->setVar('errors', $signup);
             $this->flashSession->warning($this->tag->linkTo(array('#', 'class' => 'close', 'title' => __("Close"), '×')) . '<strong>' . __('Warning') . '!</strong> ' . __("Please correct the errors."));
         }
     }
 }
Esempio n. 2
0
    /**
     * Sign up Action
     */
    public function signupAction()
    {
        if ($this->auth->logged_in()) {
            return $this->response->redirect('user/');
        }
        $this->tag->setTitle('Join');
        $this->assets->addJs('js/forms.js');
        // display Recaptcha in form
        /*if ($this->config->recaptcha->enabled == '1') {
              $recap = \Baseapp\Library\Recaptcha::get($this->config->recaptcha->public);
              $this->view->setVar('recap', $recap);
          }*/
        if ($this->request->isPost() == TRUE) {
            $user = new Users();
            $signup = $user->signup();
            if ($signup instanceof Users) {
                $this->flashSession->success('<i class="close icon"></i>
<div class="header">' . __('Welcome') . '!</div> ' . __("Your account has been setup."));
                return $this->response->redirect("user/");
            } else {
                $this->view->setVar('errors', $signup);
                $this->flashSession->error('<i class="close icon"></i><div class="header">' . __('Error') . '!</div> ' . __("Please correct the errors."));
            }
        }
    }