Advertisement
Guest User

Untitled

a guest
Jun 13th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. <?php
  2.  
  3. class AuthController extends Zend_Controller_Action
  4. {
  5.  
  6.     public function init()
  7.     {
  8.         /* Initialize action controller here */
  9.     }
  10.  
  11.     public function indexAction()
  12.     {
  13.         // action body
  14.     }
  15.  
  16.     public function loginAction()
  17.     {
  18.         $username = $this->getRequest()->getParam('username', null);
  19.         $password = $this->getRequest()->getParam('password', null);
  20.         $auth = new Zend_Auth_Adapter_DbTable();
  21.         $auth->setTableName('users')
  22.              ->setIdentityColumn('username')
  23.              ->setCredentialColumn('password')
  24.              ->setIdentity($username)
  25.              ->setCredential($password);
  26.         $result = $auth->authenticate();
  27.         echo $result->isValid();
  28.     }
  29.  
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement