First time login hook

Public

Execute code on user's first time login.

Get raw version
php
  1. /**
  2.  * Implements hook_user_login().
  3.  */
  4. function YOUR_MODULE_user_login(&$edit, $account) {
  5. // Check if user never logged in.
  6. if ($account->access == 0) {
  7. // Execute code (for example redirect to user edit page).
  8. $_GET['destination'] = 'user/' . $account->uid . '/edit';
  9. }
  10. }

Comments

Benftwc's picture

Quite usefull if you wanna to display a "Disclaimer" for your new members ;)

Thanks

jaywant topno's picture

how to do the same in drupal 6?