diff options
Diffstat (limited to 'application/modules/user/controllers/AuthController.php')
-rw-r--r-- | application/modules/user/controllers/AuthController.php | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/application/modules/user/controllers/AuthController.php b/application/modules/user/controllers/AuthController.php index db47f44..5d63b20 100644 --- a/application/modules/user/controllers/AuthController.php +++ b/application/modules/user/controllers/AuthController.php @@ -74,6 +74,7 @@ class User_AuthController extends Zend_Controller_Action $auth = Zend_Auth::getInstance(); $auth->clearIdentity(); Zend_Session::namespaceUnset('userIDs'); + Zend_Session::forgetMe(); $this->_helper->redirector('login', 'auth'); return; } @@ -119,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; } } |