Hello,

Maybe someone can help me - i'm trying to access the user object directly after someone registers - but before they have logged in with the temporary password link.

I've tried calling the $user->uid but this does not work.

Any ideas?

Josh

Comments

nedjo’s picture

See http://api.drupal.org/api/4.7/function/hook_user with the 'insert' op. This allows you to respond to user creation.

JStarcher’s picture

That doesn't seem to work for me for some reason. It only works if I add the user through the administrate users control panel.

I've played around with the 'register' op and it doesn't seem to do anything like this either.

Any idea why it won't work?

smokingtrucks’s picture

Use hook_user where the $op == 'insert', and modify the $account variable. $account is the user object.