Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Admin_IndexController extends Zend_Controller_Action
- {
- public function init()
- {
- /* Initialize action controller here */
- }
- public function indexAction()
- {
- $form = new Admin_Form_AdminLogin();
- $form->submit->setLabel('Login');
- $this->view->form = $form;
- $request = $this->getRequest();
- if ($request->isPost()) {
- if ($form->isValid($request->getPost())) {
- $result = new Admin_Model_Admin();
- $values = $form->getValues();
- if ($result->auth($values)) {
- // We're authenticated! Redirect to the home page
- $this->_helper->redirector('index', 'index');
- }
- }
- }
- $this->view->form = $form;
- }
- }
Add Comment
Please, Sign In to add comment