Hello list,
i am trying to get Zend_Auth with the Mysql ENCRYPT Function working.
Mysql-server-version: 5.0.32-Debian_7etch (stable)
This is a snippet of my code (which works perfectly with plain passwords) :
$authAdapter = new Zend_Auth_Adapter_DbTable($db);
$authAdapter->setTableName('user');
$authAdapter->setIdentityColumn('username');
$authAdapter->setCredentialColumn('password');
$authAdapter->setCredentialTreatment('ENCRYPT(?)');
I start logging mysql queries, this is the query:
SELECT
`user`. * ,
`password` ,
`password` = encrypt( 'test' ) AS zend_auth_credential_match
FROM
`user`
WHERE
(
`username` = 'lx'
)
And the result:
id username password firstname lastname password
zend_auth_credential_match
1 lx 5Mf21xd14k08g Alexander Jäger 5Mf21xd14k08g 0
As you can see the passwords match, but there is no 'true' value for
zend_auth_credential_match.
This is the point i am confused about, is this a zend or mysql error?
I guess there is something wrong with mysql because the query and result
should be totally right!
Please, help me! ;)
Grettings,
Alex