From 078ed7372ce1c829e1405c961713588bb7370f52 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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/Command/App/Enable.php b/core/Command/App/Enable.php index dc396329bcda..cab58e0ce4ba 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'); + $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)); }