Öffentliche Methoden | |
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) |
Definiert in Zeile 275 der Datei Message.php.
add | ( | $ | namespace_uri | ) |
Definiert in Zeile 370 der Datei Message.php.
00372 { 00373 // Add this namespace URI to the mapping, without caring what 00374 // alias it ends up with 00375 00376 // See if this namespace is already mapped to an alias 00377 $alias = $this->namespace_to_alias->get($namespace_uri); 00378 00379 if ($alias !== null) { 00380 return $alias; 00381 } 00382 00383 // Fall back to generating a numerical alias 00384 $i = 0; 00385 while (1) { 00386 $alias = 'ext' . strval($i); 00387 if ($this->addAlias($namespace_uri, $alias) === null) { 00388 $i += 1; 00389 } else { 00390 return $alias; 00391 } 00392 } 00393 00394 // Should NEVER be reached! 00395 return null;
addAlias | ( | $ | namespace_uri, | |
$ | desired_alias, | |||
$ | implicit = false | |||
) |
Definiert in Zeile 315 der Datei Message.php.
00317 { 00318 // Add an alias from this namespace URI to the desired alias 00319 global $Auth_OpenID_OPENID_PROTOCOL_FIELDS; 00320 00321 // Check that desired_alias is not an openid protocol field as 00322 // per the spec. 00323 if (in_array($desired_alias, $Auth_OpenID_OPENID_PROTOCOL_FIELDS)) { 00324 Auth_OpenID::log("\"%s\" is not an allowed namespace alias", 00325 $desired_alias); 00326 return null; 00327 } 00328 00329 // Check that desired_alias does not contain a period as per 00330 // the spec. 00331 if (strpos($desired_alias, '.') !== false) { 00332 Auth_OpenID::log('"%s" must not contain a dot', $desired_alias); 00333 return null; 00334 } 00335 00336 // Check that there is not a namespace already defined for the 00337 // desired alias 00338 $current_namespace_uri = 00339 $this->alias_to_namespace->get($desired_alias); 00340 00341 if (($current_namespace_uri !== null) && 00342 ($current_namespace_uri != $namespace_uri)) { 00343 Auth_OpenID::log('Cannot map "%s" because previous mapping exists', 00344 $namespace_uri); 00345 return null; 00346 } 00347 00348 // Check that there is not already a (different) alias for 00349 // this namespace URI 00350 $alias = $this->namespace_to_alias->get($namespace_uri); 00351 00352 if (($alias !== null) && ($alias != $desired_alias)) { 00353 Auth_OpenID::log('Cannot map %s to alias %s. ' . 00354 'It is already mapped to alias %s', 00355 $namespace_uri, $desired_alias, $alias); 00356 return null; 00357 } 00358 00359 assert((Auth_OpenID_NULL_NAMESPACE === $desired_alias) || 00360 is_string($desired_alias)); 00361 00362 $this->alias_to_namespace->set($desired_alias, $namespace_uri); 00363 $this->namespace_to_alias->set($namespace_uri, $desired_alias); 00364 if ($implicit) { 00365 array_push($this->implicit_namespaces, $namespace_uri); 00366 } 00367 00368 return $desired_alias;
Definiert in Zeile 276 der Datei Message.php.
00276 { 00277 function Auth_OpenID_NamespaceMap() 00278 { 00279 $this->alias_to_namespace = new Auth_OpenID_Mapping(); 00280 $this->namespace_to_alias = new Auth_OpenID_Mapping(); 00281 $this->implicit_namespaces = array();
contains | ( | $ | namespace_uri | ) |
Definiert in Zeile 397 der Datei Message.php.
00399 { 00400 return $this->isDefined($namespace_uri);
getAlias | ( | $ | namespace_uri | ) |
getNamespaceURI | ( | $ | alias | ) |
isDefined | ( | $ | namespace_uri | ) |
isImplicit | ( | $ | namespace_uri | ) |
iterAliases | ( | ) |
Definiert in Zeile 299 der Datei Message.php.
00301 { 00302 // Return an iterator over the aliases""" 00303 return $this->alias_to_namespace->keys();
iteritems | ( | ) |
iterNamespaceURIs | ( | ) |
Definiert in Zeile 293 der Datei Message.php.
00295 { 00296 // Return an iterator over the namespace URIs 00297 return $this->namespace_to_alias->keys();
Copyright © 2003 - 2009 MyOOS [Shopsystem]. All rights reserved. MyOOS [Shopsystem] is Free Software released under the GNU/GPL License. Webmaster: info@r23.de (Impressum) |
|