Index: openid_client_ax.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/openid_client_ax/openid_client_ax.info,v
retrieving revision 1.2.2.3
diff -u -p -r1.2.2.3 openid_client_ax.info
--- openid_client_ax.info	20 Apr 2009 12:18:54 -0000	1.2.2.3
+++ openid_client_ax.info	21 Apr 2009 08:32:13 -0000
@@ -4,6 +4,5 @@ description = Provides the ability to do
 version = "6.x"
 core = 6.x
 dependencies[] = openid
-dependencies[] = openid_cp_field
 package = "OpenID"
 
Index: openid_client_ax.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/openid_client_ax/openid_client_ax.module,v
retrieving revision 1.2.2.3
diff -u -p -r1.2.2.3 openid_client_ax.module
--- openid_client_ax.module	20 Apr 2009 12:18:54 -0000	1.2.2.3
+++ openid_client_ax.module	21 Apr 2009 08:32:14 -0000
@@ -43,15 +43,16 @@ function openid_client_ax_openid($op, $r
   if ($op == 'request' && variable_get('openid_client_ax_enabled', TRUE)) {
     $request[sprintf('openid.ns.%s', variable_get('openid_client_ax_alias', 'ax'))] = 'http://openid.net/srv/ax/1.0';
     $request[sprintf('openid.%s.mode', variable_get('openid_client_ax_alias', 'ax'))] = 'fetch_request';
-    $mapping = array();
-    openid_cp_field_get_mapping($mapping);
-    $short_names = array();
-    foreach ($mapping as $openid => $node) {
+    $short_names = $mapping = array();
+    $mapping = module_invoke_all('openid_client_ax', 'get');
+    foreach ($mapping as $openid) {
       $parts = explode('/', $openid);
       $short_names[] = $parts[count($parts) - 1];
       $request[sprintf('openid.%s.type.'. $parts[count($parts) - 1], variable_get('openid_client_ax_alias', 'ax'))] = $openid;
     }
-    $request[sprintf('openid.%s.if_available', variable_get('openid_client_ax_alias', 'ax'))] = implode(",", $short_names);
+    if (count($short_names) > 0) {
+      $request[sprintf('openid.%s.if_available', variable_get('openid_client_ax_alias', 'ax'))] = implode(",", $short_names);
+    }
   }
   return $request;
 }
@@ -121,9 +122,9 @@ function openid_client_ax_authentication
   $account = user_external_load($identity);
   if (isset($account->uid)) {
     if (!variable_get('user_email_verification', TRUE) || $account->login) {
-      if (user_external_login($account, $_SESSION['openid']['user_login_values']) === TRUE) {
-        // Calling the openid_response hook so any other modules can have access to the response
-        module_invoke_all('openid_response', $response, $account);
+      if (user_external_login($account, $_SESSION['openid']['user_login_values']) === TRUE && variable_get('openid_client_ax_enabled', FALSE)) {
+        // Let other modules to save the things to the user
+        module_invoke_all('openid_client_ax', 'save', $response, $account);
       }
     }
     else {
@@ -161,9 +162,9 @@ function openid_client_ax_authentication
         drupal_goto();
       }
       // Verify if the user_external_login failed or suceeded
-      if (user_external_login($account) === TRUE) {
-        // Calling the openid_response hook so any other modules can have access to the response
-        module_invoke_all('openid_response', $response, $account);
+      if (user_external_login($account) === TRUE && variable_get('openid_client_ax_enabled', FALSE)) {
+        // Let other modules to save the things to the user
+        module_invoke_all('openid_client_ax', 'save', $response, $account);
       }
     }
     drupal_redirect_form($form, $form_state['redirect']);
@@ -175,72 +176,6 @@ function openid_client_ax_authentication
 }
 
 /**
- * Implementation of hook_openid_response()
- *
- * @param $response
- *      Array holding all openid response data
- * @param $account
- *      User object of the user being updated
- */
-function openid_client_ax_openid_response($response = array(), $account) {
-  if (variable_get('openid_client_ax_enabled', FALSE)) {
-    $user_update = array();
-    if (module_exists('content_profile')) {
-      $types = content_profile_get_types('names');
-      foreach ($types as $type => $value) {
-        break;
-      }
-      // Update the users existing content profile node if one exists for the user
-      if (!($profile = content_profile_load($type, $account->uid))) {
-        $profile = new StdClass();
-        $profile->uid = $account->uid;
-        $profile->type = $type;
-      }
-    }
-    // Go through all of the returned attributes and save them for the user
-    $mapping = array();
-    openid_cp_field_get_mapping($mapping);
-    foreach ($mapping as $openid => $node) {
-      $short_name = array_pop(explode('/', $openid));
-      if (isset($response['openid.ax.value.'. $short_name]))
-      $field_value = $response['openid.ax.value.'. $short_name];
-      if (!empty($field_value)) {
-        $profile->$node = array();
-        // Check if it's a CCK field or not
-        if (strstr($node, 'field_') && module_exists('content_profile')) {
-          $profile->{$node}[0]['value'] = $field_value;
-        }
-        else {
-          $profile->{$node} = $field_value;
-        }
-      }
-    }
-    if (!isset($profile->title)) {
-      $profile->title = $account->name;
-    }
-    
-    // saving the user account with any pertinent information inside it
-    if (!empty($user_update)) {
-      user_save($account, $user_update);
-    }
-    // If the content profile module exists save the content profile node
-    if (module_exists('content_profile')) {
-      $profile = node_submit($profile);
-      // Supressing the notifications for Content Profile Nodes if the administrator has specified
-      if (variable_get('openid_client_ax_supress_notifications', FALSE)) {
-        $profile->notifications_content_disable = 1;
-      }
-      // Since we utilize autonodetitle for the titles have added this to update the node title
-      // If the module auto_nodetitle exists in the system.
-      if (module_exists('auto_nodetitle')) {
-        auto_nodetitle_set_title($profile);
-      }
-      node_save($profile);
-    }
-  }
-}
-
-/**
  * Helper function to retrieve the values if we have a multiple value attribute returned
  *
  * @param $response
