]> dev.renevier.net Git - syj.git/blobdiff - application/controllers/AccountController.php
interface to manage list of created routes
[syj.git] / application / controllers / AccountController.php
index 76124908d504b90645d13658f53b87f5d9f0a7e1..f1d977facaf70ec4818cc3ba20b026c57b8326c9 100644 (file)
@@ -6,6 +6,8 @@ class AccountController extends Zend_Controller_Action
 {
 
     public function init() {
+        $this->_helper->SyjSession->needsLogin();
+
         $this->view->headScript()->appendFile('js/prototype.js');
         $this->view->headScript()->appendFile('js/utils.js');
         $this->view->headScript()->appendFile('js/account.js');
@@ -18,20 +20,6 @@ class AccountController extends Zend_Controller_Action
         $user = $this->_helper->SyjSession->user();
         $request = $this->getRequest();
 
-        if ($user === null) {
-            $encodeduri = implode('/', array_map('urlencode', explode('/', $request->getRequestUri())));
-            $loginurl = $this->view->addParamToUrl($this->view->baseUrl() . '/' . 'login', 'redirect', $encodeduri);
-            $translator = Zend_Registry::get('Zend_Translate');
-            $lang = Zend_Controller_Front::getInstance()->getRequest()->getQuery('lang');
-            if ($lang) {
-                $adapter = $translator->getAdapter();
-                if ($adapter->isAvailable($lang)) {
-                    $loginurl = $this->view->addParamToUrl($loginurl, 'lang', $lang);
-                }
-            }
-            $this->_helper->Redirector->gotoURL($loginurl, array('prependBase' => false));
-        }
-
         $form = new Syj_Form_Account(array('name' => 'accountform'));
         $formData = $request->getPost();