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)); }