function openid_extract_ax_values

cis7 openid.inc openid_extract_ax_values($values, $uris)
cle7 openid.inc openid_extract_ax_values($values, $uris)
elmsmedia7 openid.inc openid_extract_ax_values($values, $uris)
icor7 openid.inc openid_extract_ax_values($values, $uris)
meedjum_blog7 openid.inc openid_extract_ax_values($values, $uris)
mooc7 openid.inc openid_extract_ax_values($values, $uris)

Extracts values from an OpenID AX Response.

The values can be returned in two forms:

  • only openid.ax.value.<alias> (for single-valued answers)
  • both openid.ax.count.<alias> and openid.ax.value.<alias>.<count> (for both single and multiple-valued answers)

Parameters

$values: An array as returned by openid_extract_namespace(..., OPENID_NS_AX).

$uris: An array of identifier URIs.

Return value

An array of values.

See also

http://openid.net/specs/openid-attribute-exchange-1_0.html#fetch_response

2 calls to openid_extract_ax_values()
openid_form_user_register_form_alter in modules/openid/openid.module
Implements hook_form_FORM_ID_alter().
_openid_invalid_openid_transition in modules/openid/openid.inc
Provides transition for accounts with possibly invalid OpenID identifiers in authmap.

File

modules/openid/openid.inc, line 692
OpenID utility functions.

Code

function openid_extract_ax_values($values, $uris) {
  $output = array();
  foreach ($values as $key => $value) {
    if (in_array($value, $uris) && preg_match('/^type\.([^.]+)$/', $key, $matches)) {
      $alias = $matches[1];
      if (isset($values['count.' . $alias])) {
        for ($i = 1; $i <= $values['count.' . $alias]; $i++) {
          $output[] = $values['value.' . $alias . '.' . $i];
        }
      }
      elseif (isset($values['value.' . $alias])) {
        $output[] = $values['value.' . $alias];
      }
      break;
    }
  }
  return $output;
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.