Database and File Salt for Zend_Auth
In my application I have a table row salt, and a static salt 开发者_JS百科set in my Zend_Registry. I'm trying to both, without having to write my own Auth_Adapter. Here's what I have right now for just one salting method.
$adapter->setCredentialTreatment("SHA1(CONCAT(?, salt))");
$adapter->setCredential($values['password']);
Is this possible, or do I have to write an entire adapter for this?
Just add another item to the CONCAT function.
$staticSalt = Zend_Registry::get('static_salt');
$treatment = "SHA1(CONCAT(?, salt, '" . $staticSalt . "'))";
$adapter->setCredentialTreatment($treatment);
$adapter->setCredential($values['password']);
精彩评论