ZF-11306: $auth was not declare

Issue Type: Docs: Problem Created: 2011-04-19T07:21:02.000+0000 Last Updated: 2011-04-23T21:53:17.000+0000 Status: Resolved Fix version(s): - 1.11.6 (05/May/11)

Reporter: netroby (netroby) Assignee: Ramon Henrique Ornelas (ramon) Tags: - Zend_Auth

  • Authentication

Related issues: Attachments:



With the above form, we can now go about creating our login action for our authentication controller. This controller will be called "AuthController", and will be located at application/controllers/AuthController.php. It will have a single method called " loginAction()" which will serve as the self-posting action. In other words, regardless of the url was POSTed to or GETed to, this method will handle the logic. The following code will demonstrate how to construct the proper adapter, integrate it with the form:

<pre class="highlight">
class AuthController extends Zend_Controller_Action

    public function loginAction()
        $db = $this->_getParam('db');

        $loginForm = new Default_Form_Auth_Login($_POST);

        if ($loginForm->isValid()) {

            $adapter = new Zend_Auth_Adapter_DbTable(
                'MD5(CONCAT(?, password_salt))'


            $result = $auth->authenticate($adapter);

            if ($result->isValid()) {
                $this->_helper->FlashMessenger('Successful Login');


        $this->view->loginForm = $loginForm;



{quote}$auth is not declare.{quote}

we should add :



### Comments

Posted by Kai Uwe (kaiuwe) on 2011-04-19T08:49:34.000+0000

Code tags added



Posted by Ramon Henrique Ornelas (ramon) on 2011-04-23T21:53:17.000+0000

Fix r23866 in the trunk and merged to branch release 1.11 r23867 - thanks.



Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.