From: Tim Düsterhus Date: Tue, 9 Mar 2021 13:23:22 +0000 (+0100) Subject: Show error messages if tainted apps are installed X-Git-Tag: 5.4.0_Alpha_1~178^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fe896adebb94462db301b22b47421c8e72223cc9;p=GitHub%2FWoltLab%2FWCF.git Show error messages if tainted apps are installed --- diff --git a/wcfsetup/install/files/acp/templates/index.tpl b/wcfsetup/install/files/acp/templates/index.tpl index f5ece6681a..ac9f844334 100644 --- a/wcfsetup/install/files/acp/templates/index.tpl +++ b/wcfsetup/install/files/acp/templates/index.tpl @@ -11,6 +11,10 @@
{lang evaluationEndDate=$evaluationEndDate}wcf.acp.package.evaluation.pending{/lang}
{/foreach} +{foreach from=$taintedApplications item=$taintedApplication} +
{lang}wcf.acp.package.application.isTainted{/lang}
+{/foreach} + {if TMP_DIR !== WCF_DIR|concat:'tmp/'}

{lang}wcf.acp.index.tmpBroken{/lang}

{/if} diff --git a/wcfsetup/install/files/acp/templates/packageList.tpl b/wcfsetup/install/files/acp/templates/packageList.tpl index 29a593c175..74ba539191 100644 --- a/wcfsetup/install/files/acp/templates/packageList.tpl +++ b/wcfsetup/install/files/acp/templates/packageList.tpl @@ -58,6 +58,10 @@ {/hascontent} +{foreach from=$taintedApplications item=$taintedApplication} +
{lang}wcf.acp.package.application.isTainted{/lang}
+{/foreach} + {if $recentlyDisabledCustomValues > 0}

{lang}wcf.acp.language.item.hasRecentlyDisabledCustomValues{/lang}

{/if} @@ -98,6 +102,12 @@ {@$package->packageID} {$package} + {if $taintedApplications[$package->packageID]|isset} + + {/if} {if $package->authorURL}{$package->author}{else}{$package->author}{/if} {$package->packageVersion} diff --git a/wcfsetup/install/files/lib/acp/page/IndexPage.class.php b/wcfsetup/install/files/lib/acp/page/IndexPage.class.php index 8e2c8d3b5c..5cce1caa9f 100755 --- a/wcfsetup/install/files/lib/acp/page/IndexPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/IndexPage.class.php @@ -170,6 +170,15 @@ class IndexPage extends AbstractPage } } + $taintedApplications = []; + foreach (ApplicationHandler::getInstance()->getApplications() as $application) { + if (!$application->isTainted) { + continue; + } + + $taintedApplications[$application->getPackage()->packageID] = $application; + } + $missingLanguageItemsMTime = 0; if (ENABLE_DEBUG_MODE && ENABLE_DEVELOPER_TOOLS) { $logList = new DevtoolsMissingLanguageItemList(); @@ -191,6 +200,7 @@ class IndexPage extends AbstractPage 'usersAwaitingApproval' => $usersAwaitingApproval, 'evaluationExpired' => $evaluationExpired, 'evaluationPending' => $evaluationPending, + 'taintedApplications' => $taintedApplications, 'missingLanguageItemsMTime' => $missingLanguageItemsMTime, ]); } diff --git a/wcfsetup/install/files/lib/acp/page/PackageListPage.class.php b/wcfsetup/install/files/lib/acp/page/PackageListPage.class.php index 1457acdba5..61e53dd88d 100644 --- a/wcfsetup/install/files/lib/acp/page/PackageListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/PackageListPage.class.php @@ -4,6 +4,7 @@ namespace wcf\acp\page; use wcf\data\package\PackageList; use wcf\page\SortablePage; +use wcf\system\application\ApplicationHandler; use wcf\system\language\LanguageFactory; use wcf\system\WCF; @@ -95,9 +96,19 @@ class PackageListPage extends SortablePage { parent::assignVariables(); + $taintedApplications = []; + foreach (ApplicationHandler::getInstance()->getApplications() as $application) { + if (!$application->isTainted) { + continue; + } + + $taintedApplications[$application->getPackage()->packageID] = $application; + } + WCF::getTPL()->assign([ 'recentlyDisabledCustomValues' => LanguageFactory::getInstance()->countRecentlyDisabledCustomValues(), 'packageID' => $this->packageID, + 'taintedApplications' => $taintedApplications, ]); } diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 1451e1c815..08919a00c0 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -2006,6 +2006,7 @@ Die Datenbestände werden sorgfältig gepflegt, aber es ist nicht ausgeschlossen Unbekannter Fehler. {/if} {/implode}]]> + {$taintedApplication->getPackage()->getTitle()}{/if} ist nicht vollständig installiert. Für eine weitere Verwendung der App ist eine Deinstallation mit anschließender Neuinstallation von Nöten.]]> diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index fbf131379d..af0ef198a9 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -1990,6 +1990,7 @@ If you have already bought the licenses for the listed apps, th Unknown error. {/if} {/implode}]]> + {$taintedApplication->getPackage()->getTitle()}{/if} is not fully installed. You need to uninstall and then reinstall the app to be able to use it.]]>