Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.852
diff -u -F^f -r1.852 user.module
--- modules/user/user.module	7 Oct 2007 19:27:40 -0000	1.852
+++ modules/user/user.module	8 Oct 2007 00:14:28 -0000
@@ -208,7 +208,7 @@ function user_save($account, $array = ar
         $query .= "$key = '%s', ";
         $v[] = md5($value);
       }
-      else if ((substr($key, 0, 4) !== 'auth') && ($key != 'pass')) {
+      else if ($key != 'pass') {
         if (in_array($key, $user_fields)) {
           // Save standard fields
           $query .= "$key = '%s', ";
@@ -327,17 +327,6 @@ function user_save($account, $array = ar
     $user = user_load(array('uid' => $array['uid']));
   }
 
-  // Save distributed authentication mappings
-  $authmaps = array();
-  foreach ($array as $key => $value) {
-    if (substr($key, 0, 4) == 'auth') {
-      $authmaps[$key] = $value;
-    }
-  }
-  if (sizeof($authmaps) > 0) {
-    user_set_authmaps($user, $authmaps);
-  }
-
   return $user;
 }
 
@@ -1254,8 +1243,9 @@ function user_external_login_register($n
   $user = user_load(array('name' => $name));
   if (!isset($user->uid)) {
     // Register this new user.
-    $userinfo = array('name' => $name, 'pass' => user_password(), 'init' => $name, 'status' => 1, "authname_$module" => $name);
+    $userinfo = array('name' => $name, 'pass' => user_password(), 'init' => $name, 'status' => 1);
     $user = user_save('', $userinfo);
+    user_set_authmaps($user, array("authname_$module" => $name));
     watchdog('user', 'New external user: %name using module %module.', array('%name' => $name, '%module' => $module), WATCHDOG_NOTICE, l(t('edit'), 'user/'. $user->uid .'/edit'));
   }
 }
