With this patch, when a user requests a new password for a mail adress or user name that doesn't exist as a Drupal user, we see if a matching user can be found in the vB database and if so, the vb user is imported into Drupal.

Comments

Frando’s picture

StatusFileSize
new1.57 KB

(patch wasn't attached, now it is)

sun’s picture

Status: Needs review » Needs work

Some minor issues:

- Please remove the trailing semicolon after function drupalvb_form_alter($form_id, &$form) {
- PHPdoc blocks and inline comments should break at 80 characters.
- First line of PHPdoc block should be a one-sentence short description of a function's intention (if longer, not breaking at 80 chars); followed by a blank comment line.
- Inline comment in drupalvb_form_alter() should be moved into PHPdoc block (extending, not replacing it).

Also, the behavior is not quite clear by reading the code:

Based on the code, drupalvb_validate_password_recovery() is invoked after User module's validation - which in turn would mean that a yet non-existing vBulletin user is not visible for User module. Please correct me if I'm wrong.

Additionally, you are limiting the search on Drupal's user-base to non-blocked users, with the potential effect that a blocked Drupal user might be looked up again and/or re-imported from vBulletin.

And why does it try to find a user's name in all mail addresses? AFAIK, neither Drupal nor vBulletin support an invalid mail address in the email column.

sun’s picture

Status: Needs work » Fixed
StatusFileSize
new1.71 KB

Committed attached patch.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

dieterbohn’s picture

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

Apologies if this turns out to simply be a bug in our 6.x-2.0 integration (and double-apologies if I should have started a new issue instead of resurrecting this one), but it would be stupendous if this patch could be integrated into the drupal 6 version.

Right now when a user with

- vBulletin account
- but not yet with a drupal account

...attempts to initiate a password request in Drupal they are told that "USERNAME is not recognized as a user name or an e-mail address."

It seem that the ideal behavior would be for Drupal to check for the username or email first in drupal and on failure, to then check in vBulletin. If it exists in vBulleting to then to add the user to Drupal, and then to reset the password and email the user.