From 42ad274c226cad0856b0bc8e040e7a36aee43b8a Mon Sep 17 00:00:00 2001 From: mentos Date: Mon, 31 Jan 2011 15:10:18 +0100 Subject: Personen registrierung --- application/controllers/PersonController.php | 49 +++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 9 deletions(-) (limited to 'application/controllers/PersonController.php') diff --git a/application/controllers/PersonController.php b/application/controllers/PersonController.php index 9a8aea2..05177c3 100644 --- a/application/controllers/PersonController.php +++ b/application/controllers/PersonController.php @@ -1,26 +1,57 @@ hasIdentity()) { - echo 'case1'; - + if (!Zend_Auth::getInstance()->hasIdentity()) { + + echo 'case1'; + + + echo "already logged in as: " . Zend_Auth::getInstance()->getIdentity(); + #$this->_redirect($this->url(array('Auth','login'))); + } + echo 'case2'; + // action body + } + + public function registerAction() + { + $db = Zend_Db_Table::getDefaultAdapter(); - echo "already logged in as: " . Zend_Auth::getInstance()->getIdentity(); - #$this->_redirect($this->url(array('Auth','login'))); + if (!isset($_POST["register"])){ + $registerForm = new Application_Form_PersonRegister(); + } else { + $registerForm = new Application_Form_PersonRegister($_POST); + + if ($registerForm->isValid($_POST)) { + $person = new Application_Model_Person($_POST); + var + if ($person != null) { + echo "Erfolgreich registriert"; + var_dump($person); + var + //$this->_redirect('/auth/login'); + return; + } else { + echo "Die angegebene Email-Adresse existiert bereits"; + } + } } - echo 'case2'; - // action body + + $this->view->registerForm = $registerForm; + } } + + -- cgit v1.2.3-55-g7522