From d2780c2f441920ea2efc359ffe68cdfaf14f2307 Mon Sep 17 00:00:00 2001
From: hpbruna <hermanpeterbruna@gmail.com>
Date: Thu, 10 May 2012 14:09:01 +0200
Subject: [PATCH] added UID mapping

---
 plugins/FeedsUserProcessor.inc |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/plugins/FeedsUserProcessor.inc b/plugins/FeedsUserProcessor.inc
index e54b5e6..2d88be9 100644
--- a/plugins/FeedsUserProcessor.inc
+++ b/plugins/FeedsUserProcessor.inc
@@ -35,6 +35,10 @@ class FeedsUserProcessor extends FeedsProcessor {
         if (!empty($uid)) {
           $account->uid = $uid;
         }
+		
+		 // If uid is set and a user with that id doesn't exist, flag as new.
+     if (!empty($account->uid) && !user_load($account->uid)) {
+      $account->is_new = TRUE;}
 
         // Save the user.
         user_save($account, (array) $account);
@@ -164,6 +168,11 @@ class FeedsUserProcessor extends FeedsProcessor {
    */
   public function getMappingTargets() {
     $targets = array(
+     'uid' => array(
+        'name' => t('User ID'),
+         'description' => t('The user ID. NOTE: use this feature with care, user ids are usually assigned by Drupal.'),
+         'optional_unique' => TRUE,
+       ),
       'name' => array(
         'name' => t('User name'),
         'description' => t('Name of the user.'),
-- 
1.7.10.1

