ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
Auth_OpenID_SRegBase Class Reference
+ Inheritance diagram for Auth_OpenID_SRegBase:
+ Collaboration diagram for Auth_OpenID_SRegBase:

Static Public Member Functions

static _getSRegNS ($message)
 Extract the simple registration namespace URI from the given OpenID message. More...
 

Additional Inherited Members

- 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...
 
- 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 109 of file SReg.php.

Member Function Documentation

◆ _getSRegNS()

static Auth_OpenID_SRegBase::_getSRegNS (   $message)
static

Extract the simple registration namespace URI from the given OpenID message.

Handles OpenID 1 and 2, as well as both sreg namespace URIs found in the wild, as well as missing namespace definitions (for OpenID 1)

$message: The OpenID message from which to parse simple registration fields. This may be a request or response message.

Returns the sreg namespace URI for the supplied message. The message may be modified to define a simple registration namespace.

private

Definition at line 125 of file SReg.php.

References Auth_OpenID_SREG_NS_URI_1_0, and Auth_OpenID_SREG_NS_URI_1_1.

126  {
127  $alias = null;
128  $found_ns_uri = null;
129 
130  // See if there exists an alias for one of the two defined
131  // simple registration types.
132  foreach (array(Auth_OpenID_SREG_NS_URI_1_1,
133  Auth_OpenID_SREG_NS_URI_1_0) as $sreg_ns_uri) {
134  $alias = $message->namespaces->getAlias($sreg_ns_uri);
135  if ($alias !== null) {
136  $found_ns_uri = $sreg_ns_uri;
137  break;
138  }
139  }
140 
141  if ($alias === null) {
142  // There is no alias for either of the types, so try to
143  // add one. We default to using the modern value (1.1)
144  $found_ns_uri = Auth_OpenID_SREG_NS_URI_1_1;
145  if ($message->namespaces->addAlias(Auth_OpenID_SREG_NS_URI_1_1,
146  'sreg') === null) {
147  // An alias for the string 'sreg' already exists, but
148  // it's defined for something other than simple
149  // registration
150  return null;
151  }
152  }
153 
154  return $found_ns_uri;
155  }
const Auth_OpenID_SREG_NS_URI_1_1
Definition: SReg.php:81
const Auth_OpenID_SREG_NS_URI_1_0
Definition: SReg.php:77

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