Index: drupalvb.inc.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drupalvb/drupalvb.inc.php,v
retrieving revision 1.9.4.2
diff -u -p -r1.9.4.2 drupalvb.inc.php
--- drupalvb.inc.php	22 Apr 2008 19:09:33 -0000	1.9.4.2
+++ drupalvb.inc.php	24 Apr 2008 04:02:53 -0000
@@ -150,7 +150,7 @@ function drupalvb_create_user($username,
 /**
  * Update an entry in the vB database user table.
  */
-function drupalvb_update_user($username, $password, $email, $salt) {
+function drupalvb_update_user($orig_username, $username, $password, $email, $salt) {
   // Set up the necessary variables.
   $lastdate = time();
   $setpass = '';
@@ -162,10 +162,10 @@ function drupalvb_update_user($username,
     }
     $passhash = md5($password . $salt);
     $passdate = date('Y-m-d H:i:s', time());
-    drupalvb_db_query("UPDATE {user} SET password = '%s', passworddate = '%s', salt = '%s', email = '%s', lastactivity = '%s' WHERE username = '%s'", $passhash, $passdate, $salt, $email, $lastdate, $username);
+    drupalvb_db_query("UPDATE {user} SET username = '%s', password = '%s', passworddate = '%s', salt = '%s', email='%s', lastactivity = '%s' WHERE username = '%s'"), $username, $passhash, $passdate, $salt, $email, $lastdate, $orig_username);
   }
   else {
-    drupalvb_db_query("UPDATE {user} SET email = '%s', lastactivity = '%s' WHERE username = '%s'", $email, $lastdate, $username);
+    drupalvb_db_query("UPDATE {user} SET username = '%s', email = '%s', lastactivity = '%s' WHERE username = '%s'"), $username, $email, $lastdate, $orig_username);
   }
 }
 
Index: drupalvb.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drupalvb/drupalvb.module,v
retrieving revision 1.11.4.2
diff -u -p -r1.11.4.2 drupalvb.module
--- drupalvb.module	22 Apr 2008 08:53:23 -0000	1.11.4.2
+++ drupalvb.module	24 Apr 2008 04:02:44 -0000
@@ -463,7 +463,7 @@ function drupalvb_user_update($edit_user
   // If user exists, then change the user's data and the cookies to mimic a new
   // vB login.
   if ($userinfo = db_fetch_array($result)) {
-    drupalvb_update_user($edit_user->name, md5($edit['pass']), $edit['mail'], $userinfo['salt']);
+    drupalvb_update_user($edit_user->name, $edit['name'], $edit['pass'], $edit['mail'], $userinfo['salt']);
     $update_cookies = TRUE;
   }
   // If none exists, then create the proper entry in the vB database.
