Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class AuthController extends Zend_Controller_Action
- {
- public function init()
- {
- /* Initialize action controller here */
- }
- public function indexAction()
- {
- // action body
- }
- public function loginAction()
- {
- $username = $this->getRequest()->getParam('username', null);
- $password = $this->getRequest()->getParam('password', null);
- $auth = new Zend_Auth_Adapter_DbTable();
- $auth->setTableName('users')
- ->setIdentityColumn('username')
- ->setCredentialColumn('password')
- ->setIdentity($username)
- ->setCredential($password);
- $result = $auth->authenticate();
- echo $result->isValid();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement