示例#1
0
 /**
  * @see wcf\page\IPage::show()
  */
 public function show()
 {
     parent::show();
     // check master password
     WCFACP::checkMasterPassword();
     switch ($this->action) {
         case 'install':
         case 'update':
             if ($this->action == 'install') {
                 WCF::getSession()->checkPermissions(array('admin.system.package.canInstallPackage'));
             } else {
                 WCF::getSession()->checkPermissions(array('admin.system.package.canUpdatePackage'));
             }
             $queue = new PackageInstallationQueue($this->queueID);
             $dispatcher = new PackageInstallationDispatcher($queue);
             $dispatcher->beginInstallation();
             break;
         case 'rollback':
             // TODO
             die('ROLLBACK');
             //WCF::getSession()->checkPermissions(array('admin.system.package.canInstallPackage'));
             break;
         case 'openQueue':
             PackageInstallationDispatcher::openQueue($this->parentQueueID, $this->processNo);
             break;
         case 'startUninstall':
             WCF::getSession()->checkPermissions(array('admin.system.package.canUninstallPackage'));
             PackageUninstallationDispatcher::checkDependencies();
             break;
     }
 }
	/**
	 * @see	wcf\form\IForm::save()
	 */
	public function save() {
		parent::save();
		
		// get new process no
		$processNo = PackageInstallationQueue::getNewProcessNo();
		
		// obey foreign key
		$packageID = ($this->packageID) ? $this->packageID : null;
		
		// insert queue
		$this->queue = PackageInstallationQueueEditor::create(array(
			'processNo' => $processNo,
			'userID' => WCF::getUser()->userID,
			'package' => $this->archive->getPackageInfo('name'),
			'packageName' => $this->archive->getLocalizedPackageInfo('packageName'),
			'packageID' => $packageID,
			'archive' => (!empty($this->uploadPackage['tmp_name']) ? $this->uploadPackage['name'] : $this->downloadPackage),
			'action' => ($this->package != null ? 'update' : 'install'),
			'confirmInstallation' => 1
		));
		
		$this->saved();
		
		// open queue
		PackageInstallationDispatcher::openQueue(0, $processNo);
	}
示例#3
0
	/**
	 * @see	wcf\form\IForm::save()
	 */
	public function save() {
		if (isset($_POST['send'])) {
			parent::save();
			
			// save stack
			$processNo = $this->packageUpdate->savePackageInstallationStack();
			$this->saved();
			
			// open queue
			PackageInstallationDispatcher::openQueue(0, $processNo);
		}
	}
 /**
  * @see	\wcf\form\IForm::save()
  */
 public function save()
 {
     parent::save();
     // get new process no
     $processNo = PackageInstallationQueue::getNewProcessNo();
     // obey foreign key
     $packageID = $this->package ? $this->package->packageID : null;
     $archive = $this->downloadPackage;
     if ($this->stylePackageImportLocation) {
         $archive = $this->stylePackageImportLocation;
     } else {
         if (!empty($this->uploadPackage['tmp_name'])) {
             $archive = $this->uploadPackage['name'];
         }
     }
     // insert queue
     $isApplication = PackageValidationManager::getInstance()->getPackageValidationArchive()->getArchive()->getPackageInfo('isApplication');
     $this->queue = PackageInstallationQueueEditor::create(array('processNo' => $processNo, 'userID' => WCF::getUser()->userID, 'package' => PackageValidationManager::getInstance()->getPackageValidationArchive()->getArchive()->getPackageInfo('name'), 'packageName' => PackageValidationManager::getInstance()->getPackageValidationArchive()->getArchive()->getLocalizedPackageInfo('packageName'), 'packageID' => $packageID, 'archive' => $archive, 'action' => $this->package != null ? 'update' : 'install', 'isApplication' => !$isApplication ? '0' : '1'));
     $this->saved();
     // open queue
     PackageInstallationDispatcher::openQueue(0, $processNo);
 }