ZF-Commons/ZfcUser — pull request #111 by pdobrigkeit (2012-08-10 14:39:06+00:00)
Title: Added the possibility to make user specific salt hashing possible

Added hash to the attributes of the user and added credential post processing to the user service and the authentication db adapter.

What I do to configure it in my main Module is:

public function onBootstrap(MvcEvent $event) {
$serviceManager = $event->getApplication()->getServiceManager();

$adapter = $serviceManager->get('ZfcUser\Authentication\Adapter\Db');
$adapter->setCredentialPostprocessor(function($credential, $userObject) {
return $userObject->getHash() . $credential;
});

$userService = $serviceManager->get('zfcuser_user_service');
$userService->setCredentialPostprocessor(function($credential, $userObject) {
$hash = mcrypt_create_iv(32);
$userObject->setHash($hash);
return $hash . $credential;
});
}