ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
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)
 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 
)

◆ 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.

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

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
+ 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.

References getReturnTo(), and toMessage().

Referenced by whichEncoding(), and Auth_OpenID_ServerResponse\whichEncoding().

186  {
187  if (!$this->message) {
188  return null;
189  }
190 
191  $msg = $this->toMessage();
192  return $msg->toURL($this->getReturnTo());
193  }
+ 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.

References Auth_OpenID_OPENID_NS.

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

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
+ 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.

References getReturnTo().

Referenced by whichEncoding().

176  {
177  return $this->getReturnTo() !== null;
178  }
+ 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.

References getReturnTo(), and toMessage().

Referenced by toHTML(), and Auth_OpenID_ServerResponse\toHTML().

209  {
210  $msg = $this->toMessage();
211  return $msg->toFormMarkup($this->getReturnTo(), $form_tag_attrs);
212  }
+ 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.

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

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

◆ toMessage()

Auth_OpenID_ServerError::toMessage ( )

Definition at line 220 of file Server.php.

References $namespace, Auth_OpenID_OPENID_NS, and toString().

Referenced by encodeToURL(), and toFormMarkup().

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
const Auth_OpenID_OPENID_NS
Definition: Message.php:42
toString()
Returns this error message.
Definition: Server.php:278
+ 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.

Definition at line 278 of file Server.php.

Referenced by encodeToKVForm(), and toMessage().

279  {
280  if ($this->text) {
281  return $this->text;
282  } else {
283  return get_class($this) . " error";
284  }
285  }
+ 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.

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().

Referenced by Auth_OpenID_ServerResponse\renderAsForm().

247  {
249 
250  if ($this->hasReturnTo()) {
251  if ($this->message->isOpenID2() &&
252  (strlen($this->encodeToURL()) >
255  } else {
256  return Auth_OpenID_ENCODE_URL;
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_OPENID_NS
Definition: Message.php:42
global $_Auth_OpenID_Request_Modes
private
Definition: Server.php:113
const Auth_OpenID_ENCODE_KVFORM
private
Definition: Server.php:120
encodeToURL()
Encodes this error's response as a URL suitable for redirection.
Definition: Server.php:185
const Auth_OpenID_ENCODE_HTML_FORM
private
Definition: Server.php:130
const Auth_OpenID_ENCODE_URL
private
Definition: Server.php:125
hasReturnTo()
Returns the return_to URL for the request which caused this error.
Definition: Server.php:175
const Auth_OpenID_OPENID1_URL_LIMIT
Definition: Message.php:54
+ 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: