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

Public Member Functions

 Auth_Yadis_Discovery ($session, $url, $session_key_suffix=null)
 Initialize a discovery object.
 getNextService ($discover_cb, $fetcher)
 Return the next authentication service for the pair of user_input and session.
 cleanup ($force=false)
 Clean up Yadis-related services in the session and return the most-recently-attempted service from the manager, if one exists.
 getSessionKey ()
 private
 getManager ($force=false)
 private
 createManager ($services, $yadis_url=null)
 private
 destroyManager ($force=false)
 private

Data Fields

 $DEFAULT_SUFFIX = 'auth'
 private
 $PREFIX = '_yadis_services_'
 private

Detailed Description

Definition at line 369 of file Manager.php.

Member Function Documentation

Auth_Yadis_Discovery::Auth_Yadis_Discovery (   $session,
  $url,
  $session_key_suffix = null 
)

Initialize a discovery object.

Parameters
Auth_Yadis_PHPSession$sessionAn object which implements the Auth_Yadis_PHPSession API.
string$urlThe URL on which to attempt discovery.
string$session_key_suffixThe optional session key suffix override.

Initialize a discovery object

Definition at line 390 of file Manager.php.

References $DEFAULT_SUFFIX.

{
$this->session = $session;
$this->url = $url;
if ($session_key_suffix === null) {
$session_key_suffix = $this->DEFAULT_SUFFIX;
}
$this->session_key_suffix = $session_key_suffix;
$this->session_key = $this->PREFIX . $this->session_key_suffix;
}
Auth_Yadis_Discovery::cleanup (   $force = false)

Clean up Yadis-related services in the session and return the most-recently-attempted service from the manager, if one exists.

Parameters
$forceTrue if the manager should be deleted regardless of whether it's a manager for $this->url.

Definition at line 441 of file Manager.php.

References destroyManager(), and getManager().

{
$manager = $this->getManager($force);
if ($manager) {
$service = $manager->current();
$this->destroyManager($force);
} else {
$service = null;
}
return $service;
}

+ Here is the call graph for this function:

Auth_Yadis_Discovery::createManager (   $services,
  $yadis_url = null 
)

private

Definition at line 490 of file Manager.php.

References $loader, getManager(), and getSessionKey().

Referenced by getNextService().

{
$key = $this->getSessionKey();
if ($this->getManager()) {
return $this->getManager();
}
if ($services) {
$manager = new Auth_Yadis_Manager($this->url, $yadis_url,
$services, $key);
$this->session->set($this->session_key,
serialize($loader->toSession($manager)));
return $manager;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Auth_Yadis_Discovery::destroyManager (   $force = false)

private

Parameters
$forceTrue if the manager should be deleted regardless of whether it's a manager for $this->url.

Definition at line 513 of file Manager.php.

References getManager(), and getSessionKey().

Referenced by cleanup(), and getNextService().

{
if ($this->getManager($force) !== null) {
$key = $this->getSessionKey();
$this->session->del($key);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Auth_Yadis_Discovery::getManager (   $force = false)

private

Parameters
$forceTrue if the manager should be returned regardless of whether it's a manager for $this->url.

Definition at line 469 of file Manager.php.

References $loader, and getSessionKey().

Referenced by cleanup(), createManager(), destroyManager(), and getNextService().

{
// Extract the YadisServiceManager for this object's URL and
// suffix from the session.
$manager_str = $this->session->get($this->getSessionKey());
$manager = null;
if ($manager_str !== null) {
$manager = $loader->fromSession(unserialize($manager_str));
}
if ($manager && ($manager->forURL($this->url) || $force)) {
return $manager;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Auth_Yadis_Discovery::getNextService (   $discover_cb,
  $fetcher 
)

Return the next authentication service for the pair of user_input and session.

This function handles fallback.

Definition at line 408 of file Manager.php.

References $loader, createManager(), destroyManager(), and getManager().

{
$manager = $this->getManager();
if (!$manager || (!$manager->services)) {
$this->destroyManager();
list($yadis_url, $services) = call_user_func($discover_cb,
$this->url,
&$fetcher);
$manager = $this->createManager($services, $yadis_url);
}
if ($manager) {
$service = $manager->nextService();
$this->session->set($this->session_key,
serialize($loader->toSession($manager)));
} else {
$service = null;
}
return $service;
}

+ Here is the call graph for this function:

Auth_Yadis_Discovery::getSessionKey ( )

private

Definition at line 457 of file Manager.php.

Referenced by createManager(), destroyManager(), and getManager().

{
// Get the session key for this starting URL and suffix
return $this->PREFIX . $this->session_key_suffix;
}

+ Here is the caller graph for this function:

Field Documentation

Auth_Yadis_Discovery::$DEFAULT_SUFFIX = 'auth'

private

Definition at line 374 of file Manager.php.

Referenced by Auth_Yadis_Discovery().

Auth_Yadis_Discovery::$PREFIX = '_yadis_services_'

private

Definition at line 379 of file Manager.php.


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