2008年10月14日星期二

[fw-auth] Zend_Auth_Adapter_DbTable additional checks

The manual shows how to add additional checks to the table auth adapter
http://framework.zend.com/manual/en/zend.auth.adapter.dbtable.html#zend.auth.adapter.dbtable.advanced.advanced_usage

but it switches the zend_auth_credential_match value returned rather than
limits the selection by the extra check.


If we have a soft delete field deleted, and i delete a user 'peter' and then
re-add him later on, he won't be able to log in because the check sql:

SELECT `user`.*, (CASE WHEN `password` = ('jelly') AND deleted = 0 THEN 1
ELSE 0 END)
AS `zend_auth_credential_match` FROM `user`
WHERE (`email` = 'peter@example.com.au')

created by

$authAdapter = new Zend_Auth_Adapter_DbTable($registry->dbAdapter, 'users',
'email', 'password', '(?) AND deleted = 0');

returns both records.

is there anything i can do to limit the records returned to just the not
'deleted' records?

Thanks for any help. Week 2 developing with zend. getting there slowly.

--
View this message in context: http://www.nabble.com/Zend_Auth_Adapter_DbTable-additional-checks-tp19987253p19987253.html
Sent from the Zend Auth mailing list archive at Nabble.com.

没有评论: