Guest User

Untitled

a guest
Jul 20th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. <?php
  2.  
  3. // user controller
  4.  
  5. public function loginAction()
  6. {
  7. $this->_helper->layout()->setLayout('login');
  8.  
  9. $this->view->headScript()->setScript('');
  10. $this->view->headLink()->appendStylesheet(APPLICATION_URL . '/lib/echofin/css/login.css');
  11.  
  12. $loginForm = new Default_Form_UserLogin();
  13. $loginForm->getElement('callback')->setValue($this->view->url());
  14.  
  15. if(isset($_COOKIE['login'])){
  16. $cookie = $_COOKIE['login'];
  17.  
  18. $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini','production');
  19. $salt = $config->security->salt;
  20.  
  21. $crypt = new Echofin_Crypt();
  22.  
  23. $decrypt = $crypt->decrypt($cookie,$salt);
  24.  
  25. $data = Zend_Json::decode($decrypt);
  26.  
  27. $data['remember'] = 1;
  28.  
  29. $loginForm->getElement('password')->renderPassword = true;
  30. $loginForm->populate($data);
  31. }
  32.  
  33. $user = new Contacts_Model_ContactUsers();
  34.  
  35. if($this->getRequest()->getPost())
  36. {
  37. $data = $this->getRequest()->getPost();
  38. if($loginForm->isValid($data))
  39. {
  40. //$this->_helper->redirector->gotoSimple('index');
  41. }
  42. }
  43.  
  44. $this->view->loginForm = $loginForm;
  45. $this->view->headTitle()->append('Login');
  46. }
Add Comment
Please, Sign In to add comment