Skip to content
Snippets Groups Projects
Commit a2caeb84 authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FEAT #13268 TIME 0:40 hide unnecessary password parameter

parent 963497ed
No related branches found
No related tags found
No related merge requests found
......@@ -36,11 +36,13 @@ class ConfigurationController
$configuration = ConfigurationModel::getByPrivilege(['privilege' => $args['privilege']]);
$configuration['value'] = json_decode($configuration['value'], true);
if (!empty($configuration['value']['password'])) {
$configuration['value']['password'] = '';
$configuration['value']['passwordAlreadyExists'] = true;
} else {
$configuration['value']['passwordAlreadyExists'] = false;
if ($args['privilege'] == 'admin_email_server') {
if (!empty($configuration['value']['password'])) {
$configuration['value']['password'] = '';
$configuration['value']['passwordAlreadyExists'] = true;
} else {
$configuration['value']['passwordAlreadyExists'] = false;
}
}
return $response->withJson(['configuration' => $configuration]);
......@@ -118,7 +120,7 @@ class ConfigurationController
}
}
$data = json_encode($data);
$data = json_encode($data, JSON_UNESCAPED_SLASHES);
ConfigurationModel::update(['set' => ['value' => $data], 'where' => ['privilege = ?'], 'data' => [$args['privilege']]]);
HistoryController::add([
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment