summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.zfproject.xml18
-rw-r--r--application/controllers/AuthController.php53
-rw-r--r--application/controllers/PersonController.php28
-rw-r--r--application/forms/AuthRegister.php (renamed from application/forms/PersonRegister.php)2
-rw-r--r--application/views/scripts/auth/delete-account.phtml1
-rw-r--r--application/views/scripts/auth/logout.phtml1
-rw-r--r--application/views/scripts/auth/recover-password.phtml1
-rw-r--r--application/views/scripts/auth/register.phtml (renamed from application/views/scripts/person/register.phtml)0
8 files changed, 71 insertions, 33 deletions
diff --git a/.zfproject.xml b/.zfproject.xml
index 2fab999..64456bf 100644
--- a/.zfproject.xml
+++ b/.zfproject.xml
@@ -15,10 +15,13 @@
<controllerFile controllerName="Auth">
<actionMethod actionName="index"/>
<actionMethod actionName="login"/>
+ <actionMethod actionName="register"/>
+ <actionMethod actionName="logout"/>
+ <actionMethod actionName="recoverPassword"/>
+ <actionMethod actionName="deleteAccount"/>
</controllerFile>
<controllerFile controllerName="Person">
<actionMethod actionName="index"/>
- <actionMethod actionName="register"/>
</controllerFile>
</controllersDirectory>
<formsDirectory>
@@ -112,11 +115,20 @@
<viewControllerScriptsDirectory forControllerName="Auth">
<viewScriptFile forActionName="login"/>
</viewControllerScriptsDirectory>
+ <viewControllerScriptsDirectory forControllerName="Auth">
+ <viewScriptFile forActionName="register"/>
+ </viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Person">
<viewScriptFile forActionName="index"/>
</viewControllerScriptsDirectory>
- <viewControllerScriptsDirectory forControllerName="Person">
- <viewScriptFile forActionName="register"/>
+ <viewControllerScriptsDirectory forControllerName="Auth">
+ <viewScriptFile forActionName="logout"/>
+ </viewControllerScriptsDirectory>
+ <viewControllerScriptsDirectory forControllerName="Auth">
+ <viewScriptFile forActionName="recoverPassword"/>
+ </viewControllerScriptsDirectory>
+ <viewControllerScriptsDirectory forControllerName="Auth">
+ <viewScriptFile forActionName="deleteAccount"/>
</viewControllerScriptsDirectory>
</viewScriptsDirectory>
<viewHelpersDirectory/>
diff --git a/application/controllers/AuthController.php b/application/controllers/AuthController.php
index cc0bca2..588ffe3 100644
--- a/application/controllers/AuthController.php
+++ b/application/controllers/AuthController.php
@@ -2,10 +2,11 @@
class AuthController extends Zend_Controller_Action
{
+
public function loginAction()
- {
+ {
$db = Zend_Db_Table::getDefaultAdapter();
-
+
if (!isset($_POST["login"])){
$loginForm = new Application_Form_AuthLogin();
} else {
@@ -44,4 +45,52 @@ class AuthController extends Zend_Controller_Action
$this->view->loginForm = $loginForm;
}
+
+ public function registerAction()
+ {
+ $db = Zend_Db_Table::getDefaultAdapter();
+
+ if (!isset($_POST["register"])){
+ $registerForm = new Application_Form_AuthRegister();
+ } else {
+ $registerForm = new Application_Form_AuthRegister($_POST);
+
+ if ($registerForm->isValid($_POST)) {
+ $person = new Application_Model_Person($_POST);
+ if ($person != null) {
+ echo "Erfolgreich registriert";
+ # var_dump($person);
+ //$this->_redirect('/auth/login');
+ return;
+ } else {
+ echo "Die angegebene Email-Adresse existiert bereits";
+ }
+ }
+ }
+
+ $this->view->registerForm = $registerForm;
+ }
+
+ public function logoutAction()
+ {
+ // action body
+ }
+
+ public function recoverPasswordAction()
+ {
+ // action body
+ }
+
+ public function deleteAccountAction()
+ {
+ // action body
+ }
+
+
}
+
+
+
+
+
+
diff --git a/application/controllers/PersonController.php b/application/controllers/PersonController.php
index 65a4cca..986117a 100644
--- a/application/controllers/PersonController.php
+++ b/application/controllers/PersonController.php
@@ -18,33 +18,7 @@ class PersonController extends Zend_Controller_Action
// action body
}
- public function registerAction()
- {
- $db = Zend_Db_Table::getDefaultAdapter();
-
- 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";
- }
- }
- }
-
- $this->view->registerForm = $registerForm;
-
- }
+
}
diff --git a/application/forms/PersonRegister.php b/application/forms/AuthRegister.php
index 0babb27..7cb6ef4 100644
--- a/application/forms/PersonRegister.php
+++ b/application/forms/AuthRegister.php
@@ -1,6 +1,6 @@
<?php
-class Application_Form_PersonRegister extends Zend_Form
+class Application_Form_AuthRegister extends Zend_Form
{
public function init()
diff --git a/application/views/scripts/auth/delete-account.phtml b/application/views/scripts/auth/delete-account.phtml
new file mode 100644
index 0000000..3b7085d
--- /dev/null
+++ b/application/views/scripts/auth/delete-account.phtml
@@ -0,0 +1 @@
+<br /><br /><center>View script for controller <b>Auth</b> and script/action name <b>deleteAccount</b></center> \ No newline at end of file
diff --git a/application/views/scripts/auth/logout.phtml b/application/views/scripts/auth/logout.phtml
new file mode 100644
index 0000000..a709bd9
--- /dev/null
+++ b/application/views/scripts/auth/logout.phtml
@@ -0,0 +1 @@
+<br /><br /><center>View script for controller <b>Auth</b> and script/action name <b>logout</b></center> \ No newline at end of file
diff --git a/application/views/scripts/auth/recover-password.phtml b/application/views/scripts/auth/recover-password.phtml
new file mode 100644
index 0000000..e133420
--- /dev/null
+++ b/application/views/scripts/auth/recover-password.phtml
@@ -0,0 +1 @@
+<br /><br /><center>View script for controller <b>Auth</b> and script/action name <b>recoverPassword</b></center> \ No newline at end of file
diff --git a/application/views/scripts/person/register.phtml b/application/views/scripts/auth/register.phtml
index 5196738..5196738 100644
--- a/application/views/scripts/person/register.phtml
+++ b/application/views/scripts/auth/register.phtml