ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
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. More...
 
 getNextService ($discover_cb, $fetcher)
 Return the next authentication service for the pair of user_input and session. More...
 
 cleanup ($force=false)
 Clean up Yadis-related services in the session and return the most-recently-attempted service from the manager, if one exists. More...
 
 getSessionKey ()
 private More...
 
 getManager ($force=false)
 private More...
 
 createManager ($services, $yadis_url=null)
 private More...
 
 destroyManager ($force=false)
 private More...
 

Data Fields

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

Detailed Description

Definition at line 369 of file Manager.php.

Member Function Documentation

◆ Auth_Yadis_Discovery()

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 $url.

392  {
394  $this->session = $session;
395  $this->url = $url;
396  if ($session_key_suffix === null) {
397  $session_key_suffix = $this->DEFAULT_SUFFIX;
398  }
399 
400  $this->session_key_suffix = $session_key_suffix;
401  $this->session_key = $this->PREFIX . $this->session_key_suffix;
402  }
$url
Definition: shib_logout.php:72
$DEFAULT_SUFFIX
private
Definition: Manager.php:374

◆ cleanup()

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.

442  {
443  $manager = $this->getManager($force);
444  if ($manager) {
445  $service = $manager->current();
446  $this->destroyManager($force);
447  } else {
448  $service = null;
449  }
450 
451  return $service;
452  }
destroyManager($force=false)
private
Definition: Manager.php:513
getManager($force=false)
private
Definition: Manager.php:469

◆ createManager()

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

private

Definition at line 490 of file Manager.php.

References $loader.

491  {
492  $key = $this->getSessionKey();
493  if ($this->getManager()) {
494  return $this->getManager();
495  }
496 
497  if ($services) {
499  $manager = new Auth_Yadis_Manager($this->url, $yadis_url,
500  $services, $key);
501  $this->session->set($this->session_key,
502  serialize($loader->toSession($manager)));
503  return $manager;
504  }
505  }
$loader
getSessionKey()
private
Definition: Manager.php:457
getManager($force=false)
private
Definition: Manager.php:469

◆ destroyManager()

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.

514  {
515  if ($this->getManager($force) !== null) {
516  $key = $this->getSessionKey();
517  $this->session->del($key);
518  }
519  }
getSessionKey()
private
Definition: Manager.php:457
getManager($force=false)
private
Definition: Manager.php:469

◆ getManager()

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.

470  {
471  // Extract the YadisServiceManager for this object's URL and
472  // suffix from the session.
473 
474  $manager_str = $this->session->get($this->getSessionKey());
475  $manager = null;
476 
477  if ($manager_str !== null) {
479  $manager = $loader->fromSession(unserialize($manager_str));
480  }
481 
482  if ($manager && ($manager->forURL($this->url) || $force)) {
483  return $manager;
484  }
485  }
$loader
getSessionKey()
private
Definition: Manager.php:457

◆ getNextService()

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.

409  {
410  $manager = $this->getManager();
411  if (!$manager || (!$manager->services)) {
412  $this->destroyManager();
413 
414  list($yadis_url, $services) = call_user_func($discover_cb,
415  $this->url,
416  $fetcher);
417 
418  $manager = $this->createManager($services, $yadis_url);
419  }
420 
421  if ($manager) {
423  $service = $manager->nextService();
424  $this->session->set($this->session_key,
425  serialize($loader->toSession($manager)));
426  } else {
427  $service = null;
428  }
429 
430  return $service;
431  }
destroyManager($force=false)
private
Definition: Manager.php:513
$loader
createManager($services, $yadis_url=null)
private
Definition: Manager.php:490
getManager($force=false)
private
Definition: Manager.php:469

◆ getSessionKey()

Auth_Yadis_Discovery::getSessionKey ( )

private

Definition at line 457 of file Manager.php.

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

Field Documentation

◆ $DEFAULT_SUFFIX

Auth_Yadis_Discovery::$DEFAULT_SUFFIX = 'auth'

private

Definition at line 374 of file Manager.php.

◆ $PREFIX

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: