Index: fbconnect.module
===================================================================
--- fbconnect.module	(revision 222)
+++ fbconnect.module	(working copy)
@@ -33,6 +33,15 @@
     'file' => 'fbconnect.admin.inc',
   );

+  $items['admin/config/people/fbconnect/extra_fields'] = array(
+    'title' => 'Extra fields',
+    'type' => MENU_LOCAL_TASK,
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('fbconnect_extra_fields'),
+    'access arguments' => array('administer site configuration'),
+    'file' => 'fbconnect.admin.inc',
+  );
+
   $items['admin/config/people/fbconnect/fb-app'] = array(
     'title' => 'App Settings',
     'type' => MENU_LOCAL_TASK,
Index: fbconnect.admin.inc
===================================================================
--- fbconnect.admin.inc	(revision 222)
+++ fbconnect.admin.inc	(working copy)
@@ -226,7 +226,17 @@
   return system_settings_form($form);
 }

+function fbconnect_extra_fields($form, &$form_state) {
+  $form['fbconnect_extra_fields'] = array(
+      '#type' => 'textarea',
+      '#title' => t('Import extra fields from Facebook'),
+      '#description' => t('Enter Facebook field mapping. One per line. E.g.: first_name|field_firstname. Mapping the returned values can be done too, e.g. gender|field_gender|male|0|female|1'),
+      '#default_value' => variable_get('fbconnect_extra_fields', ''),
+  );

+  return system_settings_form($form);
+}
+
 function fbconnect_fbapp_settings($form, &$form_state) {
   if (!facebook_client()) {
     drupal_set_message(t('Ensure that you entered valid api keys.'), 'error');
Index: fbconnect.pages.inc
===================================================================
--- fbconnect.pages.inc	(revision 222)
+++ fbconnect.pages.inc	(working copy)
@@ -118,7 +118,8 @@
  */
 function fbconnect_register_page($form, $form_state = array()) {
   $conf = fbconnect_get_config();
-  $data = fbconnect_get_user_info(array('name', 'email'));
+  $extra_fields = fbconnect_parse_extra_fields();
+  $data = fbconnect_get_user_info(array_merge(array('name', 'email'), array_keys($extra_fields)));
   // User not logged into facebook we dont have any information for them, let them log in.
   if (empty($data)) {
     return facebook_login_page($form, $form_state);
@@ -157,6 +158,8 @@
   $form['account']['mail']['#value'] = $data['email'];
   $form['account']['mail']['#parents'] = array('mail');

+  fbconnect_set_extra_fields($extra_fields, $data, $form);
+
   $form['fbconnect'] = array(
     '#type' => 'fieldset',
     '#title' => t('Facebook Connect'),
@@ -187,6 +190,19 @@
     //drupal_set_message('new name : ' . $newname);
     $form_state['values']['name'] = $newname;
     $form_state['values']['mail'] = $data['email'];
+
+    foreach ($extra_fields as $fb_key => $account_key) {
+      if(is_array($account_key)) {
+        $value = $account_key['option_mapping'][$data[$fb_key]];
+        $field_key = $account_key['field_mapping'];
+      }
+      else {
+        $value = $data[$fb_key];
+        $field_key = $account_key;
+      }
+      $form_state['values'][$field_key][LANGUAGE_NONE][0]['value'] = $value;
+    }
+
     $form_state['values']['pass'] = user_password();
     $form_state['values']['status'] = 1;
     $form_state['values']['fb_visible'] = 1;
@@ -224,6 +240,95 @@
   return $form;
 }

+/**
+ * Parses the variable setting into an array containing the fields from Facebook keyed by the account field key,
+ * optionally splitted into field_mapping and option_mapping.
+ *
+ * E.g.:
+ * input =>
+ *   first_name|field_first_name
+ *   last_name|field_last_name
+ *   gender|field_gender|male|Man|female|Vrouw
+ * output =>
+ *   array (
+ *     'first_name' => 'field_first_name',
+ *     'last_name' => 'field_last_name',
+ *     'gender' =>
+ *     array (
+ *       'field_mapping' => 'field_gender',
+ *       'option_mapping' =>
+ *       array (
+ *         'male' => 'Man',
+ *         'female' => 'Vrouw',
+ *       ),
+ *     ),
+ *   )
+ *
+ * @return array
+ */
+function fbconnect_parse_extra_fields() {
+  $array = explode("\n", variable_get('fbconnect_extra_fields'));
+  $output = array();
+  foreach ($array as $value) {
+    $expl = explode('|', $value);
+    $output[$expl[0]] = trim($expl[1]);
+    if(count($expl) > 2) {
+      $i = 2;
+      $output[$expl[0]] = array('field_mapping' => trim($expl[1]), 'option_mapping' => array());
+      while(isset($expl[$i]) && isset($expl[$i + 1])) {
+        $output[$expl[0]]['option_mapping'][$expl[$i]] = $expl[($i + 1)];
+        $i += 2;
+      }
+    }
+  }
+  return $output;
+}
+
+/**
+ * Sets the mapped value from the $extra_fields array under the $needle key
+ *
+ * @see fbconnect_find_key_and_set_value
+ *
+ * @param array $extra_fields the fields fetched from the Facebook API
+ * @param array $data data fetched from Facebook
+ * @param array $haystack
+ */
+function fbconnect_set_extra_fields($extra_fields, $data, &$haystack) {
+  foreach ($extra_fields as $fb_key => $account_key) {
+    if(is_array($account_key)) {
+      $value = $account_key['option_mapping'][$data[$fb_key]];
+      $field_key = $account_key['field_mapping'];
+    }
+    else {
+      $value = $data[$fb_key];
+      $field_key = $account_key;
+    }
+    fbconnect_find_key_and_set_value($haystack[$field_key], '#default_value', $value);
+  }
+}
+
+/**
+ * Searches the $haystack array recursively for the $needle key and sets $value under that $needle key
+ *
+ * @param array $haystack
+ * @param string $needle
+ * @param mixed $value
+ *
+ * @return boolean TRUE if value has been found and set, so the earlier recursive calls can be terminated
+ */
+function fbconnect_find_key_and_set_value(&$haystack, $needle, $value) {
+  foreach ($haystack as $key => &$v) {
+    if($key === $needle) {
+      $haystack[$needle] = $value;
+      return TRUE;
+    }
+    if(is_array($v) && !empty($v)) {
+      if(fbconnect_find_key_and_set_value($v, $needle, $value))
+        return TRUE;
+    }
+  }
+}
+
 function facebook_login_page(&$form, $form_state = array()) {
     $facebook = facebook_client();
     $params['scope'] = 'email';
