Download & Extend

Logging in FROM vBulletin if you've never logged in through vBulletin before

Project:Drupal vB
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)

Issue Summary

I have changed the vBulletin login form to use /drupalvb/login to login users, this works great for users who are already in Drupal because they have used the Drupal login form to create a Drupal user from vBulletin.

However, if one has never logged in through Drupal and only tries to login from vBulletin for the first time, upon posting to /drupalvb/login, logging in will fail because its never hitting the drupalvb validation check which actually creates the user in Drupal from vBulletin.

From what I can tell it runs the posted login info through:
user_login_default_validators()
which returns:
array('user_login_name_validate', 'user_login_authenticate_validate', 'user_login_final_validate');
none of which are the drupalvb login validator.

My solution would be to add the 'drupalvb_login_validate' validator to the beginning of the array of validators starting at line 492 in drupalvb.module:

-      foreach (user_login_default_validators() as $validator) {
+      $validators = user_login_default_validators();
+      $validators = array('drupalvb_login_validate') + $validators;
+      foreach ($validators as $validator) {

Someone let me know if I am off base, but this fixes the issue for me.

Comments

#1

Category:bug report» feature request
Status:needs work» postponed (maintainer needs more info)

A user that exists in vB, doesn't exist in Drupal yet, and tries to login in Drupal (not vB) shouldn't be handled by the code you're mentioning. This case is handled in drupalvb_form_alter(), which adjusts User module's login forms to automatically import the user from vB before Drupal's user login validation runs.

#2

Hi PadreHomer & sun,

I have been trying both the login processes to see if (and how) they work -

  • User exists in vB but not Drupal, logs in via Drupal login form > works, user is created in Drupal and they are authenticated
  • User exists in vB but not Drupal, logs in via vB login form (action rewritten to drupalvb/login) > doesn't work, user credentials are incorrect error message

I've applied the same validators code change from PadreHomer to line 492 in drupalvb.module and the login from the vB form now works. The user also ends up logged in on both sides (expected I guess) and back to the forum, perfect!!

Has no one else had this issue or are people generally only allowing login in via Drupal and disabling login via vB forms?

Thanks,
luke