How do I set up the login so that users can log in with their email address and password rather than a user name? Thanks!

Comments

Bèr Kessels’s picture

Drupal needs a valid email for various purposes. Amongst others to send lost passwords.

---
if you dont like the choices being made for you, you should start making your own.
---
[Bèr Kessels | Drupal services www.webschuur.com]

intel352’s picture

Bèr, your response does not seem to be properly related to the user's question. He wants the user email to also be used as the user's login name, which shouldn't prevent proper system usage of the user's email address...

alexmc’s picture

Hmm,

I see what you mean - there are a few sites I have accounts with where my username *is* my email address.

However I would not want that email address to be revealed to other users of the site - or worse to spam web crawlers trying to harvest email addresses.

Are you suggesting that users still have a normal username which is NOT their email address, but they dont need to enter that to log in - just their email address and password.

That shouldnt be too hard to implement but I dont know how without looking into it.

Dublin Drupaller’s picture

Hi Plaguester

interesting idea..with more and more sites based on logins, it's getting more and more difficult for people to remember all their login details. Especially if, like most, some of those are pseudonym based.

I suppose one (fairly lenghty) way around it would be do the following:

  1. go to ADMIN ->> USERS -->> CONFIG and allow @ and fullstop symbols in usernames.
  2. go to ADMIN -->> SETTINGS -->> PROFILE and setup either a Pseudonym field or a first name & last name text field and make sure to include that on the Registration Page. It means people have to enter their email address twice..but, most are used to doing that anyway on a lot of sites.
  3. hack Drupal to use the custom profile fields instead of the normal user name when displaying the "poster info".

The third step is a little lengthy..and I'm not sure which modules you need to hack...but, it's possible.

I can see the logic behind your question, though...it would be useful to have the option of logging in with a username + password or email address + password.

Mabe some of the more experienced might throw in their two cents on how to do this at the LOGIN stage..to avoid hacking. Although judging by the activity with Drupal CVS it might take a back seat to the more pressing issues.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

intel352’s picture

an interesting problem with trying to implement email address support in the user module, is that Drupal is already setup to interpret %user%@%domain% as a reference to an affiliate website login. Hmm...

Dublin Drupaller’s picture

I never thought of that..good point intel. Does it do that even when you have the drupal.module disabled?

Either way, it's an interesting challenge that maybe better nailed at the LOGIN stage..i.e. Drupal accepts either

Username + Password or emailaddress+password to authenticate a user.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

intel352’s picture

not sure yet, i was nosing through the code yesterday with intentions of hacking for email support, and noticed that was where support for drupal.module was implemented.

login is implemented in the user.module file, as is most (if not all) other handling of user information, so i'm thinking user.module is the file we'll have to edit for that functionality.

still trying to figure out best method to do this, so that it could be reusable and acceptable, lol

venkat-rk’s picture

The Login Toboggan module allows users to log in with either username or email address.
http://drupal.org/node/34309

intel352’s picture

wow, nice find, thanks for that link

venkat-rk’s picture

You're welcome:-)

chrislynch’s picture

I've just done this ...

Hi Plaguester

interesting idea..with more and more sites based on logins, it's getting more and more difficult for people to remember all their login details. Especially if, like most, some of those are pseudonym based.

I suppose one (fairly lenghty) way around it would be do the following:

1. go to ADMIN ->> USERS -->> CONFIG and allow @ and fullstop symbols in usernames.
2. go to ADMIN -->> SETTINGS -->> PROFILE and setup either a Pseudonym field or a first name & last name text field and make sure to include that on the Registration Page. It means people have to enter their email address twice..but, most are used to doing that anyway on a lot of sites.
3. hack Drupal to use the custom profile fields instead of the normal user name when displaying the "poster info".

The third step is a little lengthy..and I'm not sure which modules you need to hack...but, it's possible.

I can see the logic behind your question, though...it would be useful to have the option of logging in with a username + password or email address + password.

Mabe some of the more experienced might throw in their two cents on how to do this at the LOGIN stage..to avoid hacking. Although judging by the activity with Drupal CVS it might take a back seat to the more pressing issues.

Dub

... took me about an hour to hack to the code for the user.module file of version 4.6.5.

I'd like to post the code here for people to use, but every time I try a message pops up telling my input is "suspicious". I've tried wrapping it in <code> tags, but to no avail :-(

arava_phani’s picture

Iam a new user to drupal and looking at a similar functionality

Can u paste the code or send me an email?

rooby’s picture

Just in case anyone else comes by here looking, see http://drupal.org/project/email_registration