diff options
author | Joas Schilling <coding@schilljs.com> | 2020-06-26 15:12:11 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-06-26 15:12:11 +0200 |
commit | d7c0b9cced2dff16e4e05507ac58cf8664a6aafc (patch) | |
tree | bb136f0e797986da6e789bf2bf5e9f0370002d26 /apps/user_ldap/lib/Command/TestConfig.php | |
parent | ab21d69903c4360cbce59741624b6e765e3bd35f (diff) | |
download | nextcloud-server-d7c0b9cced2dff16e4e05507ac58cf8664a6aafc.tar.gz nextcloud-server-d7c0b9cced2dff16e4e05507ac58cf8664a6aafc.zip |
Also always return in app commands
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/user_ldap/lib/Command/TestConfig.php')
-rw-r--r-- | apps/user_ldap/lib/Command/TestConfig.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/user_ldap/lib/Command/TestConfig.php b/apps/user_ldap/lib/Command/TestConfig.php index 0973e6245b3..b588a8380d0 100644 --- a/apps/user_ldap/lib/Command/TestConfig.php +++ b/apps/user_ldap/lib/Command/TestConfig.php @@ -47,13 +47,13 @@ class TestConfig extends Command { ; } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $helper = new Helper(\OC::$server->getConfig()); $availableConfigs = $helper->getServerConfigurationPrefixes(); $configID = $input->getArgument('configID'); if (!in_array($configID, $availableConfigs)) { $output->writeln("Invalid configID"); - return; + return 1; } $result = $this->testConfig($configID); @@ -61,11 +61,13 @@ class TestConfig extends Command { $output->writeln('The configuration is valid and the connection could be established!'); } elseif ($result === 1) { $output->writeln('The configuration is invalid. Please have a look at the logs for further details.'); + return 1; } elseif ($result === 2) { $output->writeln('The configuration is valid, but the Bind failed. Please check the server settings and credentials.'); } else { $output->writeln('Your LDAP server was kidnapped by aliens.'); } + return 0; } /** |