ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 ()
 @access private More...
 
 getManager ($force=false)
 @access private More...
 
 createManager ($services, $yadis_url=null)
 @access private More...
 
 destroyManager ($force=false)
 @access private More...
 

Data Fields

 $DEFAULT_SUFFIX = 'auth'
 @access private More...
 
 $PREFIX = '_yadis_services_'
 @access 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.

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 }
$DEFAULT_SUFFIX
@access private
Definition: Manager.php:374
$url
Definition: shib_logout.php:72

References $DEFAULT_SUFFIX, and $url.

◆ 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)
@access private
Definition: Manager.php:513
getManager($force=false)
@access private
Definition: Manager.php:469

References destroyManager(), and getManager().

+ Here is the call graph for this function:

◆ createManager()

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

@access private

Definition at line 490 of file Manager.php.

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 }
getSessionKey()
@access private
Definition: Manager.php:457
$loader

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

Referenced by getNextService().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ destroyManager()

Auth_Yadis_Discovery::destroyManager (   $force = false)

@access 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 }

References getManager(), and getSessionKey().

Referenced by cleanup(), and getNextService().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getManager()

Auth_Yadis_Discovery::getManager (   $force = false)

@access 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.

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 }

References $loader, and getSessionKey().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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.

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 }
createManager($services, $yadis_url=null)
@access private
Definition: Manager.php:490

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

+ Here is the call graph for this function:

◆ getSessionKey()

Auth_Yadis_Discovery::getSessionKey ( )

@access 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 }

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

+ Here is the caller graph for this function:

Field Documentation

◆ $DEFAULT_SUFFIX

Auth_Yadis_Discovery::$DEFAULT_SUFFIX = 'auth'

@access private

Definition at line 374 of file Manager.php.

Referenced by Auth_Yadis_Discovery().

◆ $PREFIX

Auth_Yadis_Discovery::$PREFIX = '_yadis_services_'

@access private

Definition at line 379 of file Manager.php.


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