From b33c97d2905473d27d4fc1001c7fc833439e1a7c Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 17 Jul 2013 21:30:03 +0200 Subject: [PATCH] Improved package installation --- .../files/acp/templates/packageInstallationConfirm.tpl | 2 +- .../files/lib/acp/form/PackageStartInstallForm.class.php | 3 ++- .../queue/PackageInstallationQueueAction.class.php | 4 ---- wcfsetup/setup/db/install.sql | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/wcfsetup/install/files/acp/templates/packageInstallationConfirm.tpl b/wcfsetup/install/files/acp/templates/packageInstallationConfirm.tpl index 4e52dbba09..af2d094cd4 100644 --- a/wcfsetup/install/files/acp/templates/packageInstallationConfirm.tpl +++ b/wcfsetup/install/files/acp/templates/packageInstallationConfirm.tpl @@ -11,7 +11,7 @@ 'wcf.acp.package.update.title': '{lang}wcf.acp.package.update.title{/lang}' }); - new WCF.ACP.Package.Installation({@$queue->queueID}, undefined, {if $queue->action == 'install'}true, false{else}false, true{/if}); + new WCF.ACP.Package.Installation({@$queue->queueID}, undefined, {if $queue->action == 'install'}{if $queue->isApplication}false{else}true{/if}, false{else}false, true{/if}); new WCF.ACP.Package.Installation.Cancel({@$queue->queueID}); }); diff --git a/wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php b/wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php index 5a0f561f70..979c1ac95d 100755 --- a/wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php @@ -207,6 +207,7 @@ class PackageStartInstallForm extends AbstractForm { $packageID = ($this->package) ? $this->package->packageID : null; // insert queue + $isApplication = $this->archive->getPackageInfo('isApplication'); $this->queue = PackageInstallationQueueEditor::create(array( 'processNo' => $processNo, 'userID' => WCF::getUser()->userID, @@ -215,7 +216,7 @@ class PackageStartInstallForm extends AbstractForm { 'packageID' => $packageID, 'archive' => (!empty($this->uploadPackage['tmp_name']) ? $this->uploadPackage['name'] : $this->downloadPackage), 'action' => ($this->package != null ? 'update' : 'install'), - 'confirmInstallation' => 1 + 'isApplication' => (!$isApplication ? '0' : '1') )); $this->saved(); diff --git a/wcfsetup/install/files/lib/data/package/installation/queue/PackageInstallationQueueAction.class.php b/wcfsetup/install/files/lib/data/package/installation/queue/PackageInstallationQueueAction.class.php index d0ebe56c86..b8c88122a1 100644 --- a/wcfsetup/install/files/lib/data/package/installation/queue/PackageInstallationQueueAction.class.php +++ b/wcfsetup/install/files/lib/data/package/installation/queue/PackageInstallationQueueAction.class.php @@ -87,10 +87,6 @@ class PackageInstallationQueueAction extends AbstractDatabaseObjectAction { throw new UserInputException('objectIDs'); } - // todo: do confirmInstallation and packageType need validation? - // see https://github.com/WoltLab/WCF/issues/1329 - // see https://github.com/WoltLab/WCF/issues/1330 - if ($this->queue->userID != WCF::getUser()->userID) { throw new PermissionDeniedException(); } diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index c0d9b2e193..b05613c40c 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -603,8 +603,7 @@ CREATE TABLE wcf1_package_installation_queue ( archive VARCHAR(255) NOT NULL DEFAULT '', action ENUM('install', 'update', 'uninstall') NOT NULL DEFAULT 'install', done TINYINT(1) NOT NULL DEFAULT 0, - confirmInstallation TINYINT(1) NOT NULL DEFAULT 0, - packageType ENUM('default', 'requirement', 'optional') NOT NULL DEFAULT 'default' + isApplication TINYINT(1) NOT NULL DEFAULT 0 ); DROP TABLE IF EXISTS wcf1_package_installation_sql_log; -- 2.20.1