Commit 33a19e3e authored by Thomas Löffler's avatar Thomas Löffler

Makes some improvements

parent 8564928f
Pipeline #807 passed with stages
in 4 minutes and 41 seconds
......@@ -71,8 +71,8 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab
public function indexAction($uploaded = FALSE)
{
// get extensions by user if a user is logged in
$this->frontendUser = $this->userRepository->findByUid(1);
if (!empty($this->frontendUser)) {
if ($GLOBALS['TSFE']->fe_user->user['uid']) {
$this->frontendUser = $this->userRepository->findByUid($GLOBALS['TSFE']->fe_user->user['uid']);
$extensions = $this->extensionRepository->findByFrontendUser($this->frontendUser->getUsername());
$expiringExtensions = $this->extensionRepository->findByFrontendUserAndExpiring($this->frontendUser->getUsername());
$this->view->assign('extensions', $extensions);
......@@ -273,7 +273,7 @@ class Tx_TerFe2_Controller_RegisterkeyController extends Tx_TerFe2_Controller_Ab
if ($this->securityRole->isReviewer() || $extension->getFrontendUser() === $this->frontendUser->getUsername()) {
$this->view->assign('extension', $extension);
$this->view->assign('loggedIn', $this->frontendUser);
$this->view->assign('loggedIn', (bool)$this->frontendUser);
} else {
$this->addFlashMessage($this->translate('registerkey.notyourextension'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
$this->redirect('index', 'Registerkey');
......
......@@ -91,7 +91,7 @@
</f:form>
<div class="mt-5 text-right">
<f:link.action controller="Registerkey" class="btn btn-primary" action="index">Back to extension management</f:link.action>
<f:link.action controller="Registerkey" action="index" class="btn btn-primary">Back to extension management</f:link.action>
</div>
</f:then>
<f:else>
......
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