Skip to content

Commit

Permalink
Fix for app:enable in case of not valid/not existing enterprise key
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and [email protected] committed Nov 11, 2019
1 parent 5503eb7 commit 1246c86
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/Command/App/Enable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit 1246c86

Please sign in to comment.