Auth_OpenID_AX_FetchResponse Klassenreferenz

Abgeleitet von Auth_OpenID_AX_KeyValueMessage.

Zusammengehörigkeiten von Auth_OpenID_AX_FetchResponse:

Collaboration graph
[Legende]

Öffentliche Methoden

 Auth_OpenID_AX_FetchResponse ($update_url=null)
 getExtensionArgs ($request=null)
 parseExtensionArgs ($ax_args)
 fromSuccessResponse ($success_response, $signed=true)

Datenfelder

 $mode = 'fetch_response'

Ausführliche Beschreibung

Definiert in Zeile 792 der Datei AX.php.


Dokumentation der Elementfunktionen

Auth_OpenID_AX_FetchResponse ( update_url = null  ) 

Definiert in Zeile 795 der Datei AX.php.

00797     {
00798         $this->Auth_OpenID_AX_KeyValueMessage();
00799         $this->update_url = $update_url;

fromSuccessResponse ( success_response,
signed = true 
)

Construct a FetchResponse object from an OpenID library SuccessResponse object.

Parameter:
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.
Rückgabe:
$response A FetchResponse containing the data from the OpenID message

Definiert in Zeile 924 der Datei AX.php.

00926     {
00927         $obj = new Auth_OpenID_AX_FetchResponse();
00928         if ($signed) {
00929             $ax_args = $success_response->getSignedNS($obj->ns_uri);
00930         } else {
00931             $ax_args = $success_response->message->getArgs($obj->ns_uri);
00932         }
00933         if ($ax_args === null || Auth_OpenID::isFailure($ax_args) ||
00934               sizeof($ax_args) == 0) {
00935             return null;
00936         }
00937 
00938         $result = $obj->parseExtensionArgs($ax_args);
00939         if (Auth_OpenID_AX::isError($result)) {
00940             #XXX log me
00941             return null;
00942         }
00943         return $obj;

getExtensionArgs ( request = null  ) 

Serialize this object into arguments in the attribute exchange namespace

Rückgabe:
$args The dictionary of unqualified attribute exchange arguments that represent this fetch_response, or Auth_OpenID_AX_Error on error.

Definiert in Zeile 809 der Datei AX.php.

00811     {
00812         $aliases = new Auth_OpenID_NamespaceMap();
00813 
00814         $zero_value_types = array();
00815 
00816         if ($request !== null) {
00817             // Validate the data in the context of the request (the
00818             // same attributes should be present in each, and the
00819             // counts in the response must be no more than the counts
00820             // in the request)
00821 
00822             foreach ($this->data as $type_uri => $unused) {
00823                 if (!$request->contains($type_uri)) {
00824                     return new Auth_OpenID_AX_Error(
00825                       sprintf("Response attribute not present in request: %s",
00826                               $type_uri)
00827                       );
00828                 }
00829             }
00830 
00831             foreach ($request->iterAttrs() as $attr_info) {
00832                 // Copy the aliases from the request so that reading
00833                 // the response in light of the request is easier
00834                 if ($attr_info->alias === null) {
00835                     $aliases->add($attr_info->type_uri);
00836                 } else {
00837                     $alias = $aliases->addAlias($attr_info->type_uri,
00838                                                 $attr_info->alias);
00839 
00840                     if ($alias === null) {
00841                         return new Auth_OpenID_AX_Error(
00842                           sprintf("Could not add alias %s for URI %s",
00843                                   $attr_info->alias, $attr_info->type_uri)
00844                           );
00845                     }
00846                 }
00847 
00848                 if (array_key_exists($attr_info->type_uri, $this->data)) {
00849                     $values = $this->data[$attr_info->type_uri];
00850                 } else {
00851                     $values = array();
00852                     $zero_value_types[] = $attr_info;
00853                 }
00854 
00855                 if (($attr_info->count != Auth_OpenID_AX_UNLIMITED_VALUES) &&
00856                     ($attr_info->count < count($values))) {
00857                     return new Auth_OpenID_AX_Error(
00858                       sprintf("More than the number of requested values " .
00859                               "were specified for %s",
00860                               $attr_info->type_uri)
00861                       );
00862                 }
00863             }
00864         }
00865 
00866         $kv_args = $this->_getExtensionKVArgs($aliases);
00867 
00868         // Add the KV args into the response with the args that are
00869         // unique to the fetch_response
00870         $ax_args = $this->_newArgs();
00871 
00872         // For each requested attribute, put its type/alias and count
00873         // into the response even if no data were returned.
00874         foreach ($zero_value_types as $attr_info) {
00875             $alias = $aliases->getAlias($attr_info->type_uri);
00876             $kv_args['type.' . $alias] = $attr_info->type_uri;
00877             $kv_args['count.' . $alias] = '0';
00878         }
00879 
00880         $update_url = null;
00881         if ($request) {
00882             $update_url = $request->update_url;
00883         } else {
00884             $update_url = $this->update_url;
00885         }
00886 
00887         if ($update_url) {
00888             $ax_args['update_url'] = $update_url;
00889         }
00890 
00891         Auth_OpenID::update(&$ax_args, $kv_args);
00892 
00893         return $ax_args;

parseExtensionArgs ( ax_args  ) 

Rückgabe:
$result Auth_OpenID_AX_Error on failure or true on success.

Erneute Implementation von Auth_OpenID_AX_KeyValueMessage.

Definiert in Zeile 899 der Datei AX.php.

00901     {
00902         $result = parent::parseExtensionArgs($ax_args);
00903 
00904         if (Auth_OpenID_AX::isError($result)) {
00905             return $result;
00906         }
00907 
00908         $this->update_url = Auth_OpenID::arrayGet($ax_args, 'update_url');
00909 
00910         return true;


Dokumentation der Datenelemente

$mode = 'fetch_response'

mode: The type of this attribute exchange message. This must be overridden in subclasses.

Erneute Implementation von Auth_OpenID_AX_Message.

Definiert in Zeile 793 der Datei AX.php.


Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei:
Copyright © 2003 - 2009 MyOOS [Shopsystem]. All rights reserved.
MyOOS [Shopsystem] is Free Software released under the GNU/GPL License.

Webmaster: info@r23.de (Impressum)
doxygen