ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
Auth_OpenID_AX_FetchResponse Class Reference
+ Inheritance diagram for Auth_OpenID_AX_FetchResponse:
+ Collaboration diagram for Auth_OpenID_AX_FetchResponse:

Public Member Functions

 Auth_OpenID_AX_FetchResponse ($update_url=null)
 getExtensionArgs ($request=null)
 Serialize this object into arguments in the attribute exchange namespace.
 parseExtensionArgs ($ax_args)
- Public Member Functions inherited from Auth_OpenID_AX_KeyValueMessage
 Auth_OpenID_AX_KeyValueMessage ()
 addValue ($type_uri, $value)
 Add a single value for the given attribute type to the message.
 setValues ($type_uri, &$values)
 Set the values for the given attribute type.
 _getExtensionKVArgs ($aliases)
 Get the extension arguments for the key/value pairs contained in this message.
 getSingle ($type_uri, $default=null)
 Get a single value for an attribute.
 get ($type_uri)
 Get the list of values for this attribute in the fetch_response.
 count ($type_uri)
 Get the number of responses for a particular attribute in this fetch_response message.
- Public Member Functions inherited from Auth_OpenID_AX_Message
 _checkMode ($ax_args)
 Return Auth_OpenID_AX_Error if the mode in the attribute exchange arguments does not match what is expected for this class; true otherwise.
 _newArgs ()
 Return a set of attribute exchange arguments containing the basic information that must be in every attribute exchange message.
- Public Member Functions inherited from Auth_OpenID_Extension
 getExtensionArgs ()
 Get the string arguments that should be added to an OpenID message for this extension.
 toMessage ($message)
 Add the arguments from this extension to the provided message.

Static Public Member Functions

static fromSuccessResponse ($success_response, $signed=true)
 Construct a FetchResponse object from an OpenID library SuccessResponse object.

Data Fields

 $mode = 'fetch_response'

Detailed Description

Definition at line 792 of file AX.php.

Member Function Documentation

Auth_OpenID_AX_FetchResponse::Auth_OpenID_AX_FetchResponse (   $update_url = null)

Definition at line 795 of file AX.php.

References Auth_OpenID_AX_KeyValueMessage\Auth_OpenID_AX_KeyValueMessage().

{
$this->update_url = $update_url;

+ Here is the call graph for this function:

static Auth_OpenID_AX_FetchResponse::fromSuccessResponse (   $success_response,
  $signed = true 
)
static

Construct a FetchResponse object from an OpenID library SuccessResponse object.

Parameters
success_response,:A successful id_res response object
signed,:Whether non-signed args should be processsed. If True (the default), only signed arguments will be processsed.
Returns
$response A FetchResponse containing the data from the OpenID message

Definition at line 924 of file AX.php.

{
if ($signed) {
$ax_args = $success_response->getSignedNS($obj->ns_uri);
} else {
$ax_args = $success_response->message->getArgs($obj->ns_uri);
}
if ($ax_args === null || Auth_OpenID::isFailure($ax_args) ||
sizeof($ax_args) == 0) {
return null;
}
$result = $obj->parseExtensionArgs($ax_args);
#XXX log me
return null;
}
return $obj;
Auth_OpenID_AX_FetchResponse::getExtensionArgs (   $request = null)

Serialize this object into arguments in the attribute exchange namespace.

Returns
$args The dictionary of unqualified attribute exchange arguments that represent this fetch_response, or Auth_OpenID_AX_Error on error.

Definition at line 809 of file AX.php.

{
$zero_value_types = array();
if ($request !== null) {
// Validate the data in the context of the request (the
// same attributes should be present in each, and the
// counts in the response must be no more than the counts
// in the request)
foreach ($this->data as $type_uri => $unused) {
if (!$request->contains($type_uri)) {
sprintf("Response attribute not present in request: %s",
$type_uri)
);
}
}
foreach ($request->iterAttrs() as $attr_info) {
// Copy the aliases from the request so that reading
// the response in light of the request is easier
if ($attr_info->alias === null) {
$aliases->add($attr_info->type_uri);
} else {
$alias = $aliases->addAlias($attr_info->type_uri,
$attr_info->alias);
if ($alias === null) {
sprintf("Could not add alias %s for URI %s",
$attr_info->alias, $attr_info->type_uri)
);
}
}
if (array_key_exists($attr_info->type_uri, $this->data)) {
$values = $this->data[$attr_info->type_uri];
} else {
$values = array();
$zero_value_types[] = $attr_info;
}
if (($attr_info->count != Auth_OpenID_AX_UNLIMITED_VALUES) &&
($attr_info->count < count($values))) {
sprintf("More than the number of requested values " .
"were specified for %s",
$attr_info->type_uri)
);
}
}
}
$kv_args = $this->_getExtensionKVArgs($aliases);
// Add the KV args into the response with the args that are
// unique to the fetch_response
$ax_args = $this->_newArgs();
// For each requested attribute, put its type/alias and count
// into the response even if no data were returned.
foreach ($zero_value_types as $attr_info) {
$alias = $aliases->getAlias($attr_info->type_uri);
$kv_args['type.' . $alias] = $attr_info->type_uri;
$kv_args['count.' . $alias] = '0';
}
$update_url = null;
if ($request) {
$update_url = $request->update_url;
} else {
$update_url = $this->update_url;
}
if ($update_url) {
$ax_args['update_url'] = $update_url;
}
Auth_OpenID::update($ax_args, $kv_args);
return $ax_args;
Auth_OpenID_AX_FetchResponse::parseExtensionArgs (   $ax_args)
Returns
$result Auth_OpenID_AX_Error on failure or true on success.

Reimplemented from Auth_OpenID_AX_KeyValueMessage.

Definition at line 899 of file AX.php.

{
return $result;
}
$this->update_url = Auth_OpenID::arrayGet($ax_args, 'update_url');
return true;

Field Documentation

Auth_OpenID_AX_FetchResponse::$mode = 'fetch_response'

Definition at line 793 of file AX.php.


The documentation for this class was generated from the following file: