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

Changes handling if last version is insecure

After deploy: Please reindex in solr!
parent 13ef3c94
Pipeline #2152 passed with stages
in 1 minute and 25 seconds
......@@ -200,13 +200,7 @@ class ExtensionController extends \T3o\TerFe2\Controller\AbstractController
$versionHistoryCount = (!empty($this->settings['versionHistoryCount']) ? $this->settings['versionHistoryCount'] : 5);
$skipLatestVersion = (isset($this->settings['skipLatestVersion']) ? $this->settings['skipLatestVersion'] : TRUE);
if ($extension !== NULL &&
$extension instanceof \T3o\TerFe2\Domain\Model\Extension &&
(
$this->securityRole->isReviewer() ||
($extension->getLastVersion() && $extension->getLastVersion()->getReviewState() != -1)
)
) {
if ($extension !== NULL && $extension instanceof \T3o\TerFe2\Domain\Model\Extension) {
$versionHistory = $this->versionRepository->getVersionHistory($extension, $versionHistoryCount, $skipLatestVersion);
$this->view->assign('owner', $owner);
$this->view->assign('extension', $extension);
......
......@@ -101,6 +101,8 @@ class TerIndexer extends \ApacheSolrForTypo3\Solr\IndexQueue\Indexer {
$dependencyString .= $typo3Dependency['maximum'] > 0 ? ' - ' . VersionNumberUtility::convertIntegerToVersionNumber($typo3Dependency['maximum']) : '';
$document->setField('extensionDependency_stringS', $dependencyString ?: 'N/A');
// is last version insecure
$document->setField('insecure_boolS', $extension->getLastVersion()->getReviewState() === -1);
$document->setField('outdated_boolS', $extension->getLastVersion()->getReviewState() === -2);
// does this extension supports different versions?
......@@ -125,7 +127,6 @@ class TerIndexer extends \ApacheSolrForTypo3\Solr\IndexQueue\Indexer {
}
$document->setField('typo3support_stringM', $typo3Support);
// add documentation link
/** @var \T3o\TerFe2\Service\Documentation $documentationService */
$documentationService = GeneralUtility::makeInstance(\T3o\TerFe2\Service\Documentation::class);
......
......@@ -14,7 +14,7 @@
</thead>
<tbody>
<f:for each="{versionHistory}" as="version">
<tr{f:if(condition:'{version} == {version.extension.lastVersion}',then:' class="table-success"')}{f:if(condition:'{version.reviewState} == -1',then:' class="table-danger"')}>
<tr{f:if(condition:'{version} == {version.extension.lastVersion} && {version.reviewState} != -1',then:' class="table-success"')}{f:if(condition:'{version.reviewState} == -1',then:' class="table-danger"')}>
<td class="align-middle text-center">
<f:form.checkbox name="insecureVersions[]" value="{version.uid}" checked="{version.reviewState} == -1" />
</td>
......@@ -81,7 +81,7 @@
</thead>
<tbody>
<f:for each="{versionHistory}" as="version">
<tr{f:if(condition:'{version} == {version.extension.lastVersion}',then:' class="table-success"')}{f:if(condition:'{version.reviewState} == -1',then:' class="table-danger"')}>
<tr{f:if(condition:'{version} == {version.extension.lastVersion} && {version.reviewState} != -1',then:' class="table-success"')}{f:if(condition:'{version.reviewState} == -1',then:' class="table-danger"')}>
<td class="align-middle">
<strong>{version.versionString}</strong> /
<span class="ter-ext-state-{version.state}">{version.state}</span>
......
......@@ -47,11 +47,15 @@
</ul>
</div>
</div>
<div class="">
<a class="btn btn-primary btn-block btn-lg" href="{document.extensionDownloadZipUrl_stringS}">
<i class="fa fa-download"></i>
<strong>Download version {document.extensionVersion_stringS} as ZIP</strong>
</a>
</div>
<f:if condition="{document.insecure_boolS}">
<f:else>
<div class="">
<a class="btn btn-primary btn-block btn-lg" href="{document.extensionDownloadZipUrl_stringS}">
<i class="fa fa-download"></i>
<strong>Download version {document.extensionVersion_stringS} as ZIP</strong>
</a>
</div>
</f:else>
</f:if>
</li>
</f:section>
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