diff -rN a/realname/realname_civicrm.inc b/realname/realname_civicrm.inc
0a1,78
> <?php
> /***
>  * @file
>  * Realname module support for CiviCRM.
>  */
> 
> /**
>  * Implementation of hook_profile_load()
>  */
> function civicrm_load_profile( &$account, $type=NULL ) 
> {
>   civicrm_initialize();
>   require_once 'CRM/Core/BAO/UFMatch.php';
>   $userID = CRM_Core_BAO_UFMatch::getContactId( $account->uid );
>   if ( $userID ) {
>     require_once 'CRM/Core/BAO/UFGroup.php';
>     require_once 'CRM/Core/BAO/UFField.php';
>     require_once 'CRM/Core/Action.php';
> 
>     $ctype = CRM_Core_DAO::getFieldValue( 'CRM_Contact_DAO_Contact', $userID, 'contact_type' );
> 
>     $ufGroups =& CRM_Core_BAO_UFGroup::getModuleUFGroup('User Account', 0, false);
>     $weight   = 100;
>     foreach ( $ufGroups as $id => $title ) {
> 
>       $fieldType = CRM_Core_BAO_UFField::getProfileType( $id );
>       if ( ( $fieldType != 'Contact' ) && ( $fieldType != $ctype ) ) {
>         continue;
>       }
>       $fields = CRM_Core_BAO_UFGroup::getFields($id, false, CRM_Core_Action::VIEW,
>         null, null, false, null, true);
>       $values = array();
>       CRM_Core_BAO_UFGroup::getValues($userID, $fields, $values);
> 
>       foreach($fields as $field_name => $field) {
>         $value = $values[$field['title']];
>         $account->{$field_name} = strip_tags($value);
>       }
> 
>     }
> 
>   }
>   return;
> }
> 
> function realname_civicrm_get_fields($current) {
>   civicrm_initialize();
>   $fields = $links = array();
>   require_once 'CRM/Core/BAO/UFField.php';
>   require_once 'CRM/Core/BAO/UFGroup.php';
>   require_once 'CRM/Core/Action.php';
> 
>   $ctype = 'Individual';
>   $ufGroups =& CRM_Core_BAO_UFGroup::getModuleUFGroup('User Account', 0, false);
>   foreach ( $ufGroups as $id => $title ) {
> 
>     $fieldType = CRM_Core_BAO_UFField::getProfileType( $id );
>     if ( ( $fieldType != 'Contact' ) && ( $fieldType != $ctype ) ) {
>       continue;
>     }
> 
>     $civi_fields = CRM_Core_BAO_UFGroup::getFields($id, false, CRM_Core_Action::VIEW,
>       null, null, false, null, true);
> 
>     foreach($civi_fields as $field_name => $f)
>     {
>       $selected = array_key_exists($field_name, $current);
>       $fields[$field_name] = array(
>         'title' => $f['title'],
>         'weight' => $selected ? $current[$field_name] : 0,
>         'selected' => $selected,
>       );
>     }
> 
>   }
> 
>   return array('fields' => $fields, 'links' => $links);
> }
diff -rN a/realname/realname_supported.inc b/realname/realname_supported.inc
17a18,21
>     'civicrm' => array(
>       'name' => 'CiviCRM 3.0',
>       'types' => FALSE,
>       ),
