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.4
diff -u -p -r1.2.2.4 openid_client_ax.module
--- openid_client_ax.module	21 Apr 2009 12:36:05 -0000	1.2.2.4
+++ openid_client_ax.module	24 Apr 2009 17:33:10 -0000
@@ -40,21 +40,24 @@ function openid_client_ax_menu_alter(&$c
  */
 function openid_client_ax_openid($op, $request = array()) {
   // add our information to the request if op is request and we are enabled
-  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';
+  if ($op == 'request') {
+    $return = array();
+    $return[sprintf('openid.ns.%s', variable_get('openid_client_ax_alias', 'ax'))] = 'http://openid.net/srv/ax/1.0';
+    $return[sprintf('openid.%s.mode', variable_get('openid_client_ax_alias', 'ax'))] = 'fetch_request';
     $short_names = $mapping = array();
-    $mapping = module_invoke_all('openid_client_ax', 'get');
+    $mapping = module_invoke_all('openid_client', '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;
+      if (strstr($openid, 'axschema.org') !== FALSE) {
+        $parts = explode('/', $openid);
+        $short_names[] = $parts[count($parts) - 1];
+        $return[sprintf('openid.%s.type.'. $parts[count($parts) - 1], variable_get('openid_client_ax_alias', 'ax'))] = $openid;
+      }
     }
     if (count($short_names) > 0) {
-      $request[sprintf('openid.%s.if_available', variable_get('openid_client_ax_alias', 'ax'))] = implode(",", $short_names);
+      $return[sprintf('openid.%s.if_available', variable_get('openid_client_ax_alias', 'ax'))] = implode(",", $short_names);
     }
+    return $return;
   }
-  return $request;
 }
 
 /**
@@ -62,12 +65,6 @@ function openid_client_ax_openid($op, $r
  */
 function openid_client_ax_admin_settings() {
   $form['openid_client_ax'] = array('#type' => 'fieldset', '#title' => t('OpenID Client Attribute Exchange Settings'), '#collapsible' => TRUE, '#collapsed' => FALSE);
-  $form['openid_client_ax']['openid_client_ax_enabled'] = array(
-    '#type'          => 'checkbox',
-    '#title'         => t('Enable Attribute Exchange'),
-    '#default_value' => variable_get('openid_client_ax_enabled', FALSE),
-    '#description'   => t('Enable the attribute exchange for OpenID'),
-  );
   $form['openid_client_ax']['openid_client_ax_alias'] = array(
     '#type'          => 'textfield',
     '#title'         => t('Namespace to utilize for Attribute Exchange'),
@@ -122,9 +119,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 && variable_get('openid_client_ax_enabled', FALSE)) {
+      if (user_external_login($account, $_SESSION['openid']['user_login_values']) === TRUE) {
         // Let other modules to save the things to the user
-        module_invoke_all('openid_client_ax', 'save', $response, $account);
+        module_invoke_all('openid_client', 'save', $response, $account);
       }
     }
     else {
@@ -162,9 +159,9 @@ function openid_client_ax_authentication
         drupal_goto();
       }
       // Verify if the user_external_login failed or suceeded
-      if (user_external_login($account) === TRUE && variable_get('openid_client_ax_enabled', FALSE)) {
+      if (user_external_login($account) === TRUE) {
         // Let other modules to save the things to the user
-        module_invoke_all('openid_client_ax', 'save', $response, $account);
+        module_invoke_all('openid_client', 'save', $response, $account);
       }
     }
     drupal_redirect_form($form, $form_state['redirect']);
