Zend_Auth_Adapter_DbTable identity not unique
Posted
by
volf
on Stack Overflow
See other posts from Stack Overflow
or by volf
Published on 2012-06-07T10:37:15Z
Indexed on
2012/06/07
10:40 UTC
Read the original article
Hit count: 154
zend-framework
|authentication
For authentication on a website i use Zend_Auth_Adapter_DbTable. Everything work's fine, but Zend Framework only allow unique Identitys in the table.
As an identity i use the mail-address from my users. The problem is, that there are more items in the table with this mail-adress. User can delete there account and so i don't delete the whole row, i only change the status to -2 or something else. active user has the status 1.
i try to use it like so:
$authAdapter = new Zend_Auth_Adapter_DbTable($db, 'user', 'email', 'password', "? AND `status`='1'");
$authAdapter->setIdentity($email);
$authAdapter->setCredential($password);
But it doesn't work. If i delete the inactive user with the same mail-address, everything work's. Why is that?
© Stack Overflow or respective owner