Index: drupalvb.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drupalvb/drupalvb.module,v
retrieving revision 1.34
diff -u -p -r1.34 drupalvb.module
--- drupalvb.module	1 Feb 2009 02:00:25 -0000	1.34
+++ drupalvb.module	30 Mar 2009 01:20:34 -0000
@@ -476,7 +476,8 @@ function drupalvb_login() {
     if ($user->uid) {
       // If the user is already logged in to Drupal, we ensure the same for
       // vBulletin.
-      if (drupalvb_auth($_REQUEST['name'], trim($_REQUEST['pass']))) {
+      $form_state = array('values' => $_REQUEST);
+      if (drupalvb_login_validate(array(), $form_state)) {
         drupal_goto(!empty($_REQUEST['destination']) ? $_REQUEST['destination'] : 'user/'. $user->uid);
       }
       else {
@@ -488,9 +489,13 @@ function drupalvb_login() {
     }
     else {
       // Otherwise perform the full login procedure.
-      user_login_validate($_REQUEST['form_id'], $_REQUEST);
+      $form_state = array('values' => $_REQUEST);
+      foreach (user_login_default_validators() as $validator) {
+        $validator(array(), $form_state);
+      }
       if (!form_get_errors()) {
-        $redirect = user_login_submit($_REQUEST['form_id'], $_REQUEST);
+        user_login_submit(array(), $form_state);
+        $redirect = (isset($form_state['redirect']) ? $form_state['redirect'] : '');
         drupal_goto(!empty($_REQUEST['destination']) ? $_REQUEST['destination'] : $redirect);
       }
       else {
@@ -1027,7 +1032,7 @@ function drupalvb_lookup_drupal_user($us
     // Register this user in Drupal using a temporary password, since we don't
     // know the real one. It will be updated when the user logs in to Drupal
     // for the first time using its vBulletin credentials.
-    // @see drupalvb_auth()
+    // @see drupalvb_login_validate()
     $userinfo = array(
       'name' => $vbuser['username'],
       'pass' => user_password(),
