Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [UNRELEASE]

## Fixed

- Do not disclose `password` from `form` input.

## [1.0.2] - 2024-12-13

Expand Down
4 changes: 4 additions & 0 deletions inc/credential.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public function rawSearchOptions()
public function showForm($ID, array $options = [])
{
$this->initForm($ID, $options);

TemplateRenderer::getInstance()->display(
'@databaseinventory/credential.html.twig',
[
Expand All @@ -158,6 +159,9 @@ public function prepareInput(array $input, $mode = 'add'): array
$input['password'] = (new GLPIKey())->encrypt($input['password']);
}
}
if (isset($input['_blank_password'])) {
$input['password'] = '';
}

return $input;
}
Expand Down
4 changes: 2 additions & 2 deletions templates/credential.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
'password',
item.fields['password'],
__('Password', 'databaseinventory'),
{'clearable': false, 'is_disclosable' : true}
{'clearable': true, 'is_disclosable' : false}
)
}}
{{ fields.textField(
Expand All @@ -59,4 +59,4 @@
)
}}

{% endblock %}
{% endblock %}