]> dev.renevier.net Git - syj.git/blobdiff - application/controllers/NewpwdController.php
cache js, css and png files
[syj.git] / application / controllers / NewpwdController.php
index de8ec3b644fcb9a242fc518fb253d94d411bbd41..17b16cae391391837a8615bbdbae5eedccf5aab2 100644 (file)
@@ -1,16 +1,13 @@
 <?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
 {
 
     public function init() {
-        $this->view->headScript()->appendFile('js/prototype.js');
-        $this->view->headScript()->appendFile('js/newpwd.js');
-        $this->view->headScript()->appendFile('js/utils.js');
-        $this->view->headLink()->appendStylesheet('css/generic.css', 'all');
-        $this->view->headLink()->appendStylesheet('css/newpwd.css', 'all');
+        $this->_helper->SyjMedias->addScripts('newpwd');
+        $this->_helper->SyjMedias->addStyleSheets('newpwd');
     }
 
     public function indexAction() {
@@ -25,7 +22,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');
@@ -45,7 +42,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();
             }