From 1246c86ff4d544830d7e4c3fa58571618f2048aa Mon Sep 17 00:00:00 2001 From: "pastripodi@owncloud.com" Date: Mon, 11 Nov 2019 10:50:45 +0100 Subject: [PATCH] Fix for app:enable in case of not valid/not existing enterprise key --- core/Command/App/Enable.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/Command/App/Enable.php b/core/Command/App/Enable.php index dc396329bcda..2eb9782d2f3f 100644 --- a/core/Command/App/Enable.php +++ b/core/Command/App/Enable.php @@ -71,10 +71,19 @@ protected function execute(InputInterface $input, OutputInterface $output) { } $groups = $input->getOption('groups'); - if (empty($groups)) { + $key = new \OCA\Enterprise_Key\EnterpriseKey(false, \OC::$server->getConfig()); + if (empty($groups)) { + if (!$key->isValid()) { + $output->writeln($appId . ' cannot be enabled because of invalid enteprise key'); + return 1; + } \OC_App::enable($appId); $output->writeln($appId . ' enabled'); } else { + if (!$key->isValid()) { + $output->writeln($appId . ' cannot be enabled because of invalid enteprise key'); + return 1; + } \OC_App::enable($appId, $groups); $output->writeln($appId . ' enabled for groups: ' . \implode(', ', $groups)); }