ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilUserRequestTargetAdjustment.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
8 {
12  protected $ctrl;
13 
17  protected $user;
18 
22  protected $cases = array();
23 
29  {
30  $this->user = $user;
31  $this->ctrl = $ctrl;
32 
33  $this->initCases();
34  }
35 
39  protected function initCases()
40  {
41  require_once 'Services/TermsOfService/classes/class.ilTermsOfServiceRequestTargetAdjustmentCase.php';
42  require_once 'Services/User/classes/class.ilUserProfileIncompleteRequestTargetAdjustmentCase.php';
43  require_once 'Services/User/classes/class.ilUserPasswordResetRequestTargetAdjustmentCase.php';
44 
45  $this->cases = array(
46  new ilTermsOfServiceRequestTargetAdjustmentCase($this->user, $this->ctrl),
47  new ilUserProfileIncompleteRequestTargetAdjustmentCase($this->user, $this->ctrl),
48  new ilUserPasswordResetRequestTargetAdjustmentCase($this->user, $this->ctrl)
49  );
50  }
51 
55  protected function storeRequest()
56  {
57  if(!ilSession::get('orig_request_target'))
58  {
59  //#16324 don't use the complete REQUEST_URI
60  $url = substr($_SERVER['REQUEST_URI'], (strrpos($_SERVER['REQUEST_URI'], '/') +1 ));
61 
62  ilSession::set('orig_request_target', $url);
63  }
64  }
65 
69  public function adjust()
70  {
71  if(defined('IL_CERT_SSO'))
72  {
73  return false;
74  }
76  {
77  return false;
78  }
79  else if($this->ctrl->isAsynch())
80  {
81  return false;
82  }
83  else if(in_array(basename($_SERVER['PHP_SELF']), array('logout.php')))
84  {
85  return false;
86  }
87  else if(!$this->user->getId() || $this->user->isAnonymous())
88  {
89  return false;
90  }
91 
92  foreach($this->cases as $case)
93  {
94  if($case->isInFulfillment())
95  {
96  return false;
97  }
98 
99  if($case->shouldAdjustRequest())
100  {
101  if($case->shouldStoreRequestTarget())
102  {
103  $this->storeRequest();
104  }
105  $case->adjust();
106  return true;
107  }
108  }
109 
110  return false;
111  }
112 }
This class provides processing control methods.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
$url
Definition: shib_logout.php:72
Class ilUserAccountMaintenanceEnforcement.
Class ilUserProfileIncompleteAndPasswordResetRequestTargetAdjustmentCase.
static supportsRedirects()
Are redirects supported?