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 078ed73
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions 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');
$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 078ed73

Please sign in to comment.