Hi all!

I'm using login toboggan on drupal 6.x and have been experiencing problems with "immediate login" option, it doesn't work properly.

I've been diving the code and I think I've found the problem, on logintoboggan.module, line 387 is written:

  // Log the user in if they created the account and immediate login is enabled.
  if($reg_pass_set && variable_get('logintoboggan_immediate_login_on_register', TRUE)) {
    $form_state['redirect'] = logintoboggan_process_login($account, $redirect);
  }

And I think it should look like:

  // Log the user in if they created the account and immediate login is enabled.
  if($reg_pass_set && variable_get('logintoboggan_immediate_login_on_register', TRUE)) {
    $auth=array('name' => $account->name, 'pass' => $account->password);
    user_authenticate($auth);
    $form_state['redirect'] = logintoboggan_process_login($account, $redirect);
  }

Please, advise if I'm wrong.

Comments

hunmonk’s picture

Status: Active » Closed (works as designed)

i highly doubt this is broken, or many more people would have reported it. i've also tested locally and have no issues. most likely you don't have the 'Set password' option enabled. you can't have automatic login if the user isn't creating their own password.

manuprevention’s picture

Status: Closed (works as designed) » Active

I know it's strange nobody else reported it, so I think I must be mistaken...

In my case, the set password option is enabled, and the redirecting option after registering is set too.

So if I set the redirection page to 'node/123456' i.e. a node that doesn't exist, after submiting, the system redirects to 404 and the login toboggan block says you're logged in, but if you click another link, drupal deletes your session.

If I set redirection page to a node that actually exists, after submitting, the user is redirected to front page and login toboggan block says you're logged out.

I'm using several contributed modules and maybe I have some incompatibility issues... Anyway, the patch solved my problem... and It should be easy to re-apply it in future revisions... but I'd rather like to know where is the error.

Thanks!

hunmonk’s picture

Status: Active » Postponed (maintainer needs more info)

not convinced this is an LT bug. i'd recommend disabling all your other contrib modules to see if that corrects the issue, if so, then you should be able to track the compatibility issue from there...

manuprevention’s picture

It is an incompatibility issue, the offendant module is phpbbforum 6.x-1.04, it uses a hidden block to log into phpbb and I think it might be messing with hook_user()

Perhaps this is a phpbbforum issue, please tell me if I should post it there.

hunmonk’s picture

Project: LoginToboggan » phpBB Forum Integration
Version: 7.x-1.x-dev » 6.x-2.x-dev

moving to the correct queue

Liquidream’s picture

Having the same problem. When users click on the "One time login", it does NOT log them into the Drupal site. Instead, they are just taken to home page.

Any ideas??? :-(

vb’s picture

I think I have just fixed this.

in phpbbforum.module, in function phpbbforum_user

after lines

  elseif ($op == 'login') {

    $pass = $edit['pass'];
    $name = $edit['name'];

insert

    if (module_exists('logintoboggan') && empty($edit)) {
      if (!variable_get('user_email_verification', TRUE) &&
        variable_get('logintoboggan_immediate_login_on_register', TRUE)) {
        $name = $account->name;
        $pass = $account->password;
      }
    }

Please try and give me feedback.

Liquidream’s picture

Version: 6.x-2.x-dev » 6.x-1.04

Hi,

Sorry, I just tried your "fix", but it didn't work. It still kicks the user to the login/home page.

Note: I am using phpBBforum v6.x-1.04.

vb’s picture

Should work. I have corrected the empty edit array which hunmonk in LT give me upon registering before calling hook user.
I am using already phpbbforum-2.0-alpha5 and LT works with this patch, but it should not be matter which ver you are using.
Check your registration and LT settings (Set password).

Liquidream’s picture

Hi,

Seems to be working now... Pretty sure this was my fault. Bad settings conflicting! :o)

fizk’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)