summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/command
diff options
context:
space:
mode:
authorLaurens Post <Crote@users.noreply.github.com>2015-03-03 16:17:50 +0100
committerLaurens Post <lkpost@scept.re>2015-03-04 14:15:33 +0100
commit814921737186e2e9af0798643de39d2c1bdd0cf7 (patch)
treebcb1f62f7bb4740b81aab4a61fd444fc0fe82a73 /apps/user_ldap/command
parentbe27188649c25190aca19e1a4b3dbb58eef129f8 (diff)
downloadnextcloud-server-814921737186e2e9af0798643de39d2c1bdd0cf7.tar.gz
nextcloud-server-814921737186e2e9af0798643de39d2c1bdd0cf7.zip
Add --show-password option to ldap:show-config
Diffstat (limited to 'apps/user_ldap/command')
-rw-r--r--apps/user_ldap/command/showconfig.php13
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)) {