I am using Zend_Auth
to validate user credentials and ran into an issue. I need to have a dual column identity. The the two columns are user name and customer identifier. The identityColumn
setting and setIdentity()
methods don't allow for this scenario. I tried to accomplish this by using the credentialTreatment
setting, but when I have a duplicate user name for two or more customers, it merely calculates the zend_auth_credential_match
as false for the other customers rather than filtering those users out.
Here's a sanitized example of the resulting query executed by Zend Auth:
SELECT `users`.*,
(CASE
WHEN `password` = 'password'
AND active = 1
AND customer_id = 1
THEN 1
ELSE 0
END) AS `zend_auth_credential_match`
FROM `users`
WHERE (`username` = 'username')
Is it necessary to extend the Zend_Auth
module to do this? Has anyone else done it and can provide an example?
Thanks!