Index: plugins/FeedsUserProcessor.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/feeds/plugins/FeedsUserProcessor.inc,v
retrieving revision 1.10
diff -u -p -r1.10 FeedsUserProcessor.inc
--- plugins/FeedsUserProcessor.inc	28 Apr 2010 22:18:30 -0000	1.10
+++ plugins/FeedsUserProcessor.inc	15 May 2010 00:46:57 -0000
@@ -37,6 +37,24 @@ class FeedsUserProcessor extends FeedsPr
           $account->uid = $uid;
         }
 
+        if (module_exists('profile')) {
+          // Get profile fields
+          $profile = array();
+          $tmpAccount = get_object_vars($account);
+          $categories = profile_categories();
+          foreach ($categories as $category) {
+            $result = _profile_get_fields($category['name']);
+            while ($field = db_fetch_object($result)) {
+              $profile[$field->name] = $tmpAccount[$field->name];
+              // Mark field as handled (prevents saving to user->data).
+              $tmpAccount[$field->name] = NULL;
+            }
+          }
+          foreach ($tmpAccount as $name => $value) {
+            $account->$name = $value;
+          }
+        }
+
         // Save the user.
         user_save($account, (array) $account);
         if ($account->uid && $account->openid) {
@@ -55,6 +73,17 @@ class FeedsUserProcessor extends FeedsPr
         }
         else {
           $created++;
+
+          // Newly created, get uid
+          $account->uid = $this->existingItemId($item, $source);
+        }
+
+        // Save profile options
+        if (module_exists('profile') {
+          $categories = profile_categories();
+          foreach ($categories as $category) {
+            profile_save_profile($profile, $account, $category['name']);
+          }
         }
       }
     }
@@ -181,6 +210,19 @@ class FeedsUserProcessor extends FeedsPr
         'description' => t('The created (e. g. joined) data of the user.'),
        ),
     );
+    if (module_exists('profile')) {
+      $categories = profile_categories();
+
+      foreach ($categories as $category) {
+        $result = _profile_get_fields($category['name']);
+        while ($record = db_fetch_object($result)) {
+          $targets[$record->name] = array(
+            'name' => t('Profile:'.$record->title),
+            'description' => t('Profile:'.$record->title),
+            'optional_fid' => $record->fid);
+        }
+      }
+    }
     if (module_exists('openid')) {
       $targets['openid'] = array(
         'name' => t('OpenID identifier'),
