Zend_Auth multiple credentials?

Posted by azz0r on Stack Overflow See other posts from Stack Overflow or by azz0r
Published on 2010-03-18T11:20:41Z Indexed on 2010/03/18 11:21 UTC
Read the original article Hit count: 466

Filed under:
|

Login Form:

    $authAdapter    = Zend_Registry::get('authAdapter');
    $authAdapter
  ->setIdentity($formData['email'])
  ->setCredential($password)
  ->setCredential(1);

Bootstrap:

    protected function _initAuth(){
    $this->bootstrap('db');
    $this->bootstrap('session');

    $db             = $this->getPluginResource('db')->getDbAdapter();
    $auth           = Zend_Auth::getInstance();
    $authAdapter    = new Zend_Auth_Adapter_DbTable($db, 'User', 'email', 'password', 'enabled');

    Zend_Registry::set('authAdapter', $authAdapter);
    return $authAdapter;
}

Obviously since adding 'enabled' its stopped working, if I remove:

->setCredential(1);

and 'enabled' from there:

($db, 'User', 'email', 'password', 'enabled');

it works just fine...

I would like to only enable users who have an enabled account to login though.

© Stack Overflow or respective owner

Related posts about zend-framework

Related posts about zend-auth