Hi,

Disclaimer: I am a coder myself, I used to do a lot of work on Drupal's modules. My knowledge sort of stops at Drupal 6, but I successfully ported Free Software Magazine to Drupal 7...
Having said that: Do you think it would be easy enough to change the module so that it *created* the account right away and logged the user in immediately, if their email address is not already in Drupal?

I manage Free Software Magazine, and I would *love* to see people simply pick their email addresses, and bang, be logged, without doing _anything_ else.

Thanks,

Merc.

Comments

icecreamyou’s picture

Category: task » feature
Status: Active » Closed (works as designed)

I remember you, you wrote the first version of Activity Log among other things (I maintain a similar module at that namespace now).

I looked at doing this and decided against it for a couple of reasons:

  • Most importantly, it would let you skip required fields that other modules (like Profile) add to the user registration form.
  • If users stopped using BrowserID, they would need to use the "Forgot Password" process to access their account.
  • Usernames would be the first part of email addresses, which pretty much gives away your email address. You could let people change their username after registration but that introduces more confusion.
  • People are used to having to sign up for things and don't expect to be logged in to a site before registering -- although you can fix this problem with a simple message explaining what just happened.

But yes, a default user registration form contains only a username, email address, and password field. You can infer the username from the email address (drupal_substr($email, 0, strpos($email, '@'))) and generate a secure password using user_password(). So it is possible, on a standard Drupal site, to register a user with only their email address.

From a technical standpoint, the best way to do this is probably to write a small module that alters the user registration form, grabs the email from $form['account']['mail']['#value'], and manually calls user_register_submit().

mercmobily’s picture

Hi,

I remember you too. I am glad you are managing that namespace, and thank you for your efforts!

----------
From a technical standpoint, the best way to do this is probably to write a small module that alters the user registration form, grabs the email from $form['account']['mail']['#value'], and manually calls user_register_submit().
-----------

That's exactly what I needed to know :D

But... I would also _love_ to see this module allow people to just be logged in, "magically". If it was an option, admins would know about the possible drawbacks:

> Most importantly, it would let you skip required fields that other modules (like Profile) add to the user registration form.

You just would need to make it clear in the config screen...

> If users stopped using BrowserID, they would need to use the "Forgot Password" process to access their account.

Hardly a problem!

> Usernames would be the first part of email addresses, which pretty much gives away your email address.

I don't agree with this... really. If anything, the problem would be with duplications --you'd need to manage cases where "tonymobily" was already taken... something like tonymobily_434.

> You could let people change their username after registration but that introduces more confusion.

I don't think people would be fussed about it, especially if they used BrowserId to get in!

> People are used to having to sign up for things and don't expect to be logged in to a site before registering -- although you can fix this problem with a simple message explaining what just happened.

I think it's the opposite: people don't want to be bothered with registration forms, emails, etc. I think "one click and you're in" really is the way to go, personally...

If it was Drupal6, I'd be able to hack this in less than 1 hour. However, to be 100% honest, I am a little intimidated by D7 (doing *anything* seems to take me ages!).

Maybe let me know if you are _totally_ against something like this in the module. Once FSM is back on track, I will take it from there!

Merc.

Bye,

Merc.

icecreamyou’s picture

Status: Closed (works as designed) » Postponed

Maybe let me know if you are _totally_ against something like this in the module.

I'm not totally against it, but it needs to be absolutely clear to admin and users what is going on. From an administrative standpoint if you have automatic registration through BrowserID then you probably also want to disable sending confirmation emails, give authenticated users permission to change their usernames, and make sure there are no modules adding things to the registration form. From a user's standpoint they need to know that they were just magically registered and that they (probably) have the ability to go change their username and password if they want. It's a lot of fuss to make it generically user-friendly whereas as a site-specific hack it's not that bad. There is actually an explanation of how to programmatically submit the user registration form at drupal_form_submit(), although I'm not sure whether doing this from within a hook_form_alter() will cause problems.

geek-merlin’s picture

+1 for this as an option.

icecreamyou’s picture

Status: Postponed » Closed (won't fix)

This module is being deprecated in favor of Mozilla Persona, which has this feature.