开发者

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']);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜