Hi,
I have a little problem with this method.
My Zend_Auth_Adater_DbTable is setup like this:
$authAdapter = new Zend_Auth_Adapter_DbTable($databaseAdapter);
$authAdapter->setTableName('users')
->setIdentityColumn('username')
->setCredentialColumn('password')
->setCredentialTreatment("MD5(CONCAT(?, $blowfish))") // Line of concern
->setIdentity($postData['username'])
->setCredential($postData['password']);
Which produces:
"The supplied parameters to Zend_Auth_Adapter_DbTable failed to produce a valid
sql statement, please check table and column names for validity"
But ->setCredentialTreatment('MD5(?)') works though.
Cheers
Holger
-----Original Message-----
From: Joó Ádám [mailto:[EMAIL PROTECTED]
Sent: Saturday, April 12, 2008 9:30 AM
To: photo312
Cc: [email protected]
Subject: Re: [fw-general] adding "salt" to logging in and password security
Hello,
It's quite simple using Zend_Auth (database adapter stored in the
registry, users' date in the 'Users' table, containing fields
'username', 'password' and 'passwordSalt'):
--------------------------------------------------
$auth = Zend_Auth::getInstance();
$adapter = new Zend_Auth_Adapter_DbTable(Zend_Registry::get('db'),
'Users', 'username', 'password', 'MD5(CONCAT(?, passwordSalt))');
$adapter
->setIdentity($this->post['username'])
->setCredential($this->post['password'])
;
$result = $auth->authenticate($adapter);
--------------------------------------------------
Enjoy!
Ádám