diff options
Diffstat (limited to 'application/controllers/PersonController.php')
| -rw-r--r-- | application/controllers/PersonController.php | 49 |
1 files changed, 40 insertions, 9 deletions
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 @@ <?php class PersonController extends Zend_Controller_Action -{ +{ public function init() { - + } public function indexAction() { - if (!Zend_Auth::getInstance()->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; + } } + + |
