public function indexAction()
 {
     // Get an Auth instance and check to see if the
     // user is already authenticated
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $this->_redirect('/admin/dashboard/');
         // Navigate away
     }
     $userGateway = new Users_Model_UserGateway();
     $form = $userGateway->getForm();
     // Check for a post action
     if ($this->_request->isPost()) {
         $validForm = $form->isValid($this->_request->getParams());
         if ($this->_request->isXmlHttpRequest()) {
             // Check the form for validity
             if (!$validForm) {
                 $return['formErrors'] = $form->getMessages();
                 $return['formResult'] = FALSE;
             } else {
                 $user = $userGateway->create($form->getValues());
                 if ($userGateway->authenticate($user)->isValid()) {
                     $originalRequest = new Zend_Session_Namespace('originalRequest');
                     $return['redirect']['location'] = '/admin/dashboard/';
                     $flashMessenger = $this->_helper->getHelper('FlashMessenger');
                     $flashMessenger->setNamespace('informational')->addMessage('Welcome to Fear Free Retirement!');
                 } else {
                     $return['append']['target'] = '#usersSignInForm';
                     $return['append']['content'] = '' . '<div class="response-msg error errors">' . 'Incorrect email/password combination.<br />' . 'Passwords are case sensitive.</div>';
                 }
             }
             $this->_helper->json->sendJson($return);
         }
     }
     // Set the form in the view
     $this->view->signInForm = $form;
 }