diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-03-04 20:21:14 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-03-04 20:21:14 +0100 |
commit | cffc25647927d3e085fcf16d28d4e5a5cf415a60 (patch) | |
tree | 2c4a61ad848be46702532aca6449a428d6230e10 /apps | |
parent | d772bc56e749c6ec380b4df3298510fd1f5dd9ad (diff) | |
parent | 814921737186e2e9af0798643de39d2c1bdd0cf7 (diff) | |
download | nextcloud-server-cffc25647927d3e085fcf16d28d4e5a5cf415a60.tar.gz nextcloud-server-cffc25647927d3e085fcf16d28d4e5a5cf415a60.zip |
Merge pull request #14672 from Crote/master
Add --show-password option to ldap:show-config
Diffstat (limited to 'apps')
-rw-r--r-- | apps/user_ldap/command/showconfig.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/user_ldap/command/showconfig.php b/apps/user_ldap/command/showconfig.php index ddbc45243ff..fbcf8d57de4 100644 --- a/apps/user_ldap/command/showconfig.php +++ b/apps/user_ldap/command/showconfig.php @@ -27,6 +27,12 @@ class ShowConfig extends Command { InputArgument::OPTIONAL, 'will show the configuration of the specified id' ) + ->addOption( + 'show-password', + null, + InputOption::VALUE_NONE, + 'show ldap bind password' + ) ; } @@ -44,15 +50,16 @@ class ShowConfig extends Command { $configIDs = $availableConfigs; } - $this->renderConfigs($configIDs, $output); + $this->renderConfigs($configIDs, $output, $input->getOption('show-password')); } /** * prints the LDAP configuration(s) * @param string[] configID(s) * @param OutputInterface $output + * @param bool $withPassword Set to TRUE to show plaintext passwords in output */ - protected function renderConfigs($configIDs, $output) { + protected function renderConfigs($configIDs, $output, $withPassword) { foreach($configIDs as $id) { $configHolder = new Configuration($id); $configuration = $configHolder->getConfiguration(); @@ -62,7 +69,7 @@ class ShowConfig extends Command { $table->setHeaders(array('Configuration', $id)); $rows = array(); foreach($configuration as $key => $value) { - if($key === 'ldapAgentPassword') { + if($key === 'ldapAgentPassword' && !$withPassword) { $value = '***'; } if(is_array($value)) { |