ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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)
 
 asURI ()
 

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.

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
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
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 }
$ref_id
Definition: ltiauth.php:66
$url
Definition: shib_logout.php:68

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

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

84 : bool
85 {
86 return $this->access->checkAccessOfUser(ANONYMOUS_USER_ID, 'read', '', $ref_id);
87 }
const ANONYMOUS_USER_ID
Definition: constants.php:27

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

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

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

79 : bool
80 {
82 }
static _isInTrash(int $ref_id)
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data

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

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

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

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 }

References $url.

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

+ 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'

◆ INTERNAL_RESSOURCE

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

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