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

Public Member Functions

 Auth_OpenID_NamespaceMap ()
 getAlias ($namespace_uri)
 getNamespaceURI ($alias)
 iterNamespaceURIs ()
 iterAliases ()
 iteritems ()
 isImplicit ($namespace_uri)
 addAlias ($namespace_uri, $desired_alias, $implicit=false)
 add ($namespace_uri)
 contains ($namespace_uri)
 isDefined ($namespace_uri)

Detailed Description

Definition at line 275 of file Message.php.

Member Function Documentation

Auth_OpenID_NamespaceMap::add (   $namespace_uri)

Definition at line 370 of file Message.php.

References addAlias().

{
// Add this namespace URI to the mapping, without caring what
// alias it ends up with
// See if this namespace is already mapped to an alias
$alias = $this->namespace_to_alias->get($namespace_uri);
if ($alias !== null) {
return $alias;
}
// Fall back to generating a numerical alias
$i = 0;
while (1) {
$alias = 'ext' . strval($i);
if ($this->addAlias($namespace_uri, $alias) === null) {
$i += 1;
} else {
return $alias;
}
}
// Should NEVER be reached!
return null;

+ Here is the call graph for this function:

Auth_OpenID_NamespaceMap::addAlias (   $namespace_uri,
  $desired_alias,
  $implicit = false 
)

Definition at line 315 of file Message.php.

References $Auth_OpenID_OPENID_PROTOCOL_FIELDS, Auth_OpenID_NULL_NAMESPACE, and Auth_OpenID\log().

Referenced by add().

{
// Add an alias from this namespace URI to the desired alias
// Check that desired_alias is not an openid protocol field as
// per the spec.
if (in_array($desired_alias, $Auth_OpenID_OPENID_PROTOCOL_FIELDS)) {
Auth_OpenID::log("\"%s\" is not an allowed namespace alias",
$desired_alias);
return null;
}
// Check that desired_alias does not contain a period as per
// the spec.
if (strpos($desired_alias, '.') !== false) {
Auth_OpenID::log('"%s" must not contain a dot', $desired_alias);
return null;
}
// Check that there is not a namespace already defined for the
// desired alias
$current_namespace_uri =
$this->alias_to_namespace->get($desired_alias);
if (($current_namespace_uri !== null) &&
($current_namespace_uri != $namespace_uri)) {
Auth_OpenID::log('Cannot map "%s" because previous mapping exists',
$namespace_uri);
return null;
}
// Check that there is not already a (different) alias for
// this namespace URI
$alias = $this->namespace_to_alias->get($namespace_uri);
if (($alias !== null) && ($alias != $desired_alias)) {
Auth_OpenID::log('Cannot map %s to alias %s. ' .
'It is already mapped to alias %s',
$namespace_uri, $desired_alias, $alias);
return null;
}
assert((Auth_OpenID_NULL_NAMESPACE === $desired_alias) ||
is_string($desired_alias));
$this->alias_to_namespace->set($desired_alias, $namespace_uri);
$this->namespace_to_alias->set($namespace_uri, $desired_alias);
if ($implicit) {
array_push($this->implicit_namespaces, $namespace_uri);
}
return $desired_alias;

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Auth_OpenID_NamespaceMap::Auth_OpenID_NamespaceMap ( )

Definition at line 276 of file Message.php.

References Auth_OpenID_NamespaceMap().

Referenced by Auth_OpenID_NamespaceMap().

{
{
$this->alias_to_namespace = new Auth_OpenID_Mapping();
$this->namespace_to_alias = new Auth_OpenID_Mapping();
$this->implicit_namespaces = array();

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Auth_OpenID_NamespaceMap::contains (   $namespace_uri)

Definition at line 397 of file Message.php.

References isDefined().

{
return $this->isDefined($namespace_uri);

+ Here is the call graph for this function:

Auth_OpenID_NamespaceMap::getAlias (   $namespace_uri)

Definition at line 283 of file Message.php.

{
return $this->namespace_to_alias->get($namespace_uri);
Auth_OpenID_NamespaceMap::getNamespaceURI (   $alias)

Definition at line 288 of file Message.php.

{
return $this->alias_to_namespace->get($alias);
Auth_OpenID_NamespaceMap::isDefined (   $namespace_uri)

Definition at line 402 of file Message.php.

Referenced by contains().

{
return $this->namespace_to_alias->contains($namespace_uri);

+ Here is the caller graph for this function:

Auth_OpenID_NamespaceMap::isImplicit (   $namespace_uri)

Definition at line 310 of file Message.php.

{
return in_array($namespace_uri, $this->implicit_namespaces);
Auth_OpenID_NamespaceMap::iterAliases ( )

Definition at line 299 of file Message.php.

{
// Return an iterator over the aliases"""
return $this->alias_to_namespace->keys();
Auth_OpenID_NamespaceMap::iteritems ( )

Definition at line 305 of file Message.php.

{
return $this->namespace_to_alias->items();
Auth_OpenID_NamespaceMap::iterNamespaceURIs ( )

Definition at line 293 of file Message.php.

{
// Return an iterator over the namespace URIs
return $this->namespace_to_alias->keys();

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