ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Init\StartupSequence\StartUpSequenceDispatcher Class Reference
+ Collaboration diagram for ILIAS\Init\StartupSequence\StartUpSequenceDispatcher:

Public Member Functions

 __construct (Container $dic)
 
 dispatch ()
 

Protected Member Functions

 initSequence ()
 
 storeRequest ()
 

Private Attributes

Container $dic
 
 $sequence = []
 

Detailed Description

Definition at line 39 of file StartUpSequenceDispatcher.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Init\StartupSequence\StartUpSequenceDispatcher::__construct ( Container  $dic)

Member Function Documentation

◆ dispatch()

ILIAS\Init\StartupSequence\StartUpSequenceDispatcher::dispatch ( )
Returns
bool

Definition at line 96 of file StartUpSequenceDispatcher.php.

96 : bool
97 {
98 $this->dic->logger()->init()->debug('Started request interception checks ...');
99
100 if (defined('IL_CERT_SSO')) {
101 $this->dic->logger()->init()->debug('ApacheAuthentication request. No interception.');
102 return false;
103 } elseif (!ilContext::supportsRedirects()) {
104 $this->dic->logger()->init()->debug('Context does not support redirects. No interception.');
105 return false;
106 } elseif ($this->dic->ctrl()->isAsynch()) {
107 $this->dic->logger()->init()->debug('Async request. No interception.');
108 return false;
109 } elseif (in_array(basename($_SERVER['PHP_SELF']), array('logout.php'))) {
110 $this->dic->logger()->init()->debug('Logout request. No interception.');
111 return false;
112 } elseif (!$this->dic->user()->getId() || $this->dic->user()->isAnonymous()) {
113 $this->dic->logger()->init()->debug('Anonymous request. No interception.');
114 return false;
115 } elseif (ilSession::get(__CLASS__ . '_passed')) {
116 $this->dic->logger()->init()->debug(__CLASS__ . ' already passed in the current user session.');
117 return false;
118 }
119
120 $this->sequence->rewind();
121 while (!$this->sequence->isEmpty()) {
122 $step = $this->sequence->shift();
123
124 if ($step->isInFulfillment()) {
125 $this->dic->globalScreen()->tool()->context()->current()->addAdditionalData(
127 true
128 );
129
130 $this->dic->logger()->init()->debug('Step is in fulfillment:' . get_class($step));
131 return false;
132 }
133
134 if ($step->shouldInterceptRequest()) {
135 $this->dic->logger()->init()->debug('Step required adjustment:' . get_class($step));
136 if ($step->shouldStoreRequestTarget()) {
137 $this->storeRequest();
138 }
139 $step->execute();
140 return true;
141 }
142 }
143
144 ilSession::set(__CLASS__ . '_passed', 1);
145 return false;
146 }
static supportsRedirects()
Are redirects supported?
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
$_SERVER['HTTP_HOST']
Definition: raiseError.php:26

References $_SERVER, ILIAS\Init\StartupSequence\StartUpSequenceLayoutProvider\FORCED_STARTUP_STEP, ilSession\get(), ilSession\set(), ILIAS\Init\StartupSequence\StartUpSequenceDispatcher\storeRequest(), and ilContext\supportsRedirects().

+ Here is the call graph for this function:

◆ initSequence()

ILIAS\Init\StartupSequence\StartUpSequenceDispatcher::initSequence ( )
protected

Definition at line 51 of file StartUpSequenceDispatcher.php.

51 : void
52 {
53 $this->sequence = new SplQueue();
54 $this->sequence->push(new StartUpStep(
55 $this->dic->ctrl(),
56 $this->dic['legalDocuments']
57 ));
58 $this->sequence->push(new ProfilePromptStartUpStep(
59 $this->dic->user(),
60 $this->dic->ctrl(),
61 $this->dic->database(),
62 $this->dic->language(),
63 $this->dic->http(),
64 $this->dic->refinery()
65 ));
66 $this->sequence->push(new ilForcedUserPasswordChangeStartUpStep(
67 $this->dic->user(),
68 $this->dic->ctrl(),
69 $this->dic->http()->request()
70 ));
71 }

Referenced by ILIAS\Init\StartupSequence\StartUpSequenceDispatcher\__construct().

+ Here is the caller graph for this function:

◆ storeRequest()

ILIAS\Init\StartupSequence\StartUpSequenceDispatcher::storeRequest ( )
protected

Definition at line 73 of file StartUpSequenceDispatcher.php.

73 : void
74 {
75 if (!ilSession::get('orig_request_target')) {
76 //#16324 don't use the complete REQUEST_URI
77
78 $url = $_SERVER['REQUEST_URI'];
79 $short = strpos($url, StandardURIBuilder::SHORT);
80
81 if (preg_match('@/([^/]+\\.php[?/].*)$@', $url, $matches)) {
82 $url = $matches[1];
83 } elseif ($short !== false) {
84 $url = substr($url, $short + 1);
85 } else {
86 $url = substr($url, strrpos($url, '/') + 1);
87 }
88
89 ilSession::set('orig_request_target', $url);
90 }
91 }
$url
Definition: shib_logout.php:68

References $_SERVER, $url, ilSession\get(), ilSession\set(), and ILIAS\StaticURL\Builder\StandardURIBuilder\SHORT.

Referenced by ILIAS\Init\StartupSequence\StartUpSequenceDispatcher\dispatch().

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

Field Documentation

◆ $dic

Container ILIAS\Init\StartupSequence\StartUpSequenceDispatcher::$dic
private

◆ $sequence

ILIAS\Init\StartupSequence\StartUpSequenceDispatcher::$sequence = []
private

Definition at line 43 of file StartUpSequenceDispatcher.php.


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