ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilUserRequestTargetAdjustment Class Reference

Class ilUserAccountMaintenanceEnforcement. More...

+ Collaboration diagram for ilUserRequestTargetAdjustment:

Public Member Functions

 __construct (ilObjUser $user, ilCtrl $ctrl, ServerRequestInterface $request)
 
 adjust ()
 

Protected Member Functions

 initCases ()
 
 storeRequest ()
 

Protected Attributes

 $user
 
 $ctrl
 
 $request
 
 $cases = array()
 

Detailed Description

Class ilUserAccountMaintenanceEnforcement.

Definition at line 10 of file class.ilUserRequestTargetAdjustment.php.

Constructor & Destructor Documentation

◆ __construct()

ilUserRequestTargetAdjustment::__construct ( ilObjUser  $user,
ilCtrl  $ctrl,
ServerRequestInterface  $request 
)
Parameters
ilObjUser$user
ilCtrl$ctrl
ServerRequestInterface$request

Definition at line 29 of file class.ilUserRequestTargetAdjustment.php.

References $ctrl, $request, $user, initCases(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ adjust()

ilUserRequestTargetAdjustment::adjust ( )
Returns
boolean

Definition at line 66 of file class.ilUserRequestTargetAdjustment.php.

References $_SERVER, $GLOBALS, ilSession\get(), ilSession\set(), storeRequest(), ilContext\supportsRedirects(), and user().

66  : bool
67  {
68  if (defined('IL_CERT_SSO')) {
69  $GLOBALS['DIC']->logger()->init()->debug('CERT SSO request. No adjustment.');
70  return false;
71  } elseif (!ilContext::supportsRedirects()) {
72  $GLOBALS['DIC']->logger()->init()->debug('Context does not support redirects. No adjustment.');
73  return false;
74  } elseif ($this->ctrl->isAsynch()) {
75  $GLOBALS['DIC']->logger()->init()->debug('Async request. No adjustment.');
76  return false;
77  } elseif (in_array(basename($_SERVER['PHP_SELF']), array('logout.php'))) {
78  $GLOBALS['DIC']->logger()->init()->debug('Logout request. No adjustment.');
79  return false;
80  } elseif (!$this->user->getId() || $this->user->isAnonymous()) {
81  $GLOBALS['DIC']->logger()->init()->debug('Anonymous request. No adjustment.');
82  return false;
83  } elseif (ilSession::get(__CLASS__ . '_passed')) {
84  $GLOBALS['DIC']->logger()->init()->debug(__CLASS__ . ' already passed in the current user session.');
85  return false;
86  }
87 
88  foreach ($this->cases as $case) {
89  if ($case->isInFulfillment()) {
90  $GLOBALS['DIC']->logger()->init()->debug('Case is in fulfillment:' . get_class($case));
91  return false;
92  }
93 
94  if ($case->shouldAdjustRequest()) {
95  $GLOBALS['DIC']->logger()->init()->debug('Case required adjustment:' . get_class($case));
96  if ($case->shouldStoreRequestTarget()) {
97  $this->storeRequest();
98  }
99  $case->adjust();
100  return true;
101  }
102  }
103 
104  ilSession::set(__CLASS__ . '_passed', 1);
105  return false;
106  }
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
user()
Definition: user.php:4
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static supportsRedirects()
Are redirects supported?
+ Here is the call graph for this function:

◆ initCases()

ilUserRequestTargetAdjustment::initCases ( )
protected

Definition at line 41 of file class.ilUserRequestTargetAdjustment.php.

References user().

Referenced by __construct().

41  : void
42  {
43  $this->cases = array(
44  new ilTermsOfServiceRequestTargetAdjustmentCase($this->user, $this->ctrl, $this->request),
45  new ilUserProfileIncompleteRequestTargetAdjustmentCase($this->user, $this->ctrl, $this->request),
46  new ilUserPasswordResetRequestTargetAdjustmentCase($this->user, $this->ctrl, $this->request)
47  );
48  }
user()
Definition: user.php:4
Class ilUserProfileIncompleteAndPasswordResetRequestTargetAdjustmentCase.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ storeRequest()

ilUserRequestTargetAdjustment::storeRequest ( )
protected

Definition at line 53 of file class.ilUserRequestTargetAdjustment.php.

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

Referenced by adjust().

53  : void
54  {
55  if (!ilSession::get('orig_request_target')) {
56  //#16324 don't use the complete REQUEST_URI
57  $url = substr($_SERVER['REQUEST_URI'], (strrpos($_SERVER['REQUEST_URI'], '/') + 1));
58 
59  ilSession::set('orig_request_target', $url);
60  }
61  }
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
$url
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $cases

ilUserRequestTargetAdjustment::$cases = array()
protected

Definition at line 22 of file class.ilUserRequestTargetAdjustment.php.

◆ $ctrl

ilUserRequestTargetAdjustment::$ctrl
protected

Definition at line 16 of file class.ilUserRequestTargetAdjustment.php.

Referenced by __construct().

◆ $request

ilUserRequestTargetAdjustment::$request
protected

Definition at line 19 of file class.ilUserRequestTargetAdjustment.php.

Referenced by __construct().

◆ $user

ilUserRequestTargetAdjustment::$user
protected

Definition at line 13 of file class.ilUserRequestTargetAdjustment.php.

Referenced by __construct().


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