Skip to content

Commit

Permalink
3.0.10
Browse files Browse the repository at this point in the history
Added previous passwords history for each item
  • Loading branch information
nilsteampassnet committed Oct 11, 2023
1 parent 01b3cb5 commit 27391d4
Show file tree
Hide file tree
Showing 32 changed files with 162 additions and 41 deletions.
2 changes: 1 addition & 1 deletion docs/manage/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ As an example when searching for keyword `password`.
| 👉 __Offline mode HTML export enabled__ |  Exporting a list of objects outside of Teampass in an HTML format. ||
| 👉 __Logon passwords expire after xx days (0 to disable)__ | Defining a due date after which the password is expired. ||
| 👉 __Maximum password length__ | Defines the maximum length of an object password managed inside Teampass. ||
| 👉 __Manual insertions in item history log allowed__ | Manual insertion in the object history is possible. ||
| 👉 __Knowledge base feature__ | A knowledge base is available directly in Teampass permitting to provide more information about objects. ||
| 👉 __Manual insertions in item history log allowed__ | Manual insertion in the object history is possible. ||
| 👉 __Password suggestion feature enabled__ |  ||
4 changes: 2 additions & 2 deletions includes/config/include.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* @see http://www.teampass.net
*/
define('TP_VERSION', '3.0.10');
define("UPGRADE_MIN_DATE", "1696261313");
define('TP_VERSION_MINOR', '67');
define("UPGRADE_MIN_DATE", "1697032362");
define('TP_VERSION_MINOR', '69');
define('TP_TOOL_NAME', 'Teampass');
define('TP_ONE_DAY_SECONDS', 86400);
define('TP_ONE_WEEK_SECONDS', 604800);
Expand Down
2 changes: 2 additions & 0 deletions includes/language/bulgarian.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/catalan.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Torna a carregar la taula de memòria cau de l'usuari',
'send_email_to_user' => 'Enviar correu electrònic a l'usuari',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/chinese.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/czech.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/dutch.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/english.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* @see https://www.teampass.net
*/
return array(
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',
'items_management' => 'Items operations',
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
Expand Down
2 changes: 2 additions & 0 deletions includes/language/estonian.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/french.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Recharger la table de cache de l'utilisateur',
'send_email_to_user' => 'Envoi d'email à l'utilisateur',
'items_management' => 'Opérations relatives aux objets',
'previously_used_passwords' => 'Mots de passe précédemment utilisés',
'next_passwords_were_valid_until_date' => 'Ces mots de passe ont été valides jusqu'à la date indiquée',

);
2 changes: 2 additions & 0 deletions includes/language/german.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/greek.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/hungarian.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/italian.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/japanese.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/norwegian.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/polish.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/portuguese.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/portuguese_br.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/romanian.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/russian.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
12 changes: 7 additions & 5 deletions includes/language/spanish.php
Original file line number Diff line number Diff line change
Expand Up @@ -1108,18 +1108,20 @@
'maximum_session_expiration_time_tip' => 'Tiempo máximo en minutos que un usuario puede prolongar una sesión',
'index_session_duration_too_long' => 'La duración de la sesión es muy larga',
'extend_session_duration_by' => 'Extender duación de la sesión por',
'settings_ldap_user_dn_attribute' => 'User Distinguished Name',
'settings_ldap_user_dn_attribute_tip' => 'The attribute label for the user Distinguished Name (DN) in the AD.<br>Example: For openLDAP: dn. For Active Directory: distinguishedname.',
'settings_ldap_user_dn_attribute' => 'Distinguished Name de usuario',
'settings_ldap_user_dn_attribute_tip' => 'La etiqueta de atributo para el Distinguished Name (DN) del usuario en el AD.<br>Ejemplo: para openLDAP: dn. Para Active Directory: distinguishedname.',
'open_tasks_settings' => 'Abrir configuración de tareas',
'maximum' => 'máximo',
'updated' => 'Actualizado',
'number_of_days' => 'Número de días',
'number_of_times' => 'Número de veces',
'sharekey_not_ready' => 'Sharekey not yet generated ... all item data may not be ready ... please try later',
'item_action_not_yet_possible' => 'Action not yet possible on this item',
'sharekey_not_ready' => 'La sharekey aún no se ha generado... Es posible que no todos los datos del artículo estén listos... Inténtelo más tarde.',
'item_action_not_yet_possible' => 'Aún no es posible realizar ninguna acción sobre este elemento.',
'open' => 'abrir',
'reload_user_cache_table' => 'Recargar la tabla de caché del usuario',
'send_email_to_user' => 'Enviar correo al usuario',
'items_management' => 'Items operations',
'items_management' => 'Operaciones en los artículos',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/swedish.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/turkish.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/ukrainian.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
2 changes: 2 additions & 0 deletions includes/language/vietnamese.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,5 +1121,7 @@
'reload_user_cache_table' => 'Reload user cache table',
'send_email_to_user' => 'Send email to user',
'items_management' => 'Items operations',
'previously_used_passwords' => 'Previously used passwords',
'next_passwords_were_valid_until_date' => 'Next passwords were valid until date',

);
4 changes: 2 additions & 2 deletions install/install.queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ function encryptFollowingDefuse($message, $ascii_key)
`id_user` int(8) NOT NULL,
`action` varchar(250) NULL,
`raison` text NULL,
`raison_iv` text NULL,
`old_value` MEDIUMTEXT NULL DEFAULT NULL,
`encryption_type` VARCHAR(20) NOT NULL DEFAULT 'not_set',
PRIMARY KEY (`increment_id`)
) CHARSET=utf8;"
Expand Down Expand Up @@ -876,7 +876,7 @@ function encryptFollowingDefuse($message, $ascii_key)
`increment_id`INT(12) NOT NULL AUTO_INCREMENT,
`id` int(12) NOT NULL,
`label` varchar(500) NOT NULL,
`description` text NOT NULL,
`description` MEDIUMTEXT NULL DEFAULT NULL,
`tags` text DEFAULT NULL,
`id_tree` int(12) NOT NULL,
`perso` tinyint(1) NOT NULL,
Expand Down
20 changes: 20 additions & 0 deletions install/upgrade_run_3.0.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,26 @@
);
}

// Alter raison_iv field in log_items
try {
mysqli_query(
$db_link,
'ALTER TABLE `' . $pre . 'log_items` CHANGE `raison_iv` `old_value` MEDIUMTEXT NULL DEFAULT NULL;'
);
} catch (Exception $e) {
// Do nothing
}

// Alter description field in cache
try {
mysqli_query(
$db_link,
'ALTER TABLE `' . $pre . 'cache` CHANGE `description` `description` MEDIUMTEXT NULL DEFAULT NULL;'
);
} catch (Exception $e) {
// Do nothing
}


//---<END 3.0.10

Expand Down
37 changes: 34 additions & 3 deletions pages/items.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -2873,7 +2873,7 @@ function(teampassApplication) {
var data = {
'anyone_can_modify': $('#form-item-anyoneCanModify').is(':checked') ? 1 : 0,
'complexity_level': parseInt($('#form-item-password-complex').val()),
'description': $('#form-item-description').summernote('code'),
'description': $('#form-item-description').summernote('code') === '<p><br></p>' ? '' : $('#form-item-description').summernote('code'),
'diffusion_list': diffusion,
'diffusion_list_names': diffusionNames,
'folder': parseInt($('#form-item-folder').val()),
Expand Down Expand Up @@ -4353,6 +4353,9 @@ function(teampassApplication) {
if (debugJavascript === true) console.log("Last seen item " + store.get('teampassApplication').lastItemSeen)
}

// do
$('#card-item-password-history-button').addClass('hidden');

// Prepare data to be sent
var data = {
'id': parseInt(itemId),
Expand Down Expand Up @@ -4590,7 +4593,9 @@ function(teampassItem) {
$('#form-item-label').focus();

// Editor for description field
if (debugJavascript === true) {console.log('>>>> create summernote');}
if (debugJavascript === true) {
console.log('>>>> create summernote');
}
$('#form-item-description')
.html(data.description)
.summernote({
Expand Down Expand Up @@ -5531,7 +5536,8 @@ function(data) {
}
if (data.error === '') {
var html = '',
nbHistoryEvents = 0;
nbHistoryEvents = 0,
previousPasswords = '<h6 class="mb-3"><?php echo langHdl('next_passwords_were_valid_until_date'); ?></h6>';
$.each(data.history, function(i, value) {
html += '<div class="direct-chat-msg"><div class="direct-chat-info clearfix">' +
'<span class="direct-chat-name float-left">' + value.name + '</span>' +
Expand All @@ -5553,6 +5559,31 @@ function(data) {
$('#card-item-history').closest().addClass('collapsed');
}

// Display password history
if (data.previous_passwords.length > 0) {
$.each(data.previous_passwords, function(i, value) {
previousPasswords += '<div class="row"><div class="col-4"><i class="fa-solid fa-key fa-2xs mr-2"></i><span class="badge bg-info text-dark">' + value.date + '</span></div><div class="col-8"><mark>' + value.password + '</mark></div></div>';
});

// SHow dialog
$(document).on('click', '#card-item-password-history-button', function() {
showModalDialogBox(
'#warningModal',
'<i class="fa-solid fa-clock-rotate-left mr-2"></i><?php echo langHdl('previously_used_passwords'); ?>',
previousPasswords,
'',
'<?php echo langHdl('close'); ?>',
'modal-xl'
);
});

// show button
$('#card-item-password-history-button').removeClass('hidden');
} else {
// hide button
$('#card-item-password-history-button').addClass('hidden');
}

// Hide loading state
$('#card-item-history').nextAll().addClass('hidden');
}
Expand Down
9 changes: 6 additions & 3 deletions pages/items.php
Original file line number Diff line number Diff line change
Expand Up @@ -572,18 +572,21 @@
<ul class="list-group list-group-unbordered mb-3">
<li class="list-group-item">
<b><?php echo langHdl('pw'); ?></b>
<button type="button" class="float-right btn btn-outline-info btn-sm btn-copy-clipboard" id="card-item-pwd-button">
<button type="button" class="float-right btn btn-outline-info btn-sm btn-copy-clipboard infotip" id="card-item-pwd-button" title="<?php echo langHdl('copy'); ?>">
<i class="far fa-copy"></i>
</button>
<button type="button" class="float-right btn btn-outline-info btn-sm mr-1" id="card-item-pwd-show-button">
<button type="button" class="float-right btn btn-outline-info btn-sm mr-1 hidden infotip" id="card-item-password-history-button" title="<?php echo langHdl('history'); ?>">
<i class="fa-solid fa-clock-rotate-left"></i>
</button>
<button type="button" class="float-right btn btn-outline-info btn-sm mr-1 infotip" id="card-item-pwd-show-button" title="<?php echo langHdl('show'); ?>">
<i class="far fa-eye pwd-show-spinner"></i>
</button>
<span id="card-item-pwd" class="float-right unhide_masked_data pointer mr-2"></span>
<input id="hidden-item-pwd" type="hidden">
</li>
<li class="list-group-item">
<b><?php echo langHdl('index_login'); ?></b>
<button type="button" class="float-right btn btn-outline-info btn-sm ml-1 btn-copy-clipboard-clear" data-clipboard-target="#card-item-login" id="card-item-login-btn">
<button type="button" class="float-right btn btn-outline-info btn-sm ml-1 btn-copy-clipboard-clear infotip" data-clipboard-target="#card-item-login" id="card-item-login-btn" title="<?php echo langHdl('copy'); ?>">
<i class="far fa-copy"></i>
</button>
<span id="card-item-login" class="float-right"></span>
Expand Down
Loading

0 comments on commit 27391d4

Please sign in to comment.