12

What is the difference between the "init" and "email" fields?

mail varchar(64)  User's e-mail address.
init varchar(64)  E-mail address used for initial account creation.
  • 4
    Btw, if anyone is getting here because update warnings were sent to admin@example.com: Even though the admin account might have $user->init === 'admin@example.com', the actual place to look is admin/reports/updates/settings, which might also contain an admin@example.com. (This was on an old website, i have no idea how it got there :) ) – donquixote Mar 9 '16 at 1:41
14

The difference is that mail is the actual email address used by the user, while init contains, in a plain Drupal installation, the email address used when the user account was created.
In the case the Bakery Single Sign-On System module is installed in a slave site (in Bakery parlance), the init field contains the link to the user account on the master site.

So, the init field could be described as the field that unequivocally identifies a user account, and that is (by default, when third-party modules don't change its content) set to contain the initial e-mail address. (That seems the reason why the field has been named init.)

Drupal.org uses the init field in the case users lose the access to their account, and create a new account to report that. They are asked (not publicly) which email they used when registering their previous account; a Drupal.org administrator would then verify that is exactly the email they used while registering the lost account by reading the database content. (There isn't a module that allows to do so automatically, for what I know.)

  • 5
    Another difference worth mentioning, is that while the mail can change many times through the lifetime of the user profile on that site, the init will stay same. This can be used should the account be hacked and the e-mail and password changed. – googletorp Apr 15 '11 at 12:59

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.