ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
Auth_OpenID_Encoder Class Reference
+ Inheritance diagram for Auth_OpenID_Encoder:
+ Collaboration diagram for Auth_OpenID_Encoder:

Public Member Functions

 encode ($response)
 Encode an Auth_OpenID_ServerResponse and return an Auth_OpenID_WebResponse.

Data Fields

 $responseFactory = 'Auth_OpenID_WebResponse'

Detailed Description

Definition at line 1443 of file Server.php.

Member Function Documentation

Auth_OpenID_Encoder::encode (   $response)

Encode an Auth_OpenID_ServerResponse and return an Auth_OpenID_WebResponse.

Reimplemented in Auth_OpenID_SigningEncoder.

Definition at line 1451 of file Server.php.

References $location, $responseFactory, Auth_OpenID_ENCODE_HTML_FORM, Auth_OpenID_ENCODE_KVFORM, Auth_OpenID_ENCODE_URL, AUTH_OPENID_HTTP_ERROR, AUTH_OPENID_HTTP_OK, and AUTH_OPENID_HTTP_REDIRECT.

{
$encode_as = $response->whichEncoding();
if ($encode_as == Auth_OpenID_ENCODE_KVFORM) {
$wr = new $cls(null, null, $response->encodeToKVForm());
if (is_a($response, 'Auth_OpenID_ServerError')) {
}
} else if ($encode_as == Auth_OpenID_ENCODE_URL) {
$location = $response->encodeToURL();
$wr = new $cls(AUTH_OPENID_HTTP_REDIRECT,
array('location' => $location));
} else if ($encode_as == Auth_OpenID_ENCODE_HTML_FORM) {
$wr = new $cls(AUTH_OPENID_HTTP_OK, array(),
$response->toHTML());
} else {
return new Auth_OpenID_EncodingError($response);
}
/* Allow the response to carry a custom error code (ex: for Association errors) */
if(isset($response->code)) {
$wr->code = $response->code;
}
return $wr;
}

Field Documentation

Auth_OpenID_Encoder::$responseFactory = 'Auth_OpenID_WebResponse'

Definition at line 1445 of file Server.php.

Referenced by encode().


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