By aniskhan on
Hi, so I have a simple module that uses hook_auth for testing purposes:
function remote_db_auth($username,$password)
{
watchdog('remote_db_auth','accessing');
return true;
}
So if I try to login with a user that doesn't exist in my Drupal user database, it should create it, correct? However, when I try to login with a username that doesn't exist (joe), it gives me the typical unrecognized username or password error, plus no watchdog entry in the logs. I've also tried joe@domain.com, etc. No matter what I try, I can't get the watchdog entry nor the username created. Why isn't the hook_auth being called? Is there a hidden setting somewhere I need to enable?
I don't know what else to try. I've search and most people seem to have hook_auth working.
Comments
Well first to check, your
Well first to check, your module is called 'remote_db' correct?
Second your function is missing a parameter, it should be declared as
oh wow, i am retarded
I had named my module remote_db_auth :| unbelievable....
So i changed everything to remote_db and now it works :)
But i get 4 errors in red upon login of the newly created user, and then when the page is refreshed, the errors disappear...
Regarding the missing parameter, it seems like hook_auth does $server = false as one of the parameters.
Your hook should declare all
Your hook should declare all parameters show in the docs.
As for the errors I can not tell from the error if this is from code in your module or some other problem. Either way it would require some time debugging the problem.
k, thanks for the help :)
:)