ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
Auth_OpenID_Decoder Class Reference
+ Collaboration diagram for Auth_OpenID_Decoder:

Public Member Functions

 Auth_OpenID_Decoder ($server)
 decode ($query)
 Given an HTTP query in an array (key-value pairs), decode it into an Auth_OpenID_Request object.
 defaultDecoder ($message)

Detailed Description

Definition at line 1522 of file Server.php.

Member Function Documentation

Auth_OpenID_Decoder::Auth_OpenID_Decoder (   $server)

Definition at line 1524 of file Server.php.

References $server.

{
$this->server = $server;
$this->handlers = array(
'checkid_setup' => 'Auth_OpenID_CheckIDRequest',
'checkid_immediate' => 'Auth_OpenID_CheckIDRequest',
'check_authentication' => 'Auth_OpenID_CheckAuthRequest',
'associate' => 'Auth_OpenID_AssociateRequest'
);
}
Auth_OpenID_Decoder::decode (   $query)

Given an HTTP query in an array (key-value pairs), decode it into an Auth_OpenID_Request object.

Definition at line 1540 of file Server.php.

References $query, Auth_OpenID\arrayGet(), Auth_OpenID_OPENID2_NS, Auth_OpenID_OPENID_NS, defaultDecoder(), Auth_OpenID_Message\fromPostArgs(), and Auth_OpenID\isFailure().

{
if (!$query) {
return null;
}
if ($message === null) {
/*
* It's useful to have a Message attached to a
* ProtocolError, so we override the bad ns value to build
* a Message out of it. Kinda kludgy, since it's made of
* lies, but the parts that aren't lies are more useful
* than a 'None'.
*/
$old_ns = $query['openid.ns'];
$message,
sprintf("Invalid OpenID namespace URI: %s", $old_ns));
}
$mode = $message->getArg(Auth_OpenID_OPENID_NS, 'mode');
if (!$mode) {
return new Auth_OpenID_ServerError($message,
"No mode value in message");
}
if (Auth_OpenID::isFailure($mode)) {
return new Auth_OpenID_ServerError($message,
$mode->message);
}
$handlerCls = Auth_OpenID::arrayGet($this->handlers, $mode,
$this->defaultDecoder($message));
if (!is_a($handlerCls, 'Auth_OpenID_ServerError')) {
return call_user_func_array(array($handlerCls, 'fromMessage'),
array($message, $this->server));
} else {
return $handlerCls;
}
}

+ Here is the call graph for this function:

Auth_OpenID_Decoder::defaultDecoder (   $message)

Definition at line 1587 of file Server.php.

References Auth_OpenID_OPENID_NS, and Auth_OpenID\isFailure().

Referenced by decode().

{
$mode = $message->getArg(Auth_OpenID_OPENID_NS, 'mode');
if (Auth_OpenID::isFailure($mode)) {
return new Auth_OpenID_ServerError($message,
$mode->message);
}
return new Auth_OpenID_ServerError($message,
sprintf("Unrecognized OpenID mode %s", $mode));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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