2 namespace wcf\acp\page
;
3 use wcf\data\package\installation\queue\PackageInstallationQueue
;
4 use wcf\page\AbstractPage
;
5 use wcf\system\exception\IllegalLinkException
;
6 use wcf\system\package\validation\PackageValidationManager
;
7 use wcf\system\package\PackageInstallationDispatcher
;
12 * Shows a confirmation page prior to start installing.
14 * @author Alexander Ebert
15 * @copyright 2001-2014 WoltLab GmbH
16 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
17 * @package com.woltlab.wcf
18 * @subpackage acp.page
19 * @category Community Framework
21 class PackageInstallationConfirmPage
extends AbstractPage
{
23 * @see \wcf\page\AbstractPage::$activeMenuItem
25 public $activeMenuItem = 'wcf.acp.menu.link.package.install';
28 * package installation dispatcher object
29 * @var \wcf\system\package\PackageInstallationDispatcher
31 public $packageInstallationDispatcher = null;
34 * package installation queue object
35 * @var \wcf\data\package\installation\queue\PackageInstallationQueue
46 * package validation result
49 public $validationPassed = false;
52 * true if the package to be installed was uploaded via the import style
56 public $installingImportedStyle = false;
59 * @see \wcf\page\IPage::readParameters()
61 public function readParameters() {
62 parent
::readParameters();
64 if (isset($_REQUEST['queueID'])) $this->queueID
= intval($_REQUEST['queueID']);
65 $this->queue
= new PackageInstallationQueue($this->queueID
);
66 if (!$this->queue
->queueID ||
$this->queue
->done
) {
67 throw new IllegalLinkException();
70 if ($this->queue
->action
== 'install') {
71 WCF
::getSession()->checkPermissions(array('admin.system.package.canInstallPackage'));
74 WCF
::getSession()->checkPermissions(array('admin.system.package.canUpdatePackage'));
77 $this->installingImportedStyle
= WCF
::getSession()->getVar('stylePackageImportLocation') !== null;
78 if ($this->installingImportedStyle
) {
79 WCF
::getSession()->unregister('stylePackageImportLocation');
84 * @see \wcf\page\IPage::readData()
86 public function readData() {
89 $this->packageInstallationDispatcher
= new PackageInstallationDispatcher($this->queue
);
91 // validate the package and all it's requirements
92 $this->validationPassed
= PackageValidationManager
::getInstance()->validate($this->queue
->archive
, true);
96 * @see \wcf\page\IPage::assignVariables()
98 public function assignVariables() {
99 parent
::assignVariables();
101 WCF
::getTPL()->assign(array(
102 'archive' => $this->packageInstallationDispatcher
->getArchive(),
103 'packageValidationArchives' => PackageValidationManager
::getInstance()->getPackageValidationArchiveList(),
104 'queue' => $this->queue
,
105 'validationPassed' => $this->validationPassed
,
106 'installingImportedStyle' => $this->installingImportedStyle
111 * @see \wcf\page\IPage::show()
113 public function show() {
114 // check master password
115 WCFACP
::checkMasterPassword();