I think it makes sense to log a user in after they create an account, if account does not require approval. Since the point of this module is to make creating an account an easy... I've patched this on my own site and will upload if there's interest.

Files: 
CommentFileSizeAuthor
#17 377262_stop_forced_login_more_tests_17_d6.patch2.11 KBgreggles
PASSED: [[SimpleTest]]: [MySQL] 28 pass(es).
[ View ]
#15 377262_stop_forced_login_more_tests_14.patch1.68 KBgreggles
PASSED: [[SimpleTest]]: [MySQL] 28 pass(es).
[ View ]
#13 377262_user_login_finalize_more_tests.patch1.51 KBgreggles
PASSED: [[SimpleTest]]: [MySQL] 28 pass(es).
[ View ]
#2 email_registration-login.patch766 bytesheydemo
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch email_registration-login.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Comments

If you could do that, that would be great.

I am also looking for a really simple login process.

I am a Drupal newbie so if you could provide any information as to where and how to patch that would be awesome.

StatusFileSize
new766 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch email_registration-login.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Ok, here's the patch. So basically you would put this in your email_registration directory and type:
patch < email_registration-login.patch

Remember to back up before applying patches. And read this for more info:
http://drupal.org/patch/apply

Status:Active» Needs review

Does this patch provide the existing, built-in functionality for logging users in immediately after registration at admin/user/settings ?

... "With it unchecked, users will be logged in immediately upon registering, and may select their own passwords during registration."

Patch worked. Thank you!

Chris, not sure I understand. As email registration module stands, user is *logged out* after registering. This patch logs user in, as long as email verification is not required. It is as simple as setting the global user object to the account parameter of hook_user.

I looked through the code in user.module for a little while and I'm not sure why we should have to do this in email_registration.module instead of just letting user.module "do the right thing." But, I'm very new to email_registration module so perhaps it is my lack of knowledge.

@heydemo - could you explain this a bit more? I agree that we should be respecting that core setting.

Category:feature» bug
Status:Needs review» Reviewed & tested by the community

I can confirm that without this patch email_registration will not work as it should with "Require e-mail verification when a visitor creates an account" unticked.

Status:Reviewed & tested by the community» Closed (fixed)

Committed to 6.x.1.x-dev

Version:6.x-1.1» 6.x-1.x-dev
Priority:Normal» Major
Status:Closed (fixed)» Needs work

Sorry to open up an old issue, but I think we may be missing an important step here.

It is as simple as setting the global user object to the account parameter of hook_user.

Don't we also need to call either user_external_login or user_authenticate_finalize? Otherwise the auto-login function in this module will not properly invoke the login functionality happening in other modules.

For example, I'm having a conflict with Secure Pages Hijack Prevention module. SPHP contains the following code:

/**
* Implementation of hook_user().
*/
function securepages_prevent_hijack_user($op, &$edit, &$user, $category = NULL) {
  switch ($op) {
  case 'login':
    _securepages_prevent_hijack_cookie();
    break;
  case 'after_update':
    // Regenerate our cookie after password changes.
    if (!empty($edit['pass'])) {
      _securepages_prevent_hijack_cookie();
    }
    break;
  }
}

The login hook is not getting invoked by Email Registration module upon auto-login, as it should.

In my particular use case I'm creating a new user by calling user_save in my custom module, so I'm not using the usual user/register form.

Title:Log user in after registrationLog user in after registration - call user_external_login or user_authenticate_finalize

Yep, makes sense to me. Does this also affect 7.x?

Version:6.x-1.x-dev» 7.x-1.x-dev

Yes, it appears it does so let's fix it there first and then backport.

Title:Log user in after registration - call user_external_login or user_authenticate_finalizeLog user in after registration - call user_authenticate_finalize / user_login_finalize
Status:Needs work» Needs review
StatusFileSize
new1.51 KB
PASSED: [[SimpleTest]]: [MySQL] 28 pass(es).
[ View ]

user_external_login is for modules that authenticate against another system, so I think that user_authenticate_finalize is the right function to use here.

user_authenticate_finalize is user_login_finalize in D7.

Attached is a patch to add it to d7 and add some tests to be more confident that it works.

Title:Log user in after registration - call user_authenticate_finalize / user_login_finalizeTest that immediate login works if enabled, remove our code that forces the login

I actually don't see why this code is needed at all. I removed it all and left in the new tests and it all still works.

Removing this code should help with issues like #738134: Conflict with LoginToboggan submit handler.

StatusFileSize
new1.68 KB
PASSED: [[SimpleTest]]: [MySQL] 28 pass(es).
[ View ]

Version:7.x-1.x-dev» 6.x-1.x-dev
Status:Needs review» Patch (to be ported)

Status:Patch (to be ported)» Needs review
StatusFileSize
new2.11 KB
PASSED: [[SimpleTest]]: [MySQL] 28 pass(es).
[ View ]

Here's a re-roll for D6.

Status:Needs review» Fixed

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.