Hey I am wondering if there is any reason, why you not simply check if $account->access is zero - which should tell you if the user has logged in previously?

So like this:

function mymodule_user_login(&$edit, $account) {
  if($account->access == 0){
    //first access
    drupal_set_message('Welcome!');
  }
}

Comments

afox’s picture

Status: Active » Closed (fixed)

Well, that is true for the very first login. But if we need to do something for more than just the very first, then we don't have a way anymore. And also, I think access is updated even if a user is say, blocked and tries to login, or in some other similar cases.