Commit f24369c4 authored by Thomas Löffler's avatar Thomas Löffler

Get frontend user in actions with the need for

parent fda516d0
Pipeline #2588 passed with stages
in 3 minutes and 2 seconds
......@@ -148,8 +148,6 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController
// Show insecure extensions only for reviewers
$this->extensionRepository->setShowInsecure($this->securityRole->isReviewer());
$this->versionRepository->setShowInsecure($this->securityRole->isReviewer());
$this->frontendUser = (!empty($GLOBALS['TSFE']->fe_user->user) ? $GLOBALS['TSFE']->fe_user->user : array());
}
/**
......@@ -494,6 +492,7 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController
*/
public function createVersionAction(\T3o\TerFe2\Domain\Model\Extension $extension, array $form)
{
$this->frontendUser = (!empty($GLOBALS['TSFE']->fe_user->user) ? $GLOBALS['TSFE']->fe_user->user : []);
if (!$form['gplCompliant']) {
$this->forwardWithError($this->translate('msg.acceptGPL'), 'uploadVersion');
}
......@@ -558,6 +557,7 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController
*/
protected function userIsAllowedToUploadExtension($extensionKey)
{
$this->frontendUser = (!empty($GLOBALS['TSFE']->fe_user->user) ? $GLOBALS['TSFE']->fe_user->user : []);
if (empty($this->frontendUser['username'])) {
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment