diff --git a/includes/core/load.js.php b/includes/core/load.js.php
index a6b8d4b32..e19c49bbc 100755
--- a/includes/core/load.js.php
+++ b/includes/core/load.js.php
@@ -2082,4 +2082,69 @@ function hashUserId(userId) {
const hash = CryptoJS.SHA256(userId);
return hash.toString(CryptoJS.enc.Hex).substring(0, 16);
}
+
+ /**
+ * Get item password to show or copy it in clipboard.
+ *
+ * @param {string} action - Log action (ex: at_password_shown).
+ * @param {string} id_type - 'item_key' or 'item_id'.
+ * @param {number|string} id_value - The item key or id.
+ *
+ * @returns {string} - The item cleartext password if user has access.
+ */
+ function getItemPassword(action, id_type, id_value) {
+ let item_password = '';
+
+ // Get password from server
+ $.ajax({
+ type: "POST",
+ async: false,
+ url: 'sources/items.queries.php',
+ data: 'type=get_item_password&action=' + action + '&' + id_type +
+ '=' + id_value + '&key=get('key'); ?>',
+ dataType: "",
+ success: function(data) {
+ //decrypt data
+ try {
+ data = prepareExchangedData(data, "decode", "get('key'); ?>");
+ } catch (e) {
+ // error
+ toastr.remove();
+ toastr.warning(
+ 'get('no_item_to_display'); ?>'
+ );
+ return false;
+ }
+
+ // No access
+ if (data.password_error !== '') {
+ toastr.remove();
+ toastr.error(
+ data.password_error,
+ 'get('caution'); ?>', {
+ timeOut: 5000,
+ progressBar: true
+ }
+ );
+ return false;
+ }
+
+ const password = simplePurifier(atob(data.password), false, false, false, false).utf8Decode();
+ if (password === '') {
+ toastr.info(
+ 'get('password_is_empty'); ?>',
+ '', {
+ timeOut: 2000,
+ positionClass: 'toast-bottom-right',
+ progressBar: true
+ }
+ );
+ }
+
+ item_password = password;
+ }
+ });
+
+ return item_password;
+ }
diff --git a/includes/core/login.js.php b/includes/core/login.js.php
index d93ee8fd9..3fd78b724 100755
--- a/includes/core/login.js.php
+++ b/includes/core/login.js.php
@@ -627,11 +627,7 @@ function launchIdentify(isDuo, redirect, psk, oauth2 = false) {
//TODO : je pense que cela pourrait etre modifié pour ne pas faire de requete ajax ; on dispose des infos via `get_teampass_settings`
$.post(
'sources/identify.php', {
- type: 'get2FAMethods',
- login: $('#login').val(),
- xhrFields: {
- withCredentials: true
- }
+ type: 'get2FAMethods'
},
function(data) {
data = JSON.parse(data);
diff --git a/includes/language/bulgarian.php b/includes/language/bulgarian.php
index e02fc1121..9e4f103a0 100755
--- a/includes/language/bulgarian.php
+++ b/includes/language/bulgarian.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/includes/language/catalan.php b/includes/language/catalan.php
index 3df3a347f..650c8c0a9 100755
--- a/includes/language/catalan.php
+++ b/includes/language/catalan.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/includes/language/chinese.php b/includes/language/chinese.php
index 2743f9f81..6b4bbf6f2 100755
--- a/includes/language/chinese.php
+++ b/includes/language/chinese.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/includes/language/czech.php b/includes/language/czech.php
index 7846aabb2..46505d7a3 100755
--- a/includes/language/czech.php
+++ b/includes/language/czech.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/includes/language/dutch.php b/includes/language/dutch.php
index cae5a7d48..444df9802 100755
--- a/includes/language/dutch.php
+++ b/includes/language/dutch.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/includes/language/english.php b/includes/language/english.php
index 999b3ceca..57b99d8e5 100755
--- a/includes/language/english.php
+++ b/includes/language/english.php
@@ -39,7 +39,6 @@
'highlight_selected_tip' => 'When enabled, the selected item will be highlighted in the list.',
'highlight_favorites' => 'Highlight favorites',
'highlight_favorites_tip' => 'When enabled, the favorite items will be highlighted in the list.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'oauth2_need_user_old_password' => 'For the first SSO connection, please provide your previous password',
@@ -1183,6 +1182,10 @@
'syslog_port' => 'Syslog port (default 514)',
'error_bad_credentials' => 'Login credentials do not correspond!',
'bruteforce_wait' => 'Too many failed attempts, your account is blocked until: ',
+ 'bruteforce_unlock_at' => 'Account unlocked at (anti bruteforce): ',
+ 'bruteforce_reset_account' => 'Reset anti bruteforce of user',
+ 'bruteforce_reset_mail_subject' => 'TEAMPASS - Your account is disabled',
+ 'bruteforce_reset_mail_body' => 'Hello #name#,
Your teampass account has been locked due to a large number of authentication failures.
You can unblock it by clicking on this link #reset_url#
Automatic unlock: #unlock_at#',
'settings_ldap_usergroup' => 'LDAP group to search',
'settings_ldap_usergroup_tip' => 'Enter the LDAP group in the directory where allowed user logins are stored. Example: cn=sysadmins,ou=groups,dc=example,dc=com',
'server_password_change_enable' => 'Enable changing password on distant server (using ssh connection)',
diff --git a/includes/language/estonian.php b/includes/language/estonian.php
index 5f34a9fcb..45de97594 100755
--- a/includes/language/estonian.php
+++ b/includes/language/estonian.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/includes/language/french.php b/includes/language/french.php
index 4cc234e36..4a9c957a6 100755
--- a/includes/language/french.php
+++ b/includes/language/french.php
@@ -881,6 +881,10 @@
'syslog_port' => 'Port Syslog',
'error_bad_credentials' => 'Informations de connexion erronées',
'bruteforce_wait' => 'Trop de tentatives échouées, votre compte est bloqué jusqu'à : ',
+ 'bruteforce_unlock_at' => 'Déblocage du compte (anti bruteforce) : ',
+ 'bruteforce_reset_account' => 'Réinitialiser l'anti bruteforce de l'utilisateur',
+ 'bruteforce_reset_mail_subject' => 'TEAMPASS - Votre compte est désactivé',
+ 'bruteforce_reset_mail_body' => 'Bonjour #name#,
Votre compte teampass a été verouillé en raison d'un grand nombre d'échecs d'authentification.
Vous pouvez le débloquer en cliquant sur ce lien #reset_url#
Déblocage automatique : #unlock_at#',
'settings_ldap_usergroup' => 'Groupe LDAP dans lequel faire la recherche',
'settings_ldap_usergroup_tip' => 'Groupe LDAP dans lequel les utilisateurs doivent être membre pour pouvoir se connecter. Exemple : cn=sysadmins,ou=groups,dc=example,dc=com',
'server_password_change_enable' => 'Activer le changement automatique du mot de passe du compte du serveur (en utilisant une connexion SSH)',
@@ -1189,7 +1193,6 @@
'show_item_data_tip' => 'Permet d'afficher des informations supplémentaires dans la liste des éléments (nom d'utilisateur, e-mail et URL). Cela peut être utile pour avoir un aperçu rapide du contenu de l'élément.',
'items_page_split_view_mode' => 'Afficher le détail d'un objet sur la page des objets',
'replace_tenant_id' => 'Adapter l'url tout en laissant {tenant-id}. Il sera remplacer lors de l'appel.',
- 'user_exists_but_not_oauth2' => 'Vous devez vous authentifier avec votre compte Azure/Entra AD',
'user_not_allowed_to_auth_to_teampass_app' => 'Vous n'êtes pas autoriser à vous authentifier à l'application Teampass',
'user_is_not_auth_with_oauth2' => 'Vous ne pouvez pas vous authentifier avec un compte Entra/Azure AD',
'highlight_favorites' => 'Mettre en évidence les favoris',
diff --git a/includes/language/german.php b/includes/language/german.php
index a53a5cd46..d460cf735 100755
--- a/includes/language/german.php
+++ b/includes/language/german.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Zeigt zusätzliche Informationen in der Eintragsliste an (Benutzername, E-Mail, URL). Dies erlaubt einen schnellen Überblick über den Inhalt der Einträge.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/includes/language/greek.php b/includes/language/greek.php
index 07711acaa..6a94f056c 100755
--- a/includes/language/greek.php
+++ b/includes/language/greek.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/includes/language/hungarian.php b/includes/language/hungarian.php
index 0331904f6..eea0f226c 100755
--- a/includes/language/hungarian.php
+++ b/includes/language/hungarian.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/includes/language/italian.php b/includes/language/italian.php
index 151c2d130..388542f3c 100755
--- a/includes/language/italian.php
+++ b/includes/language/italian.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/includes/language/japanese.php b/includes/language/japanese.php
index 0529a7cc9..6750c6d64 100755
--- a/includes/language/japanese.php
+++ b/includes/language/japanese.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/includes/language/norwegian.php b/includes/language/norwegian.php
index 5f9ef5bc4..34c875587 100755
--- a/includes/language/norwegian.php
+++ b/includes/language/norwegian.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/includes/language/polish.php b/includes/language/polish.php
index 78e432d11..f283bd484 100755
--- a/includes/language/polish.php
+++ b/includes/language/polish.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/includes/language/portuguese.php b/includes/language/portuguese.php
index abea07d58..94671b22d 100755
--- a/includes/language/portuguese.php
+++ b/includes/language/portuguese.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/includes/language/portuguese_br.php b/includes/language/portuguese_br.php
index c47a7f13e..0a0edaba7 100755
--- a/includes/language/portuguese_br.php
+++ b/includes/language/portuguese_br.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/includes/language/romanian.php b/includes/language/romanian.php
index 469a87866..af8905072 100755
--- a/includes/language/romanian.php
+++ b/includes/language/romanian.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/includes/language/russian.php b/includes/language/russian.php
index 2d72730e8..897e11092 100755
--- a/includes/language/russian.php
+++ b/includes/language/russian.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/includes/language/spanish.php b/includes/language/spanish.php
index 993af2ae3..d4139ea21 100755
--- a/includes/language/spanish.php
+++ b/includes/language/spanish.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permite mostrar información adicional en la lista de elementos (nombre de usuario, correo electrónico y URL). Esto podría ser útil para tener una vista rápida del contenido del elemento.',
'items_page_split_view_mode' => 'Mostrar los detalles del elemento en modo de vista dividida de página',
'replace_tenant_id' => 'Adapte la URL pero mantenga {tenant-id} tal cual. Se reemplazará en vivo por el ID del inquilino.',
- 'user_exists_but_not_oauth2' => 'El usuario debe autenticarse utilizando Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'El usuario no tiene permitido autenticarse en la aplicación Teampass',
'user_is_not_auth_with_oauth2' => 'El usuario no debe autenticarse con Entra/Azure AD',
'highlight_favorites' => 'Resaltar favoritos',
diff --git a/includes/language/swedish.php b/includes/language/swedish.php
index 67a64668d..4943010dc 100755
--- a/includes/language/swedish.php
+++ b/includes/language/swedish.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/includes/language/turkish.php b/includes/language/turkish.php
index 1270f4658..54cf1a77f 100755
--- a/includes/language/turkish.php
+++ b/includes/language/turkish.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/includes/language/ukrainian.php b/includes/language/ukrainian.php
index 413d48b4b..7bd869593 100755
--- a/includes/language/ukrainian.php
+++ b/includes/language/ukrainian.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Дозволяє відображати додаткову інформацію у списку елементів (ім'я користувача, електронна пошта та URL). Це може бути корисно для швидкого перегляду вмісту елемента.',
'items_page_split_view_mode' => 'Показати деталі елемента у режимі розділеного перегляду сторінки',
'replace_tenant_id' => 'Адаптувати URL, але залишити {tenant-id} як є. Він буде замінений в реальному часі на ID орендаря.',
- 'user_exists_but_not_oauth2' => 'Користувач повинен автентифікуватися за допомогою Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'Користувачеві не дозволено автентифікуватися за допомогою додатку Teampass',
'user_is_not_auth_with_oauth2' => 'Користувач не повинен автентифікуватися за допомогою Entra/Azure AD',
'highlight_favorites' => 'Виділити обрані',
diff --git a/includes/language/vietnamese.php b/includes/language/vietnamese.php
index bcf5a19d9..950ae615d 100755
--- a/includes/language/vietnamese.php
+++ b/includes/language/vietnamese.php
@@ -1188,7 +1188,6 @@
'show_item_data_tip' => 'Permits to display extra information in the items list (username, email and url). This could be useful to have a quick view of the item content.',
'items_page_split_view_mode' => 'Show item details in page split view mode',
'replace_tenant_id' => 'Adapt the URL but keep {tenant-id} as is. It will be replaced live by the tenant ID.',
- 'user_exists_but_not_oauth2' => 'User has to authenticate using Entra/Azure AD',
'user_not_allowed_to_auth_to_teampass_app' => 'User is not allowed to authenticate with Teampass application',
'user_is_not_auth_with_oauth2' => 'User should not authenticate with Entra/Azure AD',
'highlight_favorites' => 'Highlight favorites',
diff --git a/index.php b/index.php
index d2da97719..9a920ebc8 100755
--- a/index.php
+++ b/index.php
@@ -92,6 +92,7 @@
// Quick major version check -> upgrade needed?
if (isset($SETTINGS['teampass_version']) === true && version_compare(TP_VERSION, $SETTINGS['teampass_version']) > 0) {
+ $session->invalidate();
// Perform redirection
if (headers_sent()) {
echo '';
diff --git a/install/install.queries.php b/install/install.queries.php
index fda222154..5358990ad 100755
--- a/install/install.queries.php
+++ b/install/install.queries.php
@@ -1470,6 +1470,7 @@ function encryptFollowingDefuse($message, $ascii_key)
`value` VARCHAR(500) NOT NULL,
`date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`unlock_at` TIMESTAMP NULL DEFAULT NULL,
+ `unlock_code` VARCHAR(50) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) CHARSET=utf8;"
);
diff --git a/install/upgrade_run_3.1.php b/install/upgrade_run_3.1.php
index 12cc11126..dba4be0af 100755
--- a/install/upgrade_run_3.1.php
+++ b/install/upgrade_run_3.1.php
@@ -626,10 +626,24 @@
`value` VARCHAR(500) NOT NULL,
`date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`unlock_at` TIMESTAMP NULL DEFAULT NULL,
+ `unlock_code` VARCHAR(50) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) CHARSET=utf8;"
);
+// Add unlock_code column
+try {
+ $alter_table_query = "
+ ALTER TABLE `" . $pre . "auth_failures`
+ ADD COLUMN `unlock_code` VARCHAR(50) NULL DEFAULT NULL;";
+ mysqli_begin_transaction($db_link);
+ mysqli_query($db_link, $alter_table_query);
+ mysqli_commit($db_link);
+} catch (Exception $e) {
+ // Rollback transaction if index already exists.
+ mysqli_rollback($db_link);
+}
+
//---' + percentage + '%';
- //console.log(message)
$('#onthefly-restore-progress-text').text(percentage);
}
@@ -314,13 +312,14 @@ function updateProgressBar(offset, totalSize) {
: $SETTINGS['upload_maxfilesize'];
?>
+ let toastrElement;
var restoreOperationId = '',
uploader_restoreDB = new plupload.Uploader({
runtimes: "gears,html5,flash,silverlight,browserplus",
browse_button: "onthefly-restore-file-select",
container: "onthefly-restore-file",
max_file_size: "",
- chunk_size: "5mb",
+ chunk_size: "2mb", // adapted to standard PHP configuration
unique_names: true,
dragdrop: true,
multiple_queues: false,
@@ -364,8 +363,7 @@ function(teampassUser) {
BeforeUpload: function(up, file) {
// Show cog
toastr.remove();
- toastr.info('get('loading_item'); ?> ... ');
- console.log("Upload token: "+store.get('teampassUser').uploadToken);
+ toastrElement = toastr.info('get('loading_item'); ?> ... 0%');
up.setOption('multipart_params', {
PHPSESSID: 'get('user-id'); ?>',
@@ -374,6 +372,10 @@ function(teampassUser) {
user_token: store.get('teampassUser').uploadToken
});
},
+ UploadProgress: function(up, file) {
+ // Update only the percentage inside the Toastr message
+ $('#plupload-progress').text(file.percent + '%');
+ },
UploadComplete: function(up, files) {
store.update(
'teampassUser',
diff --git a/pages/import.js.php b/pages/import.js.php
index 0ea5af7af..f1e76c725 100755
--- a/pages/import.js.php
+++ b/pages/import.js.php
@@ -142,21 +142,8 @@ function(teampassApplication) {
PHPSESSID: 'get('key'); ?>',
type_upload: "import_items_from_csv",
user_token: data[0].token
- /*itemId: store.get('teampassItem').id,
- type_upload: 'item_attachments',
- isNewItem: store.get('teampassItem').isNewItem,
- isPersonal: store.get('teampassItem').folderIsPersonal,
- edit_item: false,
- user_upload_token: store.get('teampassApplication').attachmentToken,
- randomId: store.get('teampassApplication').uploadedFileId,
- files_number: $('#form-item-hidden-pickFilesNumber').val(),
- file_size: file.size*/
});
- /*up.settings.multipart_params.PHPSESSID = "";
- up.settings.multipart_params.type_upload = "import_items_from_csv";
- up.settings.multipart_params.user_token = data[0].token;*/
-
up.start();
},
"json"
diff --git a/pages/items.js.php b/pages/items.js.php
index 1fbd56a72..213df1bf4 100755
--- a/pages/items.js.php
+++ b/pages/items.js.php
@@ -383,14 +383,13 @@ function(teampassApplication) {
$(document).on('click', '#card-item-pwd-show-button', function() {
if ($(this).hasClass('pwd-shown') === false) {
$(this).addClass('pwd-shown');
- // Prepare data to show
- // Is data crypted?
- var data = unCryptData($('#hidden-item-pwd').val(), 'get('key'); ?>');
- if (data !== false && data !== undefined) {
- $('#hidden-item-pwd').val(
- data.password
- );
- }
+
+ // Get item password from server
+ const item_pwd = getItemPassword(
+ 'at_password_shown',
+ 'item_id',
+ store.get('teampassItem').id
+ );
// Change class and show spinner
$('.pwd-show-spinner')
@@ -399,16 +398,9 @@ function(teampassApplication) {
// display raw password
$('#card-item-pwd')
- .text($('#hidden-item-pwd').val())
+ .text(item_pwd)
.addClass('pointer_none');
- // log password is shown
- itemLog(
- 'at_password_shown',
- store.get('teampassItem').id,
- $('#card-item-label').text()
- );
-
// Autohide
setTimeout(() => {
$(this).removeClass('pwd-shown');
@@ -427,6 +419,22 @@ function(teampassApplication) {
// Manage folders action
$('.tp-action').click(function() {
+ // Ensure that the local storage data is consistent with what is
+ // displayed on the screen.
+ const item_dom_id = parseInt($('#items-details-container').data('id'));
+ const item_storage_id = parseInt(store.get('teampassItem').id);
+ if (item_dom_id !== item_storage_id) {
+ toastr.remove();
+ toastr.error(
+ 'get('data_inconsistency'); ?>',
+ '', {
+ timeOut: 5000,
+ progressBar: true
+ }
+ );
+ return false;
+ }
+
// SHow user
toastr.remove();
toastr.info('get('in_progress'); ?>');
@@ -766,6 +774,7 @@ function(teampassItem) {
// > END <
//
} else if ($(this).data('item-action') === 'edit') {
+ const item_tree_id = store.get('teampassItem').tree_id;
if (debugJavascript === true) console.info('SHOW EDIT ITEM');
// Reset item
store.update(
@@ -790,7 +799,7 @@ function(teampassItem) {
}
$.when(
- getPrivilegesOnItem(selectedFolderId, 1)
+ getPrivilegesOnItem(item_tree_id, 1)
).then(function(retData) {
console.log('getPrivilegesOnItem 2')
console.log(retData)
@@ -838,7 +847,7 @@ function(teampassItem) {
$('#form-item').removeClass('was-validated');
// Now manage edtion
- showItemEditForm(selectedFolderId);
+ showItemEditForm(item_tree_id);
});
//
@@ -2581,34 +2590,24 @@ function(ret) {
mouseStillDown = false;
showPwdContinuous();
});
- var showPwdContinuous = function() {
- if (mouseStillDown === true) {
- // Prepare data to show
- // Is data crypted?
- var data = unCryptData($('#hidden-item-pwd').val(), 'get('key'); ?>');
- if (data !== false && data !== undefined) {
- $('#hidden-item-pwd').val(
- data.password
- );
- }
- $('#card-item-pwd')
- .html(
- // XSS Filtering
- $('').text($('#hidden-item-pwd').val()).html()
- );
+ const showPwdContinuous = function() {
+ if (mouseStillDown === true
+ && !$('#card-item-pwd').hasClass('pwd-shown')) {
+
+ // Get item password from server
+ const item_pwd = getItemPassword(
+ 'at_password_shown',
+ 'item_id',
+ store.get('teampassItem').id
+ );
+ $('#card-item-pwd').text(item_pwd);
+ $('#card-item-pwd').addClass('pwd-shown');
+
+ // Auto hide password
setTimeout('showPwdContinuous("card-item-pwd")', 50);
- // log password is shown
- if ($('#card-item-pwd').hasClass('pwd-shown') === false) {
- itemLog(
- 'at_password_shown',
- store.get('teampassItem').id,
- $('#card-item-label').text()
- );
- $('#card-item-pwd').addClass('pwd-shown');
- }
- } else {
+ } else if(mouseStillDown !== true) {
$('#card-item-pwd')
.html('')
.removeClass('pwd-shown');
@@ -2760,6 +2759,8 @@ function(ret) {
var mime_types = ;
var prevent_empty = ;
var resize = ;
+ let toastrElement;
+ let fileId;
var uploader_attachments = new plupload.Uploader({
runtimes: 'html5,flash,silverlight,html4',
@@ -2778,12 +2779,11 @@ function(ret) {
resize: resize,
init: {
BeforeUpload: function(up, file) {
- toastr.info(
- 'get('uploading'); ?>',
- '', {
- timeOut: 0
- }
- );
+ fileId = file.id;
+ toastr.remove();
+ toastrElement = toastr.info('get('loading_item'); ?> ... 0%');
+ // Show file name
+ $('#upload-file_' + file.id).html('' + htmlEncode(file.name) + '');
// Get random number
if (store.get('teampassApplication').uploadedFileId === '') {
@@ -2807,17 +2807,23 @@ function(teampassApplication) {
files_number: $('#form-item-hidden-pickFilesNumber').val(),
file_size: file.size
});
+ },
+ UploadProgress: function(up, file) {
+ // Update only the percentage inside the Toastr message
+ $('#plupload-progress').text(file.percent + '%');
+ },
+ UploadComplete: function(up, files) {
+ // Inform user
+ toastr.remove();
+ },
+ Error: function(up, args) {
+ console.log("ERROR arguments:");
+ console.log(args);
}
}
});
- // Uploader options
- uploader_attachments.bind('UploadProgress', function(up, file) {
- //console.log('uploader_attachments.bind')
- $('#upload-file_' + file.id).html('' + htmlEncode(file.name) + '');
- });
uploader_attachments.bind('FileUploaded', function(up, file) {
- //console.log('File '+file.name+' uploaded');
$('#fileStatus_'+file.id).html('');
userUploadedFile = true;
userDidAChange = true;
@@ -2825,15 +2831,39 @@ function(teampassApplication) {
});
uploader_attachments.bind('Error', function(up, err) {
toastr.remove();
- toastr.error(
- err.message + (err.file ? ', File: ' + err.file.name : ''),
- '', {
- timeOut: 5000,
- progressBar: true
+ // Extraire le message d'erreur
+ let errorMessage = 'An unknown error occurred.';
+ if (err.response) {
+ try {
+ const response = JSON.parse(err.response);
+ if (response.error && response.error.message) {
+ errorMessage = response.error.message;
+ }
+ } catch (e) {
+ errorMessage = err.response; // Si la réponse n'est pas JSON
}
- );
+ }
- up.refresh(); // Reposition Flash/Silverlight
+ // Vérifie si l'erreur est due à un dépassement de taille ou une autre erreur critique
+ if (err.code === -200 || err.status === 413) {
+ // Arrêter l'upload des chunks
+ up.stop();
+ errorMessage += ' - Upload stopped.';
+
+ // Affiche l'erreur dans l'interface utilisateur
+ toastr.error(
+ errorMessage + (err.file ? ', File: ' + err.file.name : ''),
+ '', {
+ timeOut: 10000,
+ progressBar: true
+ }
+ );
+
+ $('#fileStatus_'+fileId).html('');
+ return false;
+ } else {
+ up.refresh(); // Reposition Flash/Silverlight
+ }
});
$("#form-item-upload-pickfiles").click(function(e) {
@@ -3380,6 +3410,14 @@ function(teampassItem) {
}
);
} else {
+ // Get password and fill the field.
+ const item_pwd = getItemPassword(
+ 'at_password_shown_edit_form',
+ 'item_id',
+ store.get('teampassItem').id
+ );
+ $('#form-item-password').val(item_pwd);
+
$('#card-item-visibility').html(store.get('teampassItem').itemVisibility);
$('#card-item-minimum-complexity').html(store.get('teampassItem').itemMinimumComplexity);
@@ -3980,57 +4018,18 @@ function(teampassItem) {
// Send query and get password
var result = '',
error = false;
-
- $.ajax({
- type: "POST",
- async: false,
- url: 'sources/items.queries.php',
- data: 'type=show_item_password&item_key=' + trigger.getAttribute('data-item-key') +
- '&key=get('key'); ?>',
- dataType: "",
- success: function(data) {
- //decrypt data
- try {
- data = prepareExchangedData(data, "decode", "get('key'); ?>");
- } catch (e) {
- // error
- toastr.remove();
- toastr.warning(
- 'get('no_item_to_display'); ?>'
- );
- return false;
- }
- if (data.error === true) {
- error = true;
- } else {
- if (data.password_error !== '') {
- error = true;
- } else {
- result = simplePurifier(atob(data.password), false, false, false, false).utf8Decode();
- }
- if (result === '') {
- toastr.info(
- 'get('password_is_empty'); ?>',
- '', {
- timeOut: 2000,
- positionClass: 'toast-bottom-right',
- progressBar: true
- }
- );
- }
- }
- }
- });
- return result;
+
+ // Get item password from server
+ const item_pwd = getItemPassword(
+ 'at_password_copied',
+ 'item_key',
+ trigger.getAttribute('data-item-key')
+ );
+
+ return item_pwd;
}
});
- clipboardForPassword.on('success', function(e) {
- itemLog(
- 'at_password_copied',
- e.trigger.dataset.itemId,
- e.trigger.dataset.itemLabel
- );
-
+ clipboardForPassword.on('success', function(e) {
// Warn user about clipboard clear
if (store.get('teampassSettings').clipboard_life_duration === undefined || parseInt(store.get('teampassSettings').clipboard_life_duration) === 0) {
toastr.remove();
@@ -4338,10 +4337,10 @@ function(teampassApplication) {
// Show user that password is badly encrypted
(value.pw_status === 'encryption_error' ? '' : '') +
// Prepare item info
+ '' +
'' +
// Show item fa_icon if set
(value.fa_icon !== '' ? '' : '') +
- '' +
'' + value.label + '' + (value.rights === 10 ? '' : description) +
'' +
'' +
@@ -4834,16 +4833,12 @@ function(teampassUser) {
$('#card-item-pwd').after('');
}
- // Uncrypt the pwd
- if (data.pw !== undefined) {
- data.pw = simplePurifier(atob(data.pw), false, false, false, false).utf8Decode();
- }
-
// Update hidden variables
store.update(
'teampassItem',
function(teampassItem) {
teampassItem.id = parseInt(data.id),
+ teampassItem.tree_id = parseInt(data.folder),
teampassItem.folderId = parseInt(data.folder),
teampassItem.timestamp = data.timestamp,
teampassItem.user_can_modify = data.user_can_modify,
@@ -4901,7 +4896,11 @@ function(teampassItem) {
$('.form-item').removeClass('hidden');
$('#folders-tree-card').addClass('hidden');
}
- $('#pwd-definition-size').val(data.pw.length);
+ $('#pwd-definition-size').val(data.pw_length);
+
+ // Store current item id in the DOM (cannot be updated in
+ // an other tab or window)
+ $('#items-details-container').data('id', data.id);
// Prepare card
const itemIcon = (data.fa_icon !== "") ? '' : '';
@@ -4914,8 +4913,6 @@ function(teampassItem) {
$('#card-item-description').removeClass('hidden');
}
$('#card-item-pwd').html('');
- $('#hidden-item-pwd, #form-item-suggestion-password').val(data.pw);
- $('#form-item-password, #form-item-password-confirmation, #form-item-server-old-password').val(data.pw);
$('#card-item-login').html(data.login);
$('#form-item-login, #form-item-suggestion-login, #form-item-server-login').val(data.login);
@@ -5179,7 +5176,7 @@ function(teampassItem) {
}
// Prepare clipboard - COPY PASSWORD
- if (data.pw !== '' && store.get('teampassItem').readyToUse === true) {
+ if (data.pw_length > 0 && store.get('teampassItem').readyToUse === true) {
// Delete existing clipboard
if (clipboardForPasswordListItems) {
clipboardForPasswordListItems.destroy();
@@ -5187,16 +5184,17 @@ function(teampassItem) {
// New clipboard
clipboardForPasswordListItems = new ClipboardJS('#card-item-pwd-button', {
text: function() {
- return (data.pw);
+ // Get item password from server
+ const item_pwd = getItemPassword(
+ 'at_password_copied',
+ 'item_id',
+ data.id
+ );
+
+ return item_pwd;
}
})
.on('success', function(e) {
- itemLog(
- 'at_password_copied',
- store.get('teampassItem').id,
- $('#card-item-label').text()
- );
-
// Warn user about clipboard clear
if (store.get('teampassSettings').clipboard_life_duration === undefined || parseInt(store.get('teampassSettings').clipboard_life_duration) === 0) {
toastr.remove();
@@ -6427,10 +6425,6 @@ function(data) {
);
});
- $('#item-button-password-copy').click(function() {
- $('#form-item-password-confirmation').val($('#form-item-password').val());
- });
-
/**
* On tag badge click, launch the search query
*/
diff --git a/pages/profile.js.php b/pages/profile.js.php
index 158a8f67c..1309ccb5b 100755
--- a/pages/profile.js.php
+++ b/pages/profile.js.php
@@ -567,11 +567,20 @@ function(data) {
event.preventDefault();
$('#dialog-recovery-keys-download').removeClass('hidden');
+ // Default text on dialog box
+ let dialog_content = 'get('download_recovery_keys_confirmation'); ?>'
+
+ // Request authentication on local and ldap accounts
+ if (store.get('teampassUser').auth_type !== 'oauth2') {
+ dialog_content += '