Guest User

Untitled

a guest
Jan 23rd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4.  
  5. class Admin_IndexController extends Zend_Controller_Action
  6.  
  7. {
  8.  
  9.  
  10.  
  11. public function init()
  12.  
  13. {
  14.  
  15. /* Initialize action controller here */
  16.  
  17. }
  18.  
  19.  
  20.  
  21. public function indexAction()
  22.  
  23. {
  24.  
  25. $form = new Admin_Form_AdminLogin();
  26.  
  27. $form->submit->setLabel('Login');
  28.  
  29. $this->view->form = $form;
  30.  
  31. $request = $this->getRequest();
  32.  
  33. if ($request->isPost()) {
  34.  
  35. if ($form->isValid($request->getPost())) {
  36.  
  37. $result = new Admin_Model_Admin();
  38.  
  39. $values = $form->getValues();
  40.  
  41. if ($result->auth($values)) {
  42.  
  43. // We're authenticated! Redirect to the home page
  44.  
  45. $this->_helper->redirector('index', 'index');
  46.  
  47. }
  48.  
  49. }
  50.  
  51. }
  52.  
  53. $this->view->form = $form;
  54.  
  55. }
  56.  
  57. }
Add Comment
Please, Sign In to add comment