summaryrefslogtreecommitdiffstats
path: root/application/controllers/PersonController.php
diff options
context:
space:
mode:
authormentos2011-01-31 15:10:18 +0100
committermentos2011-01-31 15:10:18 +0100
commit42ad274c226cad0856b0bc8e040e7a36aee43b8a (patch)
tree85f649573cbb8a74608fac50c742a26fea7ab6a1 /application/controllers/PersonController.php
parentMerge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff)
downloadpbs2-42ad274c226cad0856b0bc8e040e7a36aee43b8a.tar.gz
pbs2-42ad274c226cad0856b0bc8e040e7a36aee43b8a.tar.xz
pbs2-42ad274c226cad0856b0bc8e040e7a36aee43b8a.zip
Personen registrierung
Diffstat (limited to 'application/controllers/PersonController.php')
-rw-r--r--application/controllers/PersonController.php49
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;
+
}
}
+
+