TYPO3 CMS  TYPO3_6-2
InstallToolFormProtection.php
Go to the documentation of this file.
1 <?php
3 
62 
68  protected $installTool = NULL;
69 
73  public function __destruct() {
74  $this->installTool = NULL;
75  parent::__destruct();
76  }
77 
87  public function injectInstallTool($installTool) {
89  $this->installTool = $installTool;
90  }
91 
99  protected function createValidationErrorMessage() {
100  // @deprecated since 6.2, neither the install tool class nor the addErrorMessage() exist anymore
101  if (is_object($this->installTool)) {
102  $this->installTool->addErrorMessage(
103  'Validating the security token of this form has failed. '
104  . 'Please reload the form and submit it again.'
105  );
106  }
107  }
108 
114  protected function retrieveSessionToken() {
115  if (isset($_SESSION['installToolFormToken']) && !empty($_SESSION['installToolFormToken'])) {
116  $this->sessionToken = $_SESSION['installToolFormToken'];
117  } else {
118  $this->sessionToken = $this->generateSessionToken();
119  $this->persistSessionToken();
120  }
121  }
122 
129  public function persistSessionToken() {
130  $_SESSION['installToolFormToken'] = $this->sessionToken;
131  }
132 
133 }