Definition at line 267 of file AX.php.
◆ add()
Auth_OpenID_AX_FetchRequest::add |
( |
|
$attribute | ) |
|
Add an attribute to this attribute exchange request.
- Parameters
-
attribute | The attribute that is being requested |
- Returns
- true on success, false when the requested attribute is already present in this fetch request.
Definition at line 294 of file AX.php.
297 if ($this->
contains($attribute->type_uri)) {
299 sprintf(
"The attribute %s has already been requested",
300 $attribute->type_uri));
303 $this->requested_attributes[$attribute->type_uri] = $attribute;
contains($type_uri)
Is the given type URI present in this fetch_request?
◆ Auth_OpenID_AX_FetchRequest()
Auth_OpenID_AX_FetchRequest::Auth_OpenID_AX_FetchRequest |
( |
|
$update_url = null | ) |
|
requested_attributes: The attributes that have been requested thus far, indexed by the type URI.
update_url: A URL that will accept responses for this attribute exchange request, even in the absence of the user who made this request.
Definition at line 271 of file AX.php.
References $attrib, $result, Auth_OpenID\arrayGet(), Auth_OpenID_AX_toTypeURIs(), Auth_OpenID_AX_UNLIMITED_VALUES, Auth_OpenID_OPENID_NS, Auth_OpenID\intval(), Auth_OpenID_AX\isError(), Auth_OpenID_AX_AttrInfo\make(), and Auth_OpenID_TrustRoot\match().
278 $this->requested_attributes = array();
285 $this->update_url = $update_url;
◆ contains()
Auth_OpenID_AX_FetchRequest::contains |
( |
|
$type_uri | ) |
|
Is the given type URI present in this fetch_request?
Definition at line 527 of file AX.php.
530 return in_array($type_uri, $this->
iterTypes());
◆ fromOpenIDRequest()
static Auth_OpenID_AX_FetchRequest::fromOpenIDRequest |
( |
|
$request | ) |
|
|
static |
Extract a FetchRequest from an OpenID message.
- Parameters
-
request | The OpenID request containing the attribute fetch request |
- Returns
- mixed An Auth_OpenID_AX_Error or the Auth_OpenID_AX_FetchRequest extracted from the request message if successful
Definition at line 388 of file AX.php.
391 $m = $request->message;
393 $ax_args = $m->getArgs($obj->ns_uri);
395 $result = $obj->parseExtensionArgs($ax_args);
401 if ($obj->update_url) {
411 sprintf(
"Cannot validate update_url %s " .
412 "against absent realm", $obj->update_url));
416 sprintf(
"Update URL %s failed validation against realm %s",
417 $obj->update_url, $realm));
const Auth_OpenID_OPENID_NS
Auth_OpenID_AX_FetchRequest($update_url=null)
static match($trust_root, $url)
Does this URL match the given trust root?
◆ getExtensionArgs()
Auth_OpenID_AX_FetchRequest::getExtensionArgs |
( |
| ) |
|
Get the serialized form of this attribute fetch request.
- Returns
- Auth_OpenID_AX_FetchRequest The fetch request message parameters
Definition at line 312 of file AX.php.
318 $if_available = array();
322 foreach ($this->requested_attributes as $type_uri => $attribute) {
323 if ($attribute->alias === null) {
324 $alias = $aliases->add($type_uri);
326 $alias = $aliases->addAlias($type_uri, $attribute->alias);
328 if ($alias === null) {
330 sprintf(
"Could not add alias %s for URI %s",
331 $attribute->alias, $type_uri
336 if ($attribute->required) {
337 $required[] = $alias;
339 $if_available[] = $alias;
342 if ($attribute->count != 1) {
343 $ax_args[
'count.' . $alias] = strval($attribute->count);
346 $ax_args[
'type.' . $alias] = $type_uri;
350 $ax_args[
'required'] = implode(
',', $required);
354 $ax_args[
'if_available'] = implode(
',', $if_available);
_newArgs()
Return a set of attribute exchange arguments containing the basic information that must be in every a...
◆ getRequiredAttrs()
Auth_OpenID_AX_FetchRequest::getRequiredAttrs |
( |
| ) |
|
Get the type URIs for all attributes that have been marked as required.
- Returns
- A list of the type URIs for attributes that have been marked as required.
Definition at line 366 of file AX.php.
370 foreach ($this->requested_attributes as $type_uri => $attribute) {
371 if ($attribute->required) {
372 $required[] = $type_uri;
◆ iterAttrs()
Auth_OpenID_AX_FetchRequest::iterAttrs |
( |
| ) |
|
Iterate over the AttrInfo objects that are contained in this fetch_request.
Definition at line 514 of file AX.php.
517 return array_values($this->requested_attributes);
◆ iterTypes()
Auth_OpenID_AX_FetchRequest::iterTypes |
( |
| ) |
|
Definition at line 519 of file AX.php.
522 return array_keys($this->requested_attributes);
◆ parseExtensionArgs()
Auth_OpenID_AX_FetchRequest::parseExtensionArgs |
( |
|
$ax_args | ) |
|
Given attribute exchange arguments, populate this FetchRequest.
- Returns
- $result Auth_OpenID_AX_Error if the data to be parsed does not follow the attribute exchange specification. At least when 'if_available' or 'required' is not specified for a particular attribute type. Returns true otherwise.
Definition at line 431 of file AX.php.
441 foreach ($ax_args as $key => $value) {
442 if (strpos($key,
'type.') === 0) {
443 $alias = substr($key, 5);
446 $alias = $aliases->addAlias($type_uri, $alias);
448 if ($alias === null) {
450 sprintf(
"Could not add alias %s for URI %s",
458 if (($count ===
false) &&
466 if ($count ===
false) {
468 sprintf(
"Integer value expected for %s, got %s",
469 'count.' . $alias, $count_s));
479 $this->
add($attrinfo);
486 foreach ($required as $type_uri) {
487 $attrib = $this->requested_attributes[$type_uri];
494 $all_type_uris = array_merge($required, $if_available);
496 foreach ($aliases->iterNamespaceURIs() as $type_uri) {
497 if (!in_array($type_uri, $all_type_uris)) {
499 sprintf(
'Type URI %s was in the request but not ' .
500 'present in "required" or "if_available"',
_checkMode($ax_args)
Return Auth_OpenID_AX_Error if the mode in the attribute exchange arguments does not match what is ex...
add($attribute)
Add an attribute to this attribute exchange request.
Auth_OpenID_AX_toTypeURIs($namespace_map, $alias_list_s)
Given a namespace mapping and a string containing a comma-separated list of namespace aliases...
$attrib
Regular expression to match HTML/XML attribute pairs within a tag.
static make($type_uri, $count=1, $required=false, $alias=null)
Construct an attribute information object.
const Auth_OpenID_AX_UNLIMITED_VALUES
static arrayGet($arr, $key, $fallback=null)
Convenience function for getting array values.
static intval($value)
Replacement (wrapper) for PHP's intval() because it's broken.
◆ $mode
Auth_OpenID_AX_FetchRequest::$mode = 'fetch_request' |
The documentation for this class was generated from the following file:
- Services/OpenId/lib/Auth/OpenID/AX.php