I noticed that the user table has a column for status. Does 1 status mean the account has been email activated? and is this the only thing distinguishing a activated account and unvalidated account? Also, I want to make a module that will do something when a user email activates his account. I'm guessing this would be the user hook but what op code would I use to detect when a user email activates his account?


When users create an account, and the email verification has been set as required, the value of the "status" field is set to 1 right after the users enter the username they want to adopt and their email address, if users are allowed to create an account without the approval of an administrator user; the "access" and "login" fields will be 0, until the users don't log in, which happens also in the case they follow the link reported in the email message sent to verify the email address they reported for their account.

  • So 'status' is set to 1 before the use clicks on the link in his email? Jun 1 '11 at 10:04
  • For extra verification, you can add the Email Verification module (drupal.org/project/email_verify). Jun 1 '11 at 10:04
  • 1
    @glumbo: If no administrator approval is required, the status is 1 before the user clicks the link in his email. If you want to know if a user is logging in for the first time, you could check the 'login' column in the users table. It will be set to 0 if the user hasn't logged in before. Jun 1 '11 at 10:11
  • Thanks. That solves my first problem. But does anyone know if there is a hook to detect when a user first logs in? Jun 1 '11 at 23:15
  • @glumbo hook_user('login') is invoked every time a user logs in; if you check the fields of the user object, and you keep track of the first time users log in, then you can know if a user logged in for the first time.
    – apaderno
    Jun 3 '11 at 3:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.