ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
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 22 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 67 of file StartUpSequenceDispatcher.php.

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

67  : 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  }
static get(string $a_var)
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
static set(string $a_var, $a_val)
Set a value.
static supportsRedirects()
Are redirects supported?
+ Here is the call graph for this function:

◆ initSequence()

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

Definition at line 34 of file StartUpSequenceDispatcher.php.

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

34  : 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  }
+ Here is the caller graph for this function:

◆ storeRequest()

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

Definition at line 54 of file StartUpSequenceDispatcher.php.

References $_SERVER, $url, ilSession\get(), and ilSession\set().

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

54  : 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  }
static get(string $a_var)
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
$url
static set(string $a_var, $a_val)
Set a value.
+ 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 26 of file StartUpSequenceDispatcher.php.


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