Disallowed application uninstall if not within WCF ACP
authorAlexander Ebert <ebert@woltlab.com>
Wed, 2 Jan 2013 01:29:39 +0000 (02:29 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 2 Jan 2013 01:29:39 +0000 (02:29 +0100)
Fixes #1067

wcfsetup/install/files/lib/data/package/Package.class.php

index ddc43081f5ee9434a73bf9d77209a09c32f648ef..4fbbe42417d98a3d15902f2f15e27ff35afaa7c3 100644 (file)
@@ -159,8 +159,8 @@ class Package extends DatabaseObject {
                        return false;
                }
                
-               // disallow uninstallation of current package or WCF
-               if ($this->package == 'com.woltlab.wcf' || $this->packageID == PACKAGE_ID) {
+               // disallow uninstallation of WCF and applications if not within WCF ACP
+               if ($this->package == 'com.woltlab.wcf' || ($this->isApplication && PACKAGE_ID != 1)) {
                        return false;
                }
                
@@ -348,16 +348,4 @@ class Package extends DatabaseObject {
                // write end
                $file->close();
        }
-       
-       /**
-        * Returns a list of plugins for currently active application.
-        * 
-        * @return      wcf\data\package\PackageList
-        */
-       public static function getPluginList() {
-               $pluginList = new PackageList();
-               $pluginList->getConditionBuilder()->add("package.isApplication = ?", array(0));
-               
-               return $pluginList;
-       }
 }