public function loginAction()
 {
     // redirect user if logged in
     if (Zend_Auth::getInstance()->hasIdentity()) {
         $this->_helper->redirector('index', 'user');
     }
     $this->view->title = "Login";
     $this->view->headTitle($this->view->title, 'PREPEND');
     $request = $this->getRequest();
     $form = new Default_Form_UserLogin();
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($request->getPost())) {
             $adapter = $this->getAuthAdapter($form->getValues());
             $auth = Zend_Auth::getInstance();
             $result = $auth->authenticate($adapter);
             if (!$result->isValid()) {
                 $form->setDescription('Sorry, the username and password you entered were invalid.');
             } else {
                 // store user data in session without password
                 Zend_Auth::getInstance()->getStorage()->write($adapter->getResultRowObject(null, 'password'));
                 $this->_helper->redirector('index', 'user');
             }
         }
     }
     $this->view->form = $form;
 }