Exemple #1
0
 public function action_register()
 {
     if ($this->logged === TRUE) {
         header('Location: /');
         exit;
     }
     $model_Auth = new Model_Auth();
     // obsluga formularza
     if (isset($_POST['send'])) {
         $valid = $model_Auth->registerValidation($_POST);
         if ($valid === TRUE) {
             $model_Auth->createAccount($_POST);
         }
     }
     // wybieram widok
     $this->view = View::factory('template');
     // ustawiam dane w widoku
     $this->view->title = 'Zarejestruj się';
     $this->view->content = View::factory('auth/register');
     $this->view->content->valid = $valid;
 }