From 9edca39b49f6b7fcfc4e43b61b88204222ad5e91 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Mon, 15 Aug 2016 20:03:19 +0200 Subject: attempt to remove section and settings entries when an app got disabled --- lib/base.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/base.php') diff --git a/lib/base.php b/lib/base.php index 3457a74e989..9e56bc09f01 100644 --- a/lib/base.php +++ b/lib/base.php @@ -725,6 +725,7 @@ class OC { self::registerLogRotate(); self::registerEncryptionWrapper(); self::registerEncryptionHooks(); + self::registerSettingsHooks(); //make sure temporary files are cleaned up $tmpManager = \OC::$server->getTempManager(); @@ -803,6 +804,14 @@ class OC { } } + public static function registerSettingsHooks() { + $dispatcher = \OC::$server->getEventDispatcher(); + $dispatcher->addListener(OCP\App\ManagerEvent::EVENT_APP_DISABLE, function($event) { + /** @var \OCP\App\ManagerEvent $event */ + \OC::$server->getSettingsManager()->onAppDisabled($event->getAppID()); + }); + } + private static function registerEncryptionWrapper() { $manager = self::$server->getEncryptionManager(); \OCP\Util::connectHook('OC_Filesystem', 'preSetup', $manager, 'setupStorage'); -- cgit v1.2.3