X-Git-Url: https://dev.renevier.net/?a=blobdiff_plain;f=application%2Fcontrollers%2FAccountController.php;h=f1d977facaf70ec4818cc3ba20b026c57b8326c9;hb=616108d95f68d4d0c7dec334b262939782f355dc;hp=00de24e14940b121fbea0ec7529e00443696673f;hpb=9efd079d59d269811abc4c551b2f39ab2e6a05fb;p=syj.git diff --git a/application/controllers/AccountController.php b/application/controllers/AccountController.php index 00de24e..f1d977f 100644 --- a/application/controllers/AccountController.php +++ b/application/controllers/AccountController.php @@ -6,9 +6,10 @@ 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/forms.js'); - $this->view->headScript()->appendFile('js/highlight.js'); + $this->view->headScript()->appendFile('js/utils.js'); $this->view->headScript()->appendFile('js/account.js'); $this->view->headLink()->appendStylesheet('css/generic.css'); $this->view->headLink()->appendStylesheet('css/account.css'); @@ -16,23 +17,9 @@ class AccountController extends Zend_Controller_Action } public function indexAction() { - $user = $this->view->loggedUser(); + $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();