Skip to content
Extraits de code Groupes Projets
Valider 3f35e81d rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

apply feedback from code review, always show same length for passwords

parent 98cae76b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -60,7 +60,7 @@ class ConfigReader ...@@ -60,7 +60,7 @@ class ConfigReader
$newValue = $value; $newValue = $value;
if ($this->isKeyAPassword($key)) { if ($this->isKeyAPassword($key)) {
$newValue = $this->maskPassword($value); $newValue = $this->getMaskedPassword();
} }
$defaultValue = null; $defaultValue = null;
...@@ -107,9 +107,9 @@ class ConfigReader ...@@ -107,9 +107,9 @@ class ConfigReader
return $this->settings->getIniFileChain()->getFrom($this->settings->getPathLocal(), $name); return $this->settings->getIniFileChain()->getFrom($this->settings->getPathLocal(), $name);
} }
private function maskPassword($password) private function getMaskedPassword()
{ {
return str_pad('', strlen($password), '*'); return '******';
} }
private function isKeyAPassword($key) private function isKeyAPassword($key)
...@@ -169,7 +169,7 @@ class ConfigReader ...@@ -169,7 +169,7 @@ class ConfigReader
if ($setting->uiControlType === PluginSettings::CONTROL_PASSWORD) { if ($setting->uiControlType === PluginSettings::CONTROL_PASSWORD) {
$value = $configValues[$pluginName][$name]['value']; $value = $configValues[$pluginName][$name]['value'];
$configValues[$pluginName][$name]['value'] = $this->maskPassword($value); $configValues[$pluginName][$name]['value'] = $this->getMaskedPassword();
} }
} else { } else {
$defaultValue = $setting->getValue(); $defaultValue = $setting->getValue();
......
...@@ -121,7 +121,7 @@ with multiple lines', ...@@ -121,7 +121,7 @@ with multiple lines',
array ( array (
'password' => 'password' =>
array ( array (
'value' => '****', 'value' => '******',
'description' => '', 'description' => '',
'isCustomValue' => true, 'isCustomValue' => true,
'defaultValue' => NULL, 'defaultValue' => NULL,
...@@ -249,7 +249,7 @@ Another line', ...@@ -249,7 +249,7 @@ Another line',
$configValues = $this->configReader->addConfigValuesFromPluginSettings($existing, array($settings)); $configValues = $this->configReader->addConfigValuesFromPluginSettings($existing, array($settings));
$this->assertSame('****', $configValues['ExampleSettingsPlugin']['metric']['value']); $this->assertSame('******', $configValues['ExampleSettingsPlugin']['metric']['value']);
} }
private function configPath($file) private function configPath($file)
......
{ {
"Diagnostics": { "Diagnostics": {
"ConfigFileTitle": "Config file", "ConfigFileTitle": "Config file",
"ConfigFileIntroduction": "Here you can view the Piwik configuration. If you are running Piwik in a load balanced environment the page might be different depending from which server this page is loaded. Rows with a different background color are changed config values that are specified for example in the %s file.", "ConfigFileIntroduction": "Here you can view the Piwik configuration. If you are running Piwik in a load balanced environment the page might be different depending from which server this page is loaded. Rows with a different background color are changed config values that are specified for example in the %1$s file.",
"HideUnchanged": "If you want to see only changed values you can %shide all unchanged values%s.", "HideUnchanged": "If you want to see only changed values you can %1$shide all unchanged values%2$s.",
"Sections": "Sections" "Sections": "Sections"
} }
} }
\ No newline at end of file
{ {
"description": "Performs diagnostics to check that Piwik is installed and runs correctly.", "description": "Performs diagnostics to check that Piwik is installed and runs correctly."
"require": {
"piwik": ">=2.16.0-b2"
}
} }
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter