ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
Auth_OpenID_SRegResponse Class Reference
+ Inheritance diagram for Auth_OpenID_SRegResponse:
+ Collaboration diagram for Auth_OpenID_SRegResponse:

Public Member Functions

 Auth_OpenID_SRegResponse ($data=null, $sreg_ns_uri=Auth_OpenID_SREG_NS_URI)
 
 getExtensionArgs ()
 
 get ($field_name, $default=null)
 
 contents ()
 
- Public Member Functions inherited from Auth_OpenID_Extension
 getExtensionArgs ()
 Get the string arguments that should be added to an OpenID message for this extension. More...
 
 toMessage ($message)
 Add the arguments from this extension to the provided message. More...
 

Static Public Member Functions

static extractResponse ($request, $data)
 Take a C{L{SRegRequest}} and a dictionary of simple registration values and create a C{L{SRegResponse}} object containing that data. More...
 
static fromSuccessResponse ($success_response, $signed_only=true)
 Create a C{L{SRegResponse}} object from a successful OpenID library response (C{L{openid.consumer.consumer.SuccessResponse}}) response message. More...
 
- Static Public Member Functions inherited from Auth_OpenID_SRegBase
static _getSRegNS ($message)
 Extract the simple registration namespace URI from the given OpenID message. More...
 

Data Fields

 $ns_alias = 'sreg'
 
- Data Fields inherited from Auth_OpenID_Extension
 $ns_uri = null
 ns_uri: The namespace to which to add the arguments for this extension More...
 
 $ns_alias = null
 

Detailed Description

Definition at line 417 of file SReg.php.

Member Function Documentation

◆ Auth_OpenID_SRegResponse()

Auth_OpenID_SRegResponse::Auth_OpenID_SRegResponse (   $data = null,
  $sreg_ns_uri = Auth_OpenID_SREG_NS_URI 
)

Definition at line 421 of file SReg.php.

References $data.

423  {
424  if ($data === null) {
425  $this->data = array();
426  } else {
427  $this->data = $data;
428  }
429 
430  $this->ns_uri = $sreg_ns_uri;
431  }
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data

◆ contents()

Auth_OpenID_SRegResponse::contents ( )

Definition at line 515 of file SReg.php.

References $data.

516  {
517  return $this->data;
518  }
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data

◆ extractResponse()

static Auth_OpenID_SRegResponse::extractResponse (   $request,
  $data 
)
static

Take a C{L{SRegRequest}} and a dictionary of simple registration values and create a C{L{SRegResponse}} object containing that data.

request: The simple registration request object

data: The simple registration data for this response, as a dictionary from unqualified simple registration field name to string (unicode) value. For instance, the nickname should be stored under the key 'nickname'.

Definition at line 445 of file SReg.php.

References $data, and Auth_OpenID\arrayGet().

446  {
447  $obj = new Auth_OpenID_SRegResponse();
448  $obj->ns_uri = $request->ns_uri;
449 
450  foreach ($request->allRequestedFields() as $field) {
451  $value = Auth_OpenID::arrayGet($data, $field);
452  if ($value !== null) {
453  $obj->data[$field] = $value;
454  }
455  }
456 
457  return $obj;
458  }
Auth_OpenID_SRegResponse($data=null, $sreg_ns_uri=Auth_OpenID_SREG_NS_URI)
Definition: SReg.php:421
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
static arrayGet($arr, $key, $fallback=null)
Convenience function for getting array values.
Definition: OpenID.php:242
+ Here is the call graph for this function:

◆ fromSuccessResponse()

static Auth_OpenID_SRegResponse::fromSuccessResponse (   $success_response,
  $signed_only = true 
)
static

Create a C{L{SRegResponse}} object from a successful OpenID library response (C{L{openid.consumer.consumer.SuccessResponse}}) response message.

success_response: A SuccessResponse from consumer.complete()

signed_only: Whether to process only data that was signed in the id_res message from the server.

Returns a simple registration response containing the data that was supplied with the C{id_res} response.

Definition at line 474 of file SReg.php.

References $Auth_OpenID_sreg_data_fields, and Auth_OpenID\isFailure().

Referenced by ilAuthContainerOpenId\fetchData().

475  {
477 
478  $obj = new Auth_OpenID_SRegResponse();
479  $obj->ns_uri = $obj->_getSRegNS($success_response->message);
480 
481  if ($signed_only) {
482  $args = $success_response->getSignedNS($obj->ns_uri);
483  } else {
484  $args = $success_response->message->getArgs($obj->ns_uri);
485  }
486 
487  if ($args === null || Auth_OpenID::isFailure($args)) {
488  return null;
489  }
490 
491  foreach ($Auth_OpenID_sreg_data_fields as $field_name => $desc) {
492  if (in_array($field_name, array_keys($args))) {
493  $obj->data[$field_name] = $args[$field_name];
494  }
495  }
496 
497  return $obj;
498  }
Auth_OpenID_SRegResponse($data=null, $sreg_ns_uri=Auth_OpenID_SREG_NS_URI)
Definition: SReg.php:421
global $Auth_OpenID_sreg_data_fields
Import message and extension internals.
Definition: SReg.php:45
static isFailure($thing)
Return true if $thing is an Auth_OpenID_FailureResponse object; false if not.
Definition: OpenID.php:118
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get()

Auth_OpenID_SRegResponse::get (   $field_name,
  $default = null 
)

Definition at line 506 of file SReg.php.

References Auth_OpenID\arrayGet(), and Auth_OpenID_checkFieldName().

507  {
508  if (!Auth_OpenID_checkFieldName($field_name)) {
509  return null;
510  }
511 
512  return Auth_OpenID::arrayGet($this->data, $field_name, $default);
513  }
Auth_OpenID_checkFieldName($field_name)
Check to see that the given value is a valid simple registration data field name. ...
Definition: SReg.php:65
static arrayGet($arr, $key, $fallback=null)
Convenience function for getting array values.
Definition: OpenID.php:242
+ Here is the call graph for this function:

◆ getExtensionArgs()

Auth_OpenID_SRegResponse::getExtensionArgs ( )

Definition at line 500 of file SReg.php.

References $data.

501  {
502  return $this->data;
503  }
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data

Field Documentation

◆ $ns_alias

Auth_OpenID_SRegResponse::$ns_alias = 'sreg'

Definition at line 419 of file SReg.php.


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