ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
Auth_OpenID_ServerError Class Reference
+ Inheritance diagram for Auth_OpenID_ServerError:
+ Collaboration diagram for Auth_OpenID_ServerError:

Public Member Functions

 Auth_OpenID_ServerError ($message=null, $text=null, $reference=null, $contact=null)
 @access private More...
 
 getReturnTo ()
 
 hasReturnTo ()
 Returns the return_to URL for the request which caused this error. More...
 
 encodeToURL ()
 Encodes this error's response as a URL suitable for redirection. More...
 
 encodeToKVForm ()
 Encodes the response to key-value form. More...
 
 toFormMarkup ($form_tag_attrs=null)
 
 toHTML ($form_tag_attrs=null)
 
 toMessage ()
 
 whichEncoding ()
 Returns one of Auth_OpenID_ENCODE_URL, Auth_OpenID_ENCODE_KVFORM, or null, depending on the type of encoding expected for this error's payload. More...
 
 toString ()
 Returns this error message. More...
 

Detailed Description

Definition at line 147 of file Server.php.

Member Function Documentation

◆ Auth_OpenID_ServerError()

Auth_OpenID_ServerError::Auth_OpenID_ServerError (   $message = null,
  $text = null,
  $reference = null,
  $contact = null 
)

@access private

Definition at line 151 of file Server.php.

153 {
154 $this->message = $message;
155 $this->text = $text;
156 $this->contact = $contact;
157 $this->reference = $reference;
158 }
$text

References $text.

◆ encodeToKVForm()

Auth_OpenID_ServerError::encodeToKVForm ( )

Encodes the response to key-value form.

This is a machine-readable format used to respond to messages which came directly from the consumer and not through the user-agent. See the OpenID specification.

Definition at line 201 of file Server.php.

202 {
204 array('mode' => 'error',
205 'error' => $this->toString()));
206 }
static fromArray($values)
Convert an array into an OpenID colon/newline separated string.
Definition: KVForm.php:81
toString()
Returns this error message.
Definition: Server.php:278

References Auth_OpenID_KVForm\fromArray(), and toString().

+ Here is the call graph for this function:

◆ encodeToURL()

Auth_OpenID_ServerError::encodeToURL ( )

Encodes this error's response as a URL suitable for redirection.

If the response has no return_to, another Auth_OpenID_ServerError is returned.

Definition at line 185 of file Server.php.

186 {
187 if (!$this->message) {
188 return null;
189 }
190
191 $msg = $this->toMessage();
192 return $msg->toURL($this->getReturnTo());
193 }

References getReturnTo(), and toMessage().

Referenced by whichEncoding().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getReturnTo()

Auth_OpenID_ServerError::getReturnTo ( )

Definition at line 160 of file Server.php.

161 {
162 if ($this->message &&
163 $this->message->hasKey(Auth_OpenID_OPENID_NS, 'return_to')) {
164 return $this->message->getArg(Auth_OpenID_OPENID_NS,
165 'return_to');
166 } else {
167 return null;
168 }
169 }
const Auth_OpenID_OPENID_NS
Definition: Message.php:42

References Auth_OpenID_OPENID_NS.

Referenced by encodeToURL(), hasReturnTo(), and toFormMarkup().

+ Here is the caller graph for this function:

◆ hasReturnTo()

Auth_OpenID_ServerError::hasReturnTo ( )

Returns the return_to URL for the request which caused this error.

Definition at line 175 of file Server.php.

176 {
177 return $this->getReturnTo() !== null;
178 }

References getReturnTo().

Referenced by whichEncoding().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toFormMarkup()

Auth_OpenID_ServerError::toFormMarkup (   $form_tag_attrs = null)

Definition at line 208 of file Server.php.

209 {
210 $msg = $this->toMessage();
211 return $msg->toFormMarkup($this->getReturnTo(), $form_tag_attrs);
212 }

References getReturnTo(), and toMessage().

Referenced by toHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toHTML()

Auth_OpenID_ServerError::toHTML (   $form_tag_attrs = null)

Definition at line 214 of file Server.php.

215 {
217 $this->toFormMarkup($form_tag_attrs));
218 }
toFormMarkup($form_tag_attrs=null)
Definition: Server.php:208
static autoSubmitHTML($form, $title="OpenId transaction in progress")
Definition: OpenID.php:532

References Auth_OpenID\autoSubmitHTML(), and toFormMarkup().

+ Here is the call graph for this function:

◆ toMessage()

Auth_OpenID_ServerError::toMessage ( )

Definition at line 220 of file Server.php.

221 {
222 // Generate a Message object for sending to the relying party,
223 // after encoding.
224 $namespace = $this->message->getOpenIDNamespace();
225 $reply = new Auth_OpenID_Message($namespace);
226 $reply->setArg(Auth_OpenID_OPENID_NS, 'mode', 'error');
227 $reply->setArg(Auth_OpenID_OPENID_NS, 'error', $this->toString());
228
229 if ($this->contact !== null) {
230 $reply->setArg(Auth_OpenID_OPENID_NS, 'contact', $this->contact);
231 }
232
233 if ($this->reference !== null) {
234 $reply->setArg(Auth_OpenID_OPENID_NS, 'reference',
235 $this->reference);
236 }
237
238 return $reply;
239 }
if($err=$client->getError()) $namespace

References $namespace, Auth_OpenID_OPENID_NS, and toString().

Referenced by encodeToURL(), and toFormMarkup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toString()

Auth_OpenID_ServerError::toString ( )

Returns this error message.

Reimplemented in Auth_OpenID_NoReturnToError, Auth_OpenID_MalformedTrustRoot, and Auth_OpenID_UntrustedReturnURL.

Definition at line 278 of file Server.php.

279 {
280 if ($this->text) {
281 return $this->text;
282 } else {
283 return get_class($this) . " error";
284 }
285 }

References $text.

Referenced by encodeToKVForm(), and toMessage().

+ Here is the caller graph for this function:

◆ whichEncoding()

Auth_OpenID_ServerError::whichEncoding ( )

Returns one of Auth_OpenID_ENCODE_URL, Auth_OpenID_ENCODE_KVFORM, or null, depending on the type of encoding expected for this error's payload.

Definition at line 246 of file Server.php.

247 {
249
250 if ($this->hasReturnTo()) {
251 if ($this->message->isOpenID2() &&
252 (strlen($this->encodeToURL()) >
255 } else {
257 }
258 }
259
260 if (!$this->message) {
261 return null;
262 }
263
264 $mode = $this->message->getArg(Auth_OpenID_OPENID_NS,
265 'mode');
266
267 if ($mode) {
268 if (!in_array($mode, $_Auth_OpenID_Request_Modes)) {
270 }
271 }
272 return null;
273 }
const Auth_OpenID_OPENID1_URL_LIMIT
Definition: Message.php:54
const Auth_OpenID_ENCODE_KVFORM
@access private
Definition: Server.php:120
const Auth_OpenID_ENCODE_URL
@access private
Definition: Server.php:125
const Auth_OpenID_ENCODE_HTML_FORM
@access private
Definition: Server.php:130
global $_Auth_OpenID_Request_Modes
@access private
Definition: Server.php:113
encodeToURL()
Encodes this error's response as a URL suitable for redirection.
Definition: Server.php:185
hasReturnTo()
Returns the return_to URL for the request which caused this error.
Definition: Server.php:175

References $_Auth_OpenID_Request_Modes, Auth_OpenID_ENCODE_HTML_FORM, Auth_OpenID_ENCODE_KVFORM, Auth_OpenID_ENCODE_URL, Auth_OpenID_OPENID1_URL_LIMIT, Auth_OpenID_OPENID_NS, encodeToURL(), and hasReturnTo().

+ Here is the call graph for this function:

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