Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/Command/Encryption/SetDefaultModule.php')
-rw-r--r--core/Command/Encryption/SetDefaultModule.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/Command/Encryption/SetDefaultModule.php b/core/Command/Encryption/SetDefaultModule.php
index eb9f3718b1d..0b8b4ce5891 100644
--- a/core/Command/Encryption/SetDefaultModule.php
+++ b/core/Command/Encryption/SetDefaultModule.php
@@ -2,6 +2,7 @@
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
+ * @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @author Joas Schilling <coding@schilljs.com>
* @author Ruben Homs <ruben@homs.codes>
*
@@ -20,10 +21,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OC\Core\Command\Encryption;
-
use OCP\Encryption\IManager;
use OCP\IConfig;
use Symfony\Component\Console\Command\Command;
@@ -65,22 +64,24 @@ class SetDefaultModule extends Command {
;
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$isMaintenanceModeEnabled = $this->config->getSystemValue('maintenance', false);
if ($isMaintenanceModeEnabled) {
$output->writeln("Maintenance mode must be disabled when setting default module,");
$output->writeln("in order to load the relevant encryption modules correctly.");
- return;
+ return 1;
}
$moduleId = $input->getArgument('module');
if ($moduleId === $this->encryptionManager->getDefaultEncryptionModuleId()) {
$output->writeln('"' . $moduleId . '"" is already the default module');
- } else if ($this->encryptionManager->setDefaultEncryptionModule($moduleId)) {
+ } elseif ($this->encryptionManager->setDefaultEncryptionModule($moduleId)) {
$output->writeln('<info>Set default module to "' . $moduleId . '"</info>');
} else {
$output->writeln('<error>The specified module "' . $moduleId . '" does not exist</error>');
+ return 1;
}
+ return 0;
}
}