I am trying to make custom algorithm for password hashing. I try to do this.
In app.cfg:
sf_guard_plugin:
algorithm_callable: [Hlp, noHash]
In apps/frontend/lib/Hlp.php:
class Hlp
{
function noHash($password) //tried to make public or public static, but it didn't work either
{
return $password;
}
}
And in my database ‘algorithm’ is set to ‘noHash’.
When I try to log in I get following error:
The algorithm callable “noHash” is not callable.
I am using php 5.2.
What am I doing wrong?
UPDATE
Change in app.yml: algorithm_callable: ‘Hlp::noHash’
Changed algorith in db to ‘Hlp::noHash’
Marking hakre’s answer as correct for providing useful tip.
The sfGuardPlugin 1.3 expects the function to be static in case you want to call a class member.
However in your case the error message explicitly states that you’re calling a global public function, otherwise the error message would have been
So check the settings. Check the PHP requirements. And if in doubt, read the source.