summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Geiger2011-03-28 16:51:10 +0200
committerBjörn Geiger2011-03-28 16:51:10 +0200
commit04c69f27f49c3f40888ee4938388413b07ad5e09 (patch)
tree4c4300fa8ecfcbab7eb29243dd9bb5d8d4447471
parentMerge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff)
downloadpbs2-04c69f27f49c3f40888ee4938388413b07ad5e09.tar.gz
pbs2-04c69f27f49c3f40888ee4938388413b07ad5e09.tar.xz
pbs2-04c69f27f49c3f40888ee4938388413b07ad5e09.zip
überschriften hinzugefügt, andere Fehler korrigiert
-rw-r--r--.zfproject.xml7
-rw-r--r--application/modules/dev/controllers/AuthController.php40
-rw-r--r--application/modules/dev/forms/AuthRecoverPassword.php2
-rw-r--r--application/modules/dev/forms/ConfirmDeleteAccount.php27
-rw-r--r--application/modules/dev/forms/GroupAdd.php2
-rw-r--r--application/modules/dev/forms/GroupEdit.php2
-rw-r--r--application/modules/dev/forms/GroupLink.php4
-rw-r--r--application/modules/dev/forms/GroupRequest.php2
-rw-r--r--application/modules/dev/forms/GroupSelect.php2
-rw-r--r--application/modules/dev/forms/LinkRight.php4
-rw-r--r--application/modules/dev/forms/PersonEdit.php2
-rw-r--r--application/modules/dev/forms/RoleAdd.php2
-rw-r--r--application/modules/dev/forms/RoleEdit.php2
-rw-r--r--application/modules/dev/layouts/dev.phtml2
-rw-r--r--application/modules/dev/views/scripts/auth/delete.phtml6
-rw-r--r--application/modules/dev/views/scripts/auth/login.phtml1
-rw-r--r--application/modules/dev/views/scripts/auth/recoverpassword.phtml1
-rw-r--r--application/modules/dev/views/scripts/auth/register.phtml1
-rw-r--r--application/modules/dev/views/scripts/group/add.phtml1
-rw-r--r--application/modules/dev/views/scripts/group/edit.phtml1
-rw-r--r--application/modules/dev/views/scripts/group/link.phtml1
-rw-r--r--application/modules/dev/views/scripts/person/edit.phtml1
-rw-r--r--application/modules/dev/views/scripts/person/request.phtml1
-rw-r--r--application/modules/dev/views/scripts/role/add.phtml1
-rw-r--r--application/modules/dev/views/scripts/role/edit.phtml1
-rw-r--r--application/modules/dev/views/scripts/role/groupselect.phtml1
-rw-r--r--application/modules/dev/views/scripts/role/linkright.phtml1
-rw-r--r--application/modules/fbgui/forms/MembershipSelect.php2
-rw-r--r--application/modules/fbgui/views/scripts/auth/login.phtml1
-rw-r--r--application/modules/fbgui/views/scripts/auth/selectmembership.phtml1
-rw-r--r--application/modules/user/controllers/AuthController.php40
-rw-r--r--application/modules/user/controllers/RoleController.php1
-rw-r--r--application/modules/user/forms/ConfirmDeleteAccount.php27
-rw-r--r--application/modules/user/forms/GroupAdd.php2
-rw-r--r--application/modules/user/forms/GroupEdit.php24
-rw-r--r--application/modules/user/forms/GroupLink.php2
-rw-r--r--application/modules/user/forms/GroupRequest.php4
-rw-r--r--application/modules/user/forms/LinkRight.php4
-rw-r--r--application/modules/user/forms/MembershipSelect.php2
-rw-r--r--application/modules/user/forms/PersonEdit.php2
-rw-r--r--application/modules/user/forms/RecoverPassword.php2
-rw-r--r--application/modules/user/forms/RoleAdd.php2
-rw-r--r--application/modules/user/forms/RoleEdit.php15
-rw-r--r--application/modules/user/layouts/user.phtml2
-rw-r--r--application/modules/user/views/scripts/auth/delete.phtml6
-rw-r--r--application/modules/user/views/scripts/auth/login.phtml1
-rw-r--r--application/modules/user/views/scripts/auth/recoverpassword.phtml1
-rw-r--r--application/modules/user/views/scripts/auth/register.phtml1
-rw-r--r--application/modules/user/views/scripts/group/add.phtml1
-rw-r--r--application/modules/user/views/scripts/group/edit.phtml1
-rw-r--r--application/modules/user/views/scripts/group/link.phtml1
-rw-r--r--application/modules/user/views/scripts/group/show.phtml9
-rw-r--r--application/modules/user/views/scripts/person/edit.phtml1
-rw-r--r--application/modules/user/views/scripts/person/request.phtml1
-rw-r--r--application/modules/user/views/scripts/person/selectmembership.phtml1
-rw-r--r--application/modules/user/views/scripts/role/add.phtml1
-rw-r--r--application/modules/user/views/scripts/role/edit.phtml1
-rw-r--r--application/modules/user/views/scripts/role/linkright.phtml1
-rw-r--r--application/modules/user/views/scripts/role/show.phtml10
59 files changed, 189 insertions, 99 deletions
diff --git a/.zfproject.xml b/.zfproject.xml
index 35860e2..588998d 100644
--- a/.zfproject.xml
+++ b/.zfproject.xml
@@ -198,6 +198,7 @@
<formFile formName="GroupEdit"/>
<formFile formName="GroupAdd"/>
<formFile formName="GroupLink"/>
+ <formFile formName="ConfirmDeleteAccount"/>
</formsDirectory>
<layoutsDirectory enabled="false"/>
<modelsDirectory>
@@ -358,8 +359,10 @@
<viewScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Index">
<viewScriptFile forActionName="index"/>
+ </viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Auth">
<viewScriptFile forActionName="login"/>
+ </viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Auth">
<viewScriptFile forActionName="selectmembership"/>
</viewControllerScriptsDirectory>
@@ -520,6 +523,7 @@
<formFile formName="LinkRight"/>
<formFile formName="RoleAdd"/>
<formFile formName="NewPassword"/>
+ <formFile formName="ConfirmDeleteAccount"/>
</formsDirectory>
<layoutsDirectory enabled="false"/>
<modelsDirectory>
@@ -543,6 +547,9 @@
<viewScriptFile forActionName="register"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Auth">
+ <viewScriptFile forActionName="delete"/>
+ </viewControllerScriptsDirectory>
+ <viewControllerScriptsDirectory forControllerName="Auth">
<viewScriptFile forActionName="recoverpassword"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="Bootos">
diff --git a/application/modules/dev/controllers/AuthController.php b/application/modules/dev/controllers/AuthController.php
index 0edb78c..078a4cf 100644
--- a/application/modules/dev/controllers/AuthController.php
+++ b/application/modules/dev/controllers/AuthController.php
@@ -207,25 +207,31 @@ class dev_AuthController extends Zend_Controller_Action
public function deleteAction()
{
- $this->_helper-> viewRenderer-> setNoRender();
- $result = $this->personmapper->findBy('email', Zend_Auth::getInstance()->getIdentity());
- $person = $result[0];
- $personID = $person["personID"];
- if (isset($personID)){
- $this->personmapper = new Application_Model_PersonMapper();
- $person = $this->personmapper->find($personID);
- try {
- $this->personmapper->delete($person);
- }catch(Zend_Exception $e)
- {
- echo "Caught exception: " . get_class($e) . "<br/>";
- echo "Message: " . $e->getMessage() . "<br/>";
+ if($_POST['confirmdelete']) {
+ $auth = Zend_Auth::getInstance();
+ $result = $this->personmapper->findBy('email', $auth->getIdentity());
+ $person = $result[0];
+ $personID = $person["personID"];
+ if (isset($personID)){
+ $this->personmapper = new Application_Model_PersonMapper();
+ $person = $this->personmapper->find($personID);
+ try {
+ $this->personmapper->delete($person);
+ }catch(Zend_Exception $e)
+ {
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ return;
+ }
+ $auth->clearIdentity();
+ Zend_Session::namespaceUnset('userIDs');
+ Zend_Session::forgetMe();
+ $this->_helper->redirector('login', 'auth');
return;
}
- $auth = Zend_Auth::getInstance();
- $auth->clearIdentity();
- $this->_helper->redirector('login', 'auth');
- return;
+ } else {
+ $deleteconfirmform = new dev_Form_ConfirmDeleteAccount();
+ $this->view->deleteconfirmform = $deleteconfirmform;
}
}
}
diff --git a/application/modules/dev/forms/AuthRecoverPassword.php b/application/modules/dev/forms/AuthRecoverPassword.php
index a1de7ea..35779fc 100644
--- a/application/modules/dev/forms/AuthRecoverPassword.php
+++ b/application/modules/dev/forms/AuthRecoverPassword.php
@@ -19,7 +19,7 @@ class dev_Form_AuthRecoverPassword extends Zend_Form
$this->addElement('submit', 'recoverPassword', array(
'required' => false,
'ignore' => true,
- 'label' => 'Recover Password',
+ 'label' => 'Recover',
));
}
diff --git a/application/modules/dev/forms/ConfirmDeleteAccount.php b/application/modules/dev/forms/ConfirmDeleteAccount.php
new file mode 100644
index 0000000..c093996
--- /dev/null
+++ b/application/modules/dev/forms/ConfirmDeleteAccount.php
@@ -0,0 +1,27 @@
+<?php
+
+class dev_Form_ConfirmDeleteAccount extends Zend_Form
+{
+
+ public function init()
+ {
+ $this->setName("ConfirmDeleteAccount");
+ $this->setMethod('post');
+
+ $this->addElement('submit', 'confirmdelete', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Confirm',
+ ));
+
+ $this->addElement('button', 'cancel', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Cancel',
+ 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"',
+ ));
+ }
+
+
+}
+
diff --git a/application/modules/dev/forms/GroupAdd.php b/application/modules/dev/forms/GroupAdd.php
index a235b56..8132f3a 100644
--- a/application/modules/dev/forms/GroupAdd.php
+++ b/application/modules/dev/forms/GroupAdd.php
@@ -56,7 +56,7 @@ class dev_Form_GroupAdd extends Zend_Form
'required' => false,
'ignore' => true,
'label' => 'Cancel',
- 'onclick' => 'location.href="/dev/group/"',
+ 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"',
));
}
diff --git a/application/modules/dev/forms/GroupEdit.php b/application/modules/dev/forms/GroupEdit.php
index f2f51a4..96784de 100644
--- a/application/modules/dev/forms/GroupEdit.php
+++ b/application/modules/dev/forms/GroupEdit.php
@@ -39,7 +39,7 @@ class dev_Form_GroupEdit extends Zend_Form
'required' => false,
'ignore' => true,
'label' => 'Cancel',
- 'onclick' => 'location.href="/dev/group/"',
+ 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"',
));
}
diff --git a/application/modules/dev/forms/GroupLink.php b/application/modules/dev/forms/GroupLink.php
index 81c2dbe..8a65e77 100644
--- a/application/modules/dev/forms/GroupLink.php
+++ b/application/modules/dev/forms/GroupLink.php
@@ -24,7 +24,7 @@ class dev_Form_GroupLink extends Zend_Form
}
$groupfield->setRegisterInArrayValidator(false);
$this->addElement($groupfield);
-
+
$groupfield1 = $this->createElement('select','superordinatedGroupID');
$groupfield1 ->setLabel('superordinated Group:');
@@ -46,7 +46,7 @@ class dev_Form_GroupLink extends Zend_Form
'required' => false,
'ignore' => true,
'label' => 'Cancel',
- 'onclick' => 'location.href="/dev/group/"',
+ 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"',
));
}
diff --git a/application/modules/dev/forms/GroupRequest.php b/application/modules/dev/forms/GroupRequest.php
index efaafaf..2c12aaf 100644
--- a/application/modules/dev/forms/GroupRequest.php
+++ b/application/modules/dev/forms/GroupRequest.php
@@ -33,7 +33,7 @@ class dev_Form_GroupRequest extends Zend_Form
$this->addElement('submit', 'request', array(
'required' => false,
'ignore' => true,
- 'label' => 'Request Membership',
+ 'label' => 'Request',
));
}
diff --git a/application/modules/dev/forms/GroupSelect.php b/application/modules/dev/forms/GroupSelect.php
index 1eaf455..be28997 100644
--- a/application/modules/dev/forms/GroupSelect.php
+++ b/application/modules/dev/forms/GroupSelect.php
@@ -33,7 +33,7 @@ class dev_Form_GroupSelect extends Zend_Form
$this->addElement('submit', 'selectgroup', array(
'required' => false,
'ignore' => true,
- 'label' => 'Select Group',
+ 'label' => 'Select',
));
}
diff --git a/application/modules/dev/forms/LinkRight.php b/application/modules/dev/forms/LinkRight.php
index 8b9c3a9..0745791 100644
--- a/application/modules/dev/forms/LinkRight.php
+++ b/application/modules/dev/forms/LinkRight.php
@@ -32,14 +32,14 @@ class dev_Form_LinkRight extends Zend_Form
$this->addElement('submit', 'link', array(
'required' => false,
'ignore' => true,
- 'label' => 'Add Right',
+ 'label' => 'Add',
));
$this->addElement('button', 'cancel', array(
'required' => false,
'ignore' => true,
'label' => 'Cancel',
- 'onclick' => 'location.href="/dev/role/show/roleID/' . $this->roleID . '"',
+ 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"',
));
}
diff --git a/application/modules/dev/forms/PersonEdit.php b/application/modules/dev/forms/PersonEdit.php
index aa39c34..c04f418 100644
--- a/application/modules/dev/forms/PersonEdit.php
+++ b/application/modules/dev/forms/PersonEdit.php
@@ -108,7 +108,7 @@ class dev_Form_PersonEdit extends Zend_Form
'required' => false,
'ignore' => true,
'label' => 'Cancel',
- 'onclick' => 'location.href="/dev/person/"',
+ 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"',
));
}
diff --git a/application/modules/dev/forms/RoleAdd.php b/application/modules/dev/forms/RoleAdd.php
index 7aae426..6d43904 100644
--- a/application/modules/dev/forms/RoleAdd.php
+++ b/application/modules/dev/forms/RoleAdd.php
@@ -45,7 +45,7 @@ class dev_Form_RoleAdd extends Zend_Form
'required' => false,
'ignore' => true,
'label' => 'Cancel',
- 'onclick' => 'location.href="/dev/role/"',
+ 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"',
));
}
diff --git a/application/modules/dev/forms/RoleEdit.php b/application/modules/dev/forms/RoleEdit.php
index c0617b7..1a9afc5 100644
--- a/application/modules/dev/forms/RoleEdit.php
+++ b/application/modules/dev/forms/RoleEdit.php
@@ -53,7 +53,7 @@ class dev_Form_RoleEdit extends Zend_Form
'required' => false,
'ignore' => true,
'label' => 'Cancel',
- 'onclick' => 'location.href="/dev/role/"',
+ 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"',
));
}
diff --git a/application/modules/dev/layouts/dev.phtml b/application/modules/dev/layouts/dev.phtml
index b9bd27a..944c617 100644
--- a/application/modules/dev/layouts/dev.phtml
+++ b/application/modules/dev/layouts/dev.phtml
@@ -43,7 +43,7 @@ echo $this->headScript()."\n";
<li class='navTreeItem'><a href='/dev/auth/register'>Register</a></li>
<?php
} else {?>
- <li class='navTreeItem'><a href='/dev/auth/delete'>Account Löschen</a></li>
+ <li class='navTreeItem'><a href='/dev/auth/delete'>Delete Account</a></li>
<li class='navTreeItem'><a href='/dev/auth/logout'>Logout</a></li>
<?php
}
diff --git a/application/modules/dev/views/scripts/auth/delete.phtml b/application/modules/dev/views/scripts/auth/delete.phtml
new file mode 100644
index 0000000..62bf24e
--- /dev/null
+++ b/application/modules/dev/views/scripts/auth/delete.phtml
@@ -0,0 +1,6 @@
+<h1>Delete Account</h1>
+Do you really want to delete this account?
+<?php
+$this->deleteconfirmform->setAction($this->url());
+echo $this->deleteconfirmform;
+?> \ No newline at end of file
diff --git a/application/modules/dev/views/scripts/auth/login.phtml b/application/modules/dev/views/scripts/auth/login.phtml
index 815cda4..e22bd0b 100644
--- a/application/modules/dev/views/scripts/auth/login.phtml
+++ b/application/modules/dev/views/scripts/auth/login.phtml
@@ -1,3 +1,4 @@
+<h1>Login</h1>
<?php
$this->loginForm->setAction($this->url());
echo $this->loginForm;
diff --git a/application/modules/dev/views/scripts/auth/recoverpassword.phtml b/application/modules/dev/views/scripts/auth/recoverpassword.phtml
index 881e00e..089aec3 100644
--- a/application/modules/dev/views/scripts/auth/recoverpassword.phtml
+++ b/application/modules/dev/views/scripts/auth/recoverpassword.phtml
@@ -1,3 +1,4 @@
+<h1>Recover Password</h1>
<?php
$this->recoverPasswordForm->setAction($this->url());
echo $this->recoverPasswordForm;
diff --git a/application/modules/dev/views/scripts/auth/register.phtml b/application/modules/dev/views/scripts/auth/register.phtml
index 5196738..74c7df5 100644
--- a/application/modules/dev/views/scripts/auth/register.phtml
+++ b/application/modules/dev/views/scripts/auth/register.phtml
@@ -1,3 +1,4 @@
+<h1>New Account</h1>
<?php
$this->registerForm->setAction($this->url());
echo $this->registerForm;
diff --git a/application/modules/dev/views/scripts/group/add.phtml b/application/modules/dev/views/scripts/group/add.phtml
index 4f96cf0..588ce31 100644
--- a/application/modules/dev/views/scripts/group/add.phtml
+++ b/application/modules/dev/views/scripts/group/add.phtml
@@ -1,3 +1,4 @@
+<h1>Add Group</h1>
<?php
$this->addForm->setAction($this->url());
echo $this->addForm;
diff --git a/application/modules/dev/views/scripts/group/edit.phtml b/application/modules/dev/views/scripts/group/edit.phtml
index a0f9b32..6b042e1 100644
--- a/application/modules/dev/views/scripts/group/edit.phtml
+++ b/application/modules/dev/views/scripts/group/edit.phtml
@@ -1,3 +1,4 @@
+<h1>Edit Group</h1>
<?php
if(isset($this->addForm)) {
$this->addForm->setAction('/dev/group/add');
diff --git a/application/modules/dev/views/scripts/group/link.phtml b/application/modules/dev/views/scripts/group/link.phtml
index 94ad343..5bb2a9d 100644
--- a/application/modules/dev/views/scripts/group/link.phtml
+++ b/application/modules/dev/views/scripts/group/link.phtml
@@ -1,3 +1,4 @@
+<h1>Link Groups</h1>
<?php
$this->linkForm->setAction($this->url());
echo $this->linkForm;
diff --git a/application/modules/dev/views/scripts/person/edit.phtml b/application/modules/dev/views/scripts/person/edit.phtml
index 955ed35..3e666d4 100644
--- a/application/modules/dev/views/scripts/person/edit.phtml
+++ b/application/modules/dev/views/scripts/person/edit.phtml
@@ -1,3 +1,4 @@
+<h1>Edit Person</h1>
<?php
$this->editForm->setAction($this->url());
echo $this->editForm;
diff --git a/application/modules/dev/views/scripts/person/request.phtml b/application/modules/dev/views/scripts/person/request.phtml
index 2da570f..91a625b 100644
--- a/application/modules/dev/views/scripts/person/request.phtml
+++ b/application/modules/dev/views/scripts/person/request.phtml
@@ -1,3 +1,4 @@
+<h1>Request Membership</h1>
<?php
if(count($this->requestForm->getGrouplist())>0) {
$this->requestForm->setAction($this->url());
diff --git a/application/modules/dev/views/scripts/role/add.phtml b/application/modules/dev/views/scripts/role/add.phtml
index 4f96cf0..23d4c55 100644
--- a/application/modules/dev/views/scripts/role/add.phtml
+++ b/application/modules/dev/views/scripts/role/add.phtml
@@ -1,3 +1,4 @@
+<h1>Add Role</h1>
<?php
$this->addForm->setAction($this->url());
echo $this->addForm;
diff --git a/application/modules/dev/views/scripts/role/edit.phtml b/application/modules/dev/views/scripts/role/edit.phtml
index c976a90..59482f0 100644
--- a/application/modules/dev/views/scripts/role/edit.phtml
+++ b/application/modules/dev/views/scripts/role/edit.phtml
@@ -1,3 +1,4 @@
+<h1>Edit Role</h1>
<?php
if(isset($this->addForm)) {
$this->addForm->setAction('/etc/role/add');
diff --git a/application/modules/dev/views/scripts/role/groupselect.phtml b/application/modules/dev/views/scripts/role/groupselect.phtml
index fe81758..d1c08fd 100644
--- a/application/modules/dev/views/scripts/role/groupselect.phtml
+++ b/application/modules/dev/views/scripts/role/groupselect.phtml
@@ -1,3 +1,4 @@
+<h1>Select Group</h1>
<?php
$this->groupSelectForm->setAction($this->url());
echo $this->groupSelectForm;
diff --git a/application/modules/dev/views/scripts/role/linkright.phtml b/application/modules/dev/views/scripts/role/linkright.phtml
index 94ad343..38c0d45 100644
--- a/application/modules/dev/views/scripts/role/linkright.phtml
+++ b/application/modules/dev/views/scripts/role/linkright.phtml
@@ -1,3 +1,4 @@
+<h1>Add Right</h1>
<?php
$this->linkForm->setAction($this->url());
echo $this->linkForm;
diff --git a/application/modules/fbgui/forms/MembershipSelect.php b/application/modules/fbgui/forms/MembershipSelect.php
index 5b21fa7..6e03f7d 100644
--- a/application/modules/fbgui/forms/MembershipSelect.php
+++ b/application/modules/fbgui/forms/MembershipSelect.php
@@ -33,7 +33,7 @@ class fbgui_Form_MembershipSelect extends Zend_Form
$this->addElement('submit', 'selectmembership', array(
'required' => false,
'ignore' => true,
- 'label' => 'Select Membership',
+ 'label' => 'Select',
));
}
diff --git a/application/modules/fbgui/views/scripts/auth/login.phtml b/application/modules/fbgui/views/scripts/auth/login.phtml
index 17b1c16..9742c35 100644
--- a/application/modules/fbgui/views/scripts/auth/login.phtml
+++ b/application/modules/fbgui/views/scripts/auth/login.phtml
@@ -1,3 +1,4 @@
+<h1>Login</h1>
<?php
$this->loginForm->setAction($this->url());
echo $this->loginForm;
diff --git a/application/modules/fbgui/views/scripts/auth/selectmembership.phtml b/application/modules/fbgui/views/scripts/auth/selectmembership.phtml
index 2bfe4d6..5f7e5bf 100644
--- a/application/modules/fbgui/views/scripts/auth/selectmembership.phtml
+++ b/application/modules/fbgui/views/scripts/auth/selectmembership.phtml
@@ -1,3 +1,4 @@
+<h1>Select Membership</h1>
<?php
$this->membershipSelectForm->setAction($this->url());
echo $this->membershipSelectForm;
diff --git a/application/modules/user/controllers/AuthController.php b/application/modules/user/controllers/AuthController.php
index 13ad7f4..5d63b20 100644
--- a/application/modules/user/controllers/AuthController.php
+++ b/application/modules/user/controllers/AuthController.php
@@ -120,25 +120,31 @@ class User_AuthController extends Zend_Controller_Action
public function deleteAction()
{
- $this->_helper-> viewRenderer-> setNoRender();
- $result = $this->personmapper->findBy('email', Zend_Auth::getInstance()->getIdentity());
- $person = $result[0];
- $personID = $person["personID"];
- if (isset($personID)){
- $this->personmapper = new Application_Model_PersonMapper();
- $person = $this->personmapper->find($personID);
- try {
- $this->personmapper->delete($person);
- }catch(Zend_Exception $e)
- {
- echo "Caught exception: " . get_class($e) . "<br/>";
- echo "Message: " . $e->getMessage() . "<br/>";
+ if($_POST['confirmdelete']) {
+ $auth = Zend_Auth::getInstance();
+ $result = $this->personmapper->findBy('email', $auth->getIdentity());
+ $person = $result[0];
+ $personID = $person["personID"];
+ if (isset($personID)){
+ $this->personmapper = new Application_Model_PersonMapper();
+ $person = $this->personmapper->find($personID);
+ try {
+ $this->personmapper->delete($person);
+ }catch(Zend_Exception $e)
+ {
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ return;
+ }
+ $auth->clearIdentity();
+ Zend_Session::namespaceUnset('userIDs');
+ Zend_Session::forgetMe();
+ $this->_helper->redirector('login', 'auth');
return;
}
- $auth = Zend_Auth::getInstance();
- $auth->clearIdentity();
- $this->_helper->redirector('login', 'auth');
- return;
+ } else {
+ $deleteconfirmform = new user_Form_ConfirmDeleteAccount();
+ $this->view->deleteconfirmform = $deleteconfirmform;
}
}
diff --git a/application/modules/user/controllers/RoleController.php b/application/modules/user/controllers/RoleController.php
index d2491ff..9e118b2 100644
--- a/application/modules/user/controllers/RoleController.php
+++ b/application/modules/user/controllers/RoleController.php
@@ -125,6 +125,7 @@ class User_RoleController extends Zend_Controller_Action
}
$this->view->role = $this->roleMapper->find($roleID);
$this->view->roleID = $roleID;
+ $this->view->userIDsNamespace = $this->userIDsNamespace;
} else {
$this->_helper->redirector('', 'role');
return;
diff --git a/application/modules/user/forms/ConfirmDeleteAccount.php b/application/modules/user/forms/ConfirmDeleteAccount.php
new file mode 100644
index 0000000..7bf5a32
--- /dev/null
+++ b/application/modules/user/forms/ConfirmDeleteAccount.php
@@ -0,0 +1,27 @@
+<?php
+
+class user_Form_ConfirmDeleteAccount extends Zend_Form
+{
+
+ public function init()
+ {
+ $this->setName("ConfirmDeleteAccount");
+ $this->setMethod('post');
+
+ $this->addElement('submit', 'confirmdelete', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Confirm',
+ ));
+
+ $this->addElement('button', 'cancel', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Cancel',
+ 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"',
+ ));
+ }
+
+
+}
+
diff --git a/application/modules/user/forms/GroupAdd.php b/application/modules/user/forms/GroupAdd.php
index 47855de..ff2b97a 100644
--- a/application/modules/user/forms/GroupAdd.php
+++ b/application/modules/user/forms/GroupAdd.php
@@ -56,7 +56,7 @@ class user_Form_GroupAdd extends Zend_Form
'required' => false,
'ignore' => true,
'label' => 'Cancel',
- 'onclick' => 'location.href="/dev/group/"',
+ 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"',
));
}
diff --git a/application/modules/user/forms/GroupEdit.php b/application/modules/user/forms/GroupEdit.php
index 0da0f61..4f0d7fc 100644
--- a/application/modules/user/forms/GroupEdit.php
+++ b/application/modules/user/forms/GroupEdit.php
@@ -40,29 +40,11 @@ class user_Form_GroupEdit extends Zend_Form
'label' => 'Save',
));
- if(strpos($_SERVER['HTTP_REFERER'], '/user/group/show')) {
- if(strpos($_SERVER['HTTP_REFERER'], '/groupID/')) {
- $this->addElement('button', 'cancel', array(
+ $this->addElement('button', 'cancel', array(
'required' => false,
'ignore' => true,
'label' => 'Cancel',
- 'onclick' => 'location.href="/user/group/show/groupID/' . $this->groupID . '"',
- ));
- } else {
- $this->addElement('button', 'cancel', array(
- 'required' => false,
- 'ignore' => true,
- 'label' => 'Cancel',
- 'onclick' => 'location.href="/user/group/show/"',
- ));
- }
- } else {
- $this->addElement('button', 'cancel', array(
- 'required' => false,
- 'ignore' => true,
- 'label' => 'Cancel',
- 'onclick' => 'location.href="/user/group/showall"',
- ));
- }
+ 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"',
+ ));
}
} \ No newline at end of file
diff --git a/application/modules/user/forms/GroupLink.php b/application/modules/user/forms/GroupLink.php
index d2aafcc..9db7ce4 100644
--- a/application/modules/user/forms/GroupLink.php
+++ b/application/modules/user/forms/GroupLink.php
@@ -46,7 +46,7 @@ class user_Form_GroupLink extends Zend_Form
'required' => false,
'ignore' => true,
'label' => 'Cancel',
- 'onclick' => 'location.href="/user/group/"',
+ 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"',
));
}
diff --git a/application/modules/user/forms/GroupRequest.php b/application/modules/user/forms/GroupRequest.php
index 2cdada0..c9ba273 100644
--- a/application/modules/user/forms/GroupRequest.php
+++ b/application/modules/user/forms/GroupRequest.php
@@ -33,14 +33,14 @@ class user_Form_GroupRequest extends Zend_Form
$this->addElement('submit', 'request', array(
'required' => false,
'ignore' => true,
- 'label' => 'Request Membership',
+ 'label' => 'Request',
));
$this->addElement('button', 'cancel', array(
'required' => false,
'ignore' => true,
'label' => 'Cancel',
- 'onclick' => 'location.href="/user/person/"',
+ 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"',
));
}
diff --git a/application/modules/user/forms/LinkRight.php b/application/modules/user/forms/LinkRight.php
index 139aee4..a7b28b1 100644
--- a/application/modules/user/forms/LinkRight.php
+++ b/application/modules/user/forms/LinkRight.php
@@ -32,14 +32,14 @@ class user_Form_LinkRight extends Zend_Form
$this->addElement('submit', 'link', array(
'required' => false,
'ignore' => true,
- 'label' => 'Add Right',
+ 'label' => 'Add',
));
$this->addElement('button', 'cancel', array(
'required' => false,
'ignore' => true,
'label' => 'Cancel',
- 'onclick' => 'location.href="/user/role/show/roleID/' . $this->roleID . '"',
+ 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"',
));
}
diff --git a/application/modules/user/forms/MembershipSelect.php b/application/modules/user/forms/MembershipSelect.php
index fe6870a..b4b54c4 100644
--- a/application/modules/user/forms/MembershipSelect.php
+++ b/application/modules/user/forms/MembershipSelect.php
@@ -33,7 +33,7 @@ class user_Form_MembershipSelect extends Zend_Form
$this->addElement('submit', 'selectmembership', array(
'required' => false,
'ignore' => true,
- 'label' => 'Select Membership',
+ 'label' => 'Select',
));
}
diff --git a/application/modules/user/forms/PersonEdit.php b/application/modules/user/forms/PersonEdit.php
index d6c68e7..a6bd123 100644
--- a/application/modules/user/forms/PersonEdit.php
+++ b/application/modules/user/forms/PersonEdit.php
@@ -108,7 +108,7 @@ class user_Form_PersonEdit extends Zend_Form
'required' => false,
'ignore' => true,
'label' => 'Cancel',
- 'onclick' => 'location.href="/user/person/"',
+ 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"',
));
}
diff --git a/application/modules/user/forms/RecoverPassword.php b/application/modules/user/forms/RecoverPassword.php
index 90feb87..22a775f 100644
--- a/application/modules/user/forms/RecoverPassword.php
+++ b/application/modules/user/forms/RecoverPassword.php
@@ -19,7 +19,7 @@ class user_Form_RecoverPassword extends Zend_Form
$this->addElement('submit', 'recoverPassword', array(
'required' => false,
'ignore' => true,
- 'label' => 'Recover Password',
+ 'label' => 'Recover',
));
}
diff --git a/application/modules/user/forms/RoleAdd.php b/application/modules/user/forms/RoleAdd.php
index a7e43a7..e8e99a5 100644
--- a/application/modules/user/forms/RoleAdd.php
+++ b/application/modules/user/forms/RoleAdd.php
@@ -45,7 +45,7 @@ class user_Form_RoleAdd extends Zend_Form
'required' => false,
'ignore' => true,
'label' => 'Cancel',
- 'onclick' => 'location.href="/user/role/"',
+ 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"',
));
}
diff --git a/application/modules/user/forms/RoleEdit.php b/application/modules/user/forms/RoleEdit.php
index 848dba3..0bdc977 100644
--- a/application/modules/user/forms/RoleEdit.php
+++ b/application/modules/user/forms/RoleEdit.php
@@ -54,21 +54,12 @@ class user_Form_RoleEdit extends Zend_Form
'label' => 'Save',
));
- if(strpos($_SERVER['HTTP_REFERER'], '/user/role/show/roleID')) {
- $this->addElement('button', 'cancel', array(
+ $this->addElement('button', 'cancel', array(
'required' => false,
'ignore' => true,
'label' => 'Cancel',
- 'onclick' => 'location.href="/user/role/show/roleID/' . $this->roleID . '"',
- ));
- } else {
- $this->addElement('button', 'cancel', array(
- 'required' => false,
- 'ignore' => true,
- 'label' => 'Cancel',
- 'onclick' => 'location.href="/user/role/"',
- ));
- }
+ 'onclick' => 'location.href="' . $_SERVER['HTTP_REFERER'] . '"',
+ ));
}
diff --git a/application/modules/user/layouts/user.phtml b/application/modules/user/layouts/user.phtml
index e0c9961..c22811f 100644
--- a/application/modules/user/layouts/user.phtml
+++ b/application/modules/user/layouts/user.phtml
@@ -42,7 +42,7 @@ echo $this->headScript()."\n";
<li class='navTreeItem'><a href='/user/auth/register'>Register</a></li>
<?php
} else {?>
- <li class='navTreeItem'><a href='/user/auth/delete' onclick='var agree=confirm("Delete Your Account?");if (agree){ return true;}else{return false;}'>Account Löschen</a></li>
+ <li class='navTreeItem'><a href='/user/auth/delete'>Delete Account</a></li>
<li class='navTreeItem'><a href='/user/auth/logout'>Logout</a></li>
<?php
}
diff --git a/application/modules/user/views/scripts/auth/delete.phtml b/application/modules/user/views/scripts/auth/delete.phtml
new file mode 100644
index 0000000..62bf24e
--- /dev/null
+++ b/application/modules/user/views/scripts/auth/delete.phtml
@@ -0,0 +1,6 @@
+<h1>Delete Account</h1>
+Do you really want to delete this account?
+<?php
+$this->deleteconfirmform->setAction($this->url());
+echo $this->deleteconfirmform;
+?> \ No newline at end of file
diff --git a/application/modules/user/views/scripts/auth/login.phtml b/application/modules/user/views/scripts/auth/login.phtml
index d68d2af..899c6e7 100644
--- a/application/modules/user/views/scripts/auth/login.phtml
+++ b/application/modules/user/views/scripts/auth/login.phtml
@@ -1,3 +1,4 @@
+<h1>Login</h1>
<?php
$this->loginForm->setAction($this->url());
echo $this->loginForm;
diff --git a/application/modules/user/views/scripts/auth/recoverpassword.phtml b/application/modules/user/views/scripts/auth/recoverpassword.phtml
index 881e00e..089aec3 100644
--- a/application/modules/user/views/scripts/auth/recoverpassword.phtml
+++ b/application/modules/user/views/scripts/auth/recoverpassword.phtml
@@ -1,3 +1,4 @@
+<h1>Recover Password</h1>
<?php
$this->recoverPasswordForm->setAction($this->url());
echo $this->recoverPasswordForm;
diff --git a/application/modules/user/views/scripts/auth/register.phtml b/application/modules/user/views/scripts/auth/register.phtml
index 2033b04..6217e06 100644
--- a/application/modules/user/views/scripts/auth/register.phtml
+++ b/application/modules/user/views/scripts/auth/register.phtml
@@ -1,3 +1,4 @@
+<h1>New Account</h1>
<?php
$this->registerForm->setAction($this->url());
echo $this->registerForm;
diff --git a/application/modules/user/views/scripts/group/add.phtml b/application/modules/user/views/scripts/group/add.phtml
index 4f96cf0..588ce31 100644
--- a/application/modules/user/views/scripts/group/add.phtml
+++ b/application/modules/user/views/scripts/group/add.phtml
@@ -1,3 +1,4 @@
+<h1>Add Group</h1>
<?php
$this->addForm->setAction($this->url());
echo $this->addForm;
diff --git a/application/modules/user/views/scripts/group/edit.phtml b/application/modules/user/views/scripts/group/edit.phtml
index d513dea..add3a77 100644
--- a/application/modules/user/views/scripts/group/edit.phtml
+++ b/application/modules/user/views/scripts/group/edit.phtml
@@ -1,3 +1,4 @@
+<h1>Edit Group</h1>
<?php
if(isset($this->addForm)) {
$this->addForm->setAction('/user/group/add');
diff --git a/application/modules/user/views/scripts/group/link.phtml b/application/modules/user/views/scripts/group/link.phtml
index 94ad343..5bb2a9d 100644
--- a/application/modules/user/views/scripts/group/link.phtml
+++ b/application/modules/user/views/scripts/group/link.phtml
@@ -1,3 +1,4 @@
+<h1>Link Groups</h1>
<?php
$this->linkForm->setAction($this->url());
echo $this->linkForm;
diff --git a/application/modules/user/views/scripts/group/show.phtml b/application/modules/user/views/scripts/group/show.phtml
index 18ad1d3..d343204 100644
--- a/application/modules/user/views/scripts/group/show.phtml
+++ b/application/modules/user/views/scripts/group/show.phtml
@@ -4,12 +4,6 @@ if($this->groupID) {
?>
<h1>Group</h1>
<?php
- } else {
- ?>
-<h1>Group Details</h1>
- <?php
- }
- if(isset($this->userIDsNamespace['groupID'])) {
echo $this->formButton('deletegroup', 'Delete', array(
'onclick' => 'self.location="/user/group/delete/"',
'class' => 'rightbutton'));
@@ -17,6 +11,9 @@ if($this->groupID) {
'onclick' => 'self.location="/user/group/edit/"',
'class' => 'rightbutton'));
} else {
+ ?>
+<h1>Group Details</h1>
+ <?php
echo $this->formButton('deletegroup', 'Delete', array(
'onclick' => 'self.location="/user/group/delete/groupID/' . $this->group->getID() .'"',
'class' => 'rightbutton'));
diff --git a/application/modules/user/views/scripts/person/edit.phtml b/application/modules/user/views/scripts/person/edit.phtml
index 955ed35..3e666d4 100644
--- a/application/modules/user/views/scripts/person/edit.phtml
+++ b/application/modules/user/views/scripts/person/edit.phtml
@@ -1,3 +1,4 @@
+<h1>Edit Person</h1>
<?php
$this->editForm->setAction($this->url());
echo $this->editForm;
diff --git a/application/modules/user/views/scripts/person/request.phtml b/application/modules/user/views/scripts/person/request.phtml
index 2da570f..91a625b 100644
--- a/application/modules/user/views/scripts/person/request.phtml
+++ b/application/modules/user/views/scripts/person/request.phtml
@@ -1,3 +1,4 @@
+<h1>Request Membership</h1>
<?php
if(count($this->requestForm->getGrouplist())>0) {
$this->requestForm->setAction($this->url());
diff --git a/application/modules/user/views/scripts/person/selectmembership.phtml b/application/modules/user/views/scripts/person/selectmembership.phtml
index 2bfe4d6..5f7e5bf 100644
--- a/application/modules/user/views/scripts/person/selectmembership.phtml
+++ b/application/modules/user/views/scripts/person/selectmembership.phtml
@@ -1,3 +1,4 @@
+<h1>Select Membership</h1>
<?php
$this->membershipSelectForm->setAction($this->url());
echo $this->membershipSelectForm;
diff --git a/application/modules/user/views/scripts/role/add.phtml b/application/modules/user/views/scripts/role/add.phtml
index 4f96cf0..23d4c55 100644
--- a/application/modules/user/views/scripts/role/add.phtml
+++ b/application/modules/user/views/scripts/role/add.phtml
@@ -1,3 +1,4 @@
+<h1>Add Role</h1>
<?php
$this->addForm->setAction($this->url());
echo $this->addForm;
diff --git a/application/modules/user/views/scripts/role/edit.phtml b/application/modules/user/views/scripts/role/edit.phtml
index c976a90..59482f0 100644
--- a/application/modules/user/views/scripts/role/edit.phtml
+++ b/application/modules/user/views/scripts/role/edit.phtml
@@ -1,3 +1,4 @@
+<h1>Edit Role</h1>
<?php
if(isset($this->addForm)) {
$this->addForm->setAction('/etc/role/add');
diff --git a/application/modules/user/views/scripts/role/linkright.phtml b/application/modules/user/views/scripts/role/linkright.phtml
index 94ad343..38c0d45 100644
--- a/application/modules/user/views/scripts/role/linkright.phtml
+++ b/application/modules/user/views/scripts/role/linkright.phtml
@@ -1,3 +1,4 @@
+<h1>Add Right</h1>
<?php
$this->linkForm->setAction($this->url());
echo $this->linkForm;
diff --git a/application/modules/user/views/scripts/role/show.phtml b/application/modules/user/views/scripts/role/show.phtml
index 8213e73..b99c1f8 100644
--- a/application/modules/user/views/scripts/role/show.phtml
+++ b/application/modules/user/views/scripts/role/show.phtml
@@ -1,6 +1,14 @@
-<h1>Role Details</h1>
<?php
if($this->roleID) {
+ if(isset($this->userIDsNamespace['roleID'])) {
+ ?>
+<h1>Role</h1>
+ <?php
+ } else {
+ ?>
+<h1>Role Details</h1>
+ <?php
+ }
?>
<?php echo $this->formButton('deleterole', 'Delete', array(
'onclick' => 'self.location="/user/role/delete/roleID/' . $this->role->getID() .'"',