TYPO3 CMS  TYPO3_7-6
BackendModuleController.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
27 {
31  protected $enableFileService;
32 
36  protected $formProtection;
37 
41  public function injectEnableFileService(\TYPO3\CMS\Install\Service\EnableFileService $enableFileService)
42  {
43  $this->enableFileService = $enableFileService;
44  }
45 
49  public function initializeAction()
50  {
52  }
53 
59  public function indexAction()
60  {
61  if ($this->enableFileService->checkInstallToolEnableFile()) {
62  \TYPO3\CMS\Core\Utility\HttpUtility::redirect('sysext/install/Start/Install.php?install[context]=backend');
63  } else {
64  $this->forward('showEnableInstallToolButton');
65  }
66  }
67 
74  {
75  $token = $this->formProtection->generateToken('installTool');
76  $this->view->assign('installToolEnableToken', $token);
77  }
78 
85  public function enableInstallToolAction($installToolEnableToken)
86  {
87  if (!$this->formProtection->validateToken($installToolEnableToken, 'installTool')) {
88  throw new \RuntimeException('Given form token was not valid', 1369161225);
89  }
90  $this->enableFileService->createInstallToolEnableFile();
91  $this->forward('index');
92  }
93 
105  protected function redirect(
106  $uri,
107  $_1 = null,
108  $_2 = null,
109  array $_3 = null,
110  $_4 = null,
111  $_5 = 0,
112  $_6 = 303
113  ) {
115  }
116 }
injectEnableFileService(\TYPO3\CMS\Install\Service\EnableFileService $enableFileService)
redirect( $uri, $_1=null, $_2=null, array $_3=null, $_4=null, $_5=0, $_6=303)
static redirect($url, $httpStatus=self::HTTP_STATUS_303)
Definition: HttpUtility.php:76
forward($actionName, $controllerName=null, $extensionName=null, array $arguments=null)