ILIAS
release_8 Revision v8.24
◀ ilDoc Overview
StartUpSequenceDispatcher.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
5
6
namespace
ILIAS\Init\StartupSequence
;
7
8
use
ilContext
;
9
use
ILIAS\DI\Container
;
10
use
ilSession
;
11
use
ilTermsOfServiceAcceptanceStartUpStep
;
12
use
ilForcedUserPasswordChangeStartUpStep
;
13
use
ilTermsOfServiceWithdrawalStartUpStep
;
14
use
ilUserProfileStartUpStep
;
15
use SplQueue;
16
22
class
StartUpSequenceDispatcher
23
{
24
private
Container
$dic
;
26
private
$sequence
= [];
27
28
public
function
__construct
(
Container
$dic
)
29
{
30
$this->dic =
$dic
;
31
$this->
initSequence
();
32
}
33
34
protected
function
initSequence
(): void
35
{
36
$this->sequence =
new
SplQueue();
37
$this->sequence->push(
new
ilTermsOfServiceWithdrawalStartUpStep
(
38
$this->dic
39
));
40
$this->sequence->push(
new
ilTermsOfServiceAcceptanceStartUpStep
(
41
$this->dic
42
));
43
$this->sequence->push(
new
ilUserProfileStartUpStep
(
44
$this->dic->user(),
45
$this->dic->ctrl()
46
));
47
$this->sequence->push(
new
ilForcedUserPasswordChangeStartUpStep
(
48
$this->dic->user(),
49
$this->dic->ctrl(),
50
$this->dic->http()->request()
51
));
52
}
53
54
protected
function
storeRequest
(): void
55
{
56
if
(!
ilSession::get
(
'orig_request_target'
)) {
57
//#16324 don't use the complete REQUEST_URI
58
$url
= substr(
$_SERVER
[
'REQUEST_URI'
], (strrpos(
$_SERVER
[
'REQUEST_URI'
],
'/'
) + 1));
59
60
ilSession::set
(
'orig_request_target'
,
$url
);
61
}
62
}
63
67
public
function
dispatch
(): bool
68
{
69
$this->dic->logger()->init()->debug(
'Started request interception checks ...'
);
70
71
if
(defined(
'IL_CERT_SSO'
)) {
72
$this->dic->logger()->init()->debug(
'ApacheAuthentication request. No interception.'
);
73
return
false
;
74
} elseif (!
ilContext::supportsRedirects
()) {
75
$this->dic->logger()->init()->debug(
'Context does not support redirects. No interception.'
);
76
return
false
;
77
} elseif ($this->dic->ctrl()->isAsynch()) {
78
$this->dic->logger()->init()->debug(
'Async request. No interception.'
);
79
return
false
;
80
} elseif (in_array(basename(
$_SERVER
[
'PHP_SELF'
]), array(
'logout.php'
))) {
81
$this->dic->logger()->init()->debug(
'Logout request. No interception.'
);
82
return
false
;
83
} elseif (!$this->dic->user()->getId() || $this->dic->user()->isAnonymous()) {
84
$this->dic->logger()->init()->debug(
'Anonymous request. No interception.'
);
85
return
false
;
86
} elseif (
ilSession::get
(__CLASS__ .
'_passed'
)) {
87
$this->dic->logger()->init()->debug(__CLASS__ .
' already passed in the current user session.'
);
88
return
false
;
89
}
90
91
$this->sequence->rewind();
92
while
(!$this->sequence->isEmpty()) {
93
$step = $this->sequence->shift();
94
95
if
($step->isInFulfillment()) {
96
$this->dic->logger()->init()->debug(
'Step is in fulfillment:'
. get_class($step));
97
return
false
;
98
}
99
100
if
($step->shouldInterceptRequest()) {
101
$this->dic->logger()->init()->debug(
'Step required adjustment:'
. get_class($step));
102
if
($step->shouldStoreRequestTarget()) {
103
$this->
storeRequest
();
104
}
105
$step->execute();
106
return
true
;
107
}
108
}
109
110
ilSession::set
(__CLASS__ .
'_passed'
, 1);
111
return
false
;
112
}
113
}
ILIAS\DI\Container
Customizing of pimple-DIC for ILIAS.
Definition:
Container.php:32
ILIAS\Init\StartupSequence\StartUpSequenceDispatcher
Definition:
StartUpSequenceDispatcher.php:23
ILIAS\Init\StartupSequence\StartUpSequenceDispatcher\__construct
__construct(Container $dic)
Definition:
StartUpSequenceDispatcher.php:28
ILIAS\Init\StartupSequence\StartUpSequenceDispatcher\storeRequest
storeRequest()
Definition:
StartUpSequenceDispatcher.php:54
ILIAS\Init\StartupSequence\StartUpSequenceDispatcher\initSequence
initSequence()
Definition:
StartUpSequenceDispatcher.php:34
ILIAS\Init\StartupSequence\StartUpSequenceDispatcher\$dic
Container $dic
Definition:
StartUpSequenceDispatcher.php:24
ILIAS\Init\StartupSequence\StartUpSequenceDispatcher\dispatch
dispatch()
Definition:
StartUpSequenceDispatcher.php:67
ILIAS\Init\StartupSequence\StartUpSequenceDispatcher\$sequence
$sequence
Definition:
StartUpSequenceDispatcher.php:26
ilContext
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.ilContext.php:26
ilContext\supportsRedirects
static supportsRedirects()
Are redirects supported?
Definition:
class.ilContext.php:89
ilForcedUserPasswordChangeStartUpStep
Class ilForcedUserPasswordChangeStartUpStep.
Definition:
class.ilForcedUserPasswordChangeStartUpStep.php:28
ilSession
Definition:
class.ilSession.php:27
ilSession\get
static get(string $a_var)
Definition:
class.ilSession.php:459
ilSession\set
static set(string $a_var, $a_val)
Set a value.
Definition:
class.ilSession.php:451
ilTermsOfServiceAcceptanceStartUpStep
Class ilTermsOfServiceAcceptanceStartUpStep.
Definition:
class.ilTermsOfServiceAcceptanceStartUpStep.php:29
ilTermsOfServiceWithdrawalStartUpStep
Class ilTermsOfServiceWithdrawalStartUpStep.
Definition:
class.ilTermsOfServiceWithdrawalStartUpStep.php:30
ilUserProfileStartUpStep
Definition:
class.ilUserProfileStartUpStep.php:24
ILIAS\Init\StartupSequence
Definition:
StartUpSequenceDispatcher.php:6
$url
$url
Definition:
proxy_ylocal.php:28
$_SERVER
$_SERVER['HTTP_HOST']
Definition:
raiseError.php:10
Services
Init
classes
StartupSequence
StartUpSequenceDispatcher.php
Generated on Sun Nov 2 2025 22:01:37 for ILIAS by
1.9.4 (using
Doxyfile
)