Skip to content

Commit

Permalink
[TASK] Remove superfluous admin check
Browse files Browse the repository at this point in the history
As the scheduler module is only accessible for admins, there is no need
to check this in the controller.

Resolves: #84454
Releases: master
Change-Id: I234872820faa7c729a52c030383f6b24e6c1eca5
Reviewed-on: https://review.typo3.org/56335
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
georgringer authored and lolli42 committed Mar 18, 2018
1 parent 0c1af16 commit ee2cee9
Showing 1 changed file with 9 additions and 15 deletions.
Expand Up @@ -160,21 +160,15 @@ public function mainAction(ServerRequestInterface $request): ResponseInterface
]
];
$this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), 'system_txschedulerM1', '', '', '');
// Access check!
// The page will show only if user has admin rights
if ($this->getBackendUser()->isAdmin()) {
// Set the form
$content = '<form name="tx_scheduler_form" id="tx_scheduler_form" method="post" action="">';

// Prepare main content
$content .= '<h1>' . $this->getLanguageService()->getLL('function.' . $this->MOD_SETTINGS['function']) . '</h1>';
$content .= $this->getModuleContent();
$content .= '<div id="extraFieldsSection"></div></form><div id="extraFieldsHidden"></div>';
} else {
// If no access, only display the module's title
$content = '<h1>' . $this->getLanguageService()->getLL('title.') . '</h1>';
$content .= '<div style="padding-top: 5px;"></div>';
}

// Set the form
$content = '<form name="tx_scheduler_form" id="tx_scheduler_form" method="post" action="">';

// Prepare main content
$content .= '<h1>' . $this->getLanguageService()->getLL('function.' . $this->MOD_SETTINGS['function']) . '</h1>';
$content .= $this->getModuleContent();
$content .= '<div id="extraFieldsSection"></div></form><div id="extraFieldsHidden"></div>';

$this->getButtons();
$this->getModuleMenu();

Expand Down

0 comments on commit ee2cee9

Please sign in to comment.