Can anyone tell me what is the use of following statement and how it works in Zend Framework?
setCredentialTreatment('SHA1(CONCAT(?,
salt
))');
Can anyone tell me what is the use of following statement and how it works in Zend Framework?
setCredentialTreatment('SHA1(CONCAT(?,
salt
))');
Try like this:
setCredentialTreatment
tells the auth adapter how to check the user supplied password against the one in the database (or whatever passwords are being checked again). In your example, the?
is the placeholder representing the password andCONCAT()
andSHA1()
are both database functions. So this example will append the salt to the user-entered password and then hash them using SHA1.This will result in a database query that looks similar to this:
You use
setCredentialTreatment()
to change how the passwords are checked. For example if your passwords are just straight MD5 hashes, you'd instead use: