From d7c0b9cced2dff16e4e05507ac58cf8664a6aafc Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 26 Jun 2020 15:12:11 +0200 Subject: Also always return in app commands Signed-off-by: Joas Schilling --- apps/user_ldap/lib/Command/TestConfig.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apps/user_ldap/lib/Command/TestConfig.php') 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; } /** -- cgit v1.2.3