namespace wcf\acp\action;
use wcf\action\AbstractDialogAction;
use wcf\data\application\Application;
+use wcf\data\application\ApplicationAction;
use wcf\data\package\installation\queue\PackageInstallationQueue;
use wcf\data\package\installation\queue\PackageInstallationQueueEditor;
use wcf\data\package\Package;
'queue' => $queue
]);
+ // mark package as tainted if it is an app
+ if ($package->isApplication) {
+ $applicationAction = new ApplicationAction([$package->packageID], 'markAsTainted');
+ $applicationAction->executeAction();
+ }
+
$queueID = $this->installation->nodeBuilder->getQueueByNode($queue->processNo, $this->installation->nodeBuilder->getNextNode());
$this->data = [
'template' => WCF::getTPL()->fetch($this->templateName),
* @property-read string $domainPath
* @property-read string $cookieDomain
* @property-read string $cookiePath
+ * @property-read integer $isTainted
*/
class Application extends DatabaseObject {
/**
// reset application cache
ApplicationCacheBuilder::getInstance()->reset();
}
+
+ /**
+ * Marks an application as tainted, prevents loading it during uninstallation.
+ */
+ public function markAsTainted() {
+ $applicationEditor = $this->getSingleObject();
+ $applicationEditor->update(['isTainted' => 1]);
+
+ ApplicationCacheBuilder::getInstance()->reset();
+ }
}
$this->getTPL()->assign('baseHref', self::$applications['wcf']->getPageURL());
}
- // TODO: this is required for the uninstallation of applications, find a different solution!
- if (PACKAGE_ID == 1) {
- //return;
- }
-
// start main application
$application = ApplicationHandler::getInstance()->getActiveApplication();
if ($application->packageID != 1) {
// ignore WCF
continue;
}
+ else if ($application->isTainted) {
+ // ignore apps flagged for uninstallation
+ continue;
+ }
$loadedApplications[] = $this->loadApplication($application, true);
}
domainName VARCHAR(255) NOT NULL,
domainPath VARCHAR(255) NOT NULL DEFAULT '/',
cookieDomain VARCHAR(255) NOT NULL,
- cookiePath VARCHAR(255) NOT NULL DEFAULT '/'
+ cookiePath VARCHAR(255) NOT NULL DEFAULT '/',
+ isTainted TINYINT(1) NOT DEFAULT 0
);
DROP TABLE IF EXISTS wcf1_article;