From 49beca445bef42df9b68b93dca3e5b2ba37abe13 Mon Sep 17 00:00:00 2001 From: Afaque Hussain Date: Wed, 30 Jan 2013 11:31:04 -0800 Subject: [PATCH] Respected canUninstall() :P Summary: Disabled uninstalling of applications which can't be uninstalled. Also, applications which cannot be uninstalled always show that they are installed even if users somehow manually edit the configuration. Test Plan: Manually edited the URI to uninstall applications which can't be unisntalled. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4741 --- src/applications/base/PhabricatorApplication.php | 4 +++- .../controller/PhabricatorApplicationUninstallController.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/applications/base/PhabricatorApplication.php b/src/applications/base/PhabricatorApplication.php index 0a397e1f4b..aed8bc7d94 100644 --- a/src/applications/base/PhabricatorApplication.php +++ b/src/applications/base/PhabricatorApplication.php @@ -66,7 +66,9 @@ abstract class PhabricatorApplication { $uninstalled = PhabricatorEnv::getEnvConfig('phabricator.uninstalled-applications'); - if (isset($uninstalled[get_class($this)])) { + if (!$this->canUninstall()) { + return true; + } else if (isset($uninstalled[get_class($this)])) { return false; } else { return true; diff --git a/src/applications/meta/controller/PhabricatorApplicationUninstallController.php b/src/applications/meta/controller/PhabricatorApplicationUninstallController.php index f9b8ae3f83..fcf32ea4a4 100644 --- a/src/applications/meta/controller/PhabricatorApplicationUninstallController.php +++ b/src/applications/meta/controller/PhabricatorApplicationUninstallController.php @@ -17,7 +17,7 @@ final class PhabricatorApplicationUninstallController $selected = PhabricatorApplication::getByClass($this->application); - if (!$selected) { + if (!$selected || !$selected->canUninstall()) { return new Aphront404Response(); }