]> dev.renevier.net Git - syj.git/blobdiff - application/controllers/NewpwdController.php
use cookies instead of session to manage login
[syj.git] / application / controllers / NewpwdController.php
index dc9ff5d46a11d263bcb5e80ada45d94c8989b06e..25a386217298c01bdbd63c7fcb84c7bb3fe921de 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-/*  This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
+/*  This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
     and is published under the AGPL license. */
 
 class NewpwdController extends Zend_Controller_Action
@@ -8,6 +8,7 @@ class NewpwdController extends Zend_Controller_Action
     public function init() {
         $this->_helper->SyjMedias->addScripts('newpwd');
         $this->view->headLink()->appendStylesheet('css/generic.css', 'all');
+        $this->view->headLink()->appendStylesheet('css/form.css', 'all');
         $this->view->headLink()->appendStylesheet('css/newpwd.css', 'all');
     }
 
@@ -23,7 +24,7 @@ class NewpwdController extends Zend_Controller_Action
         }
 
         if (empty($formData)) {
-            $loggeduser = $this->_helper->SyjSession->user();
+            $loggeduser = $this->_helper->SyjUserManager->current();
             if ($loggeduser) {
                 $form->newpwd_email->setValue($loggeduser->email)
                                     ->setAttrib('readonly', 'true');
@@ -43,7 +44,7 @@ class NewpwdController extends Zend_Controller_Action
         $user = new Syj_Model_User();
         if ($userMapper->findByEmail($formData['newpwd_email'], $user)) {
             // if no user exist with posted email, pretend everything went correct
-            $loggeduser = isset($loggeduser) ? $loggeduser: $this->_helper->SyjSession->user();
+            $loggeduser = isset($loggeduser) ? $loggeduser: $this->_helper->SyjUserManager->current();
             if ($loggeduser and ($loggeduser != $user)) {
                 throw new Syj_Exception_Request();
             }