ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ILIAS\components\Authentication\Logout\ConfigurableLogoutTarget Class Reference
+ Inheritance diagram for ILIAS\components\Authentication\Logout\ConfigurableLogoutTarget:
+ Collaboration diagram for ILIAS\components\Authentication\Logout\ConfigurableLogoutTarget:

Public Member Functions

 __construct (private readonly ilCtrlInterface $ctrl, private readonly ilSetting $settings, private readonly ilAccessHandler $access, private readonly string $http_path=ILIAS_HTTP_PATH,)
 
 asURI ()
 
 isValidInternalResource (int $ref_id)
 
 isInRepository (int $ref_id)
 
 isAnonymousAccessible (int $ref_id)
 
 isValidExternalResource (string $url)
 

Data Fields

const string INTERNAL_RESSOURCE = 'internal_ressource'
 
const string EXTERNAL_RESSOURCE = 'external_ressource'
 

Detailed Description

Definition at line 32 of file ConfigurableLogoutTarget.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\components\Authentication\Logout\ConfigurableLogoutTarget::__construct ( private readonly ilCtrlInterface  $ctrl,
private readonly ilSetting  $settings,
private readonly ilAccessHandler  $access,
private readonly string  $http_path = ILIAS_HTTP_PATH 
)

Definition at line 37 of file ConfigurableLogoutTarget.php.

42  {
43  }

Member Function Documentation

◆ asURI()

ILIAS\components\Authentication\Logout\ConfigurableLogoutTarget::asURI ( )

Implements ILIAS\components\Authentication\Logout\LogoutTarget.

Definition at line 45 of file ConfigurableLogoutTarget.php.

References $ref_id, $url, ilLink\_getStaticLink(), ILIAS\Repository\ctrl(), ILIAS\Repository\int(), ILIAS\components\Authentication\Logout\ConfigurableLogoutTarget\isValidExternalResource(), ILIAS\components\Authentication\Logout\ConfigurableLogoutTarget\isValidInternalResource(), and ILIAS\Repository\settings().

45  : URI
46  {
47  switch ($this->settings->get('logout_behaviour', '')) {
48  case LogoutDestinations::LOGIN_SCREEN->value:
49  return LogoutDestinations::LOGIN_SCREEN->asURI($this->ctrl, $this->http_path);
50 
51  case self::INTERNAL_RESSOURCE:
52  $ref_id = (int) $this->settings->get('logout_behaviour_ref_id', '0');
53  if ($this->isValidInternalResource($ref_id)) {
54  return new URI(ilLink::_getStaticLink($ref_id));
55  }
56 
57  break;
58 
59  case self::EXTERNAL_RESSOURCE:
60  $url = $this->settings->get('logout_behaviour_url', '');
61  if ($url && $this->isValidExternalResource($url)) {
62  return new URI($url);
63  }
64  break;
65 
66  case LogoutDestinations::LOGOUT_SCREEN->value:
67  default:
68  break;
69  }
70 
71  return LogoutDestinations::LOGOUT_SCREEN->asURI($this->ctrl, $this->http_path);
72  }
$url
Definition: shib_logout.php:68
$ref_id
Definition: ltiauth.php:65
+ Here is the call graph for this function:

◆ isAnonymousAccessible()

ILIAS\components\Authentication\Logout\ConfigurableLogoutTarget::isAnonymousAccessible ( int  $ref_id)

Definition at line 84 of file ConfigurableLogoutTarget.php.

References ILIAS\Repository\access(), and ANONYMOUS_USER_ID.

Referenced by ILIAS\components\Authentication\Logout\ConfigurableLogoutTarget\isValidInternalResource().

84  : bool
85  {
86  return $this->access->checkAccessOfUser(ANONYMOUS_USER_ID, 'read', '', $ref_id);
87  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
$ref_id
Definition: ltiauth.php:65
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isInRepository()

ILIAS\components\Authentication\Logout\ConfigurableLogoutTarget::isInRepository ( int  $ref_id)

Definition at line 79 of file ConfigurableLogoutTarget.php.

References ilObject\_exists(), and ilObject\_isInTrash().

Referenced by ILIAS\components\Authentication\Logout\ConfigurableLogoutTarget\isValidInternalResource().

79  : bool
80  {
82  }
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
$ref_id
Definition: ltiauth.php:65
static _isInTrash(int $ref_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValidExternalResource()

ILIAS\components\Authentication\Logout\ConfigurableLogoutTarget::isValidExternalResource ( string  $url)

Definition at line 89 of file ConfigurableLogoutTarget.php.

Referenced by ILIAS\components\Authentication\Logout\ConfigurableLogoutTarget\asURI().

89  : bool
90  {
91  try {
92  $uri = new URI($url);
93  } catch (InvalidArgumentException) {
94  return false;
95  }
96 
97  return filter_var($url, FILTER_VALIDATE_URL) !== false;
98  }
$url
Definition: shib_logout.php:68
+ Here is the caller graph for this function:

◆ isValidInternalResource()

ILIAS\components\Authentication\Logout\ConfigurableLogoutTarget::isValidInternalResource ( int  $ref_id)

Field Documentation

◆ EXTERNAL_RESSOURCE

const string ILIAS\components\Authentication\Logout\ConfigurableLogoutTarget::EXTERNAL_RESSOURCE = 'external_ressource'

Definition at line 35 of file ConfigurableLogoutTarget.php.

◆ INTERNAL_RESSOURCE

const string ILIAS\components\Authentication\Logout\ConfigurableLogoutTarget::INTERNAL_RESSOURCE = 'internal_ressource'

Definition at line 34 of file ConfigurableLogoutTarget.php.


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