CVE-2023-1070 (published 2023-02-27T16:15Z)

External Control of File Name or Path in GitHub repository nilsteampassnet/teampass prior to 3.0.0.22.

CVSS v3 base score: 7.1, HIGH (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:H)

Weakness information:
cwe_id: CWE-73
cwe_name: External Control of File Name or Path
description: The product allows user input to control or influence paths or file names that are used in filesystem operations.
extended_description: 
            This could allow an attacker to access or modify system files or other files that are critical to the application.
            Path manipulation errors occur when the following two conditions are met:
            
               1. An attacker can specify a path used in an operation on the filesystem.
               2. By specifying the resource, the attacker gains a capability that would not otherwise be permitted.
            
            For example, the program may give the attacker the ability to overwrite the specified file or run with a configuration controlled by the attacker.
         
         

Fix information:
repo_url: https://github.com/nilsteampassnet/teampass
commit_details: repo_url: https://github.com/nilsteampassnet/teampass
author: nilsteampassnet
author_date: 2023-02-14 08:01:35+01:00
msg: 3.0.0.23

Fix for #3520
Fix vulnerability related to teampass-seckey.txt file
repository: repo_url: https://github.com/nilsteampassnet/teampass
repo_name: nilsteampassnet/TeamPass
description: Collaborative Passwords Manager
repo_language: PHP
owner: nilsteampassnet
file_changes: filename: ItemModel.php
change_type: ModificationType.MODIFY
diff: @@ -77,7 +77,7 @@ class ItemModel extends Database
                 if (empty($path) === true) {
                     $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
                 } else {
-                    $path .= '>' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
+                    $path .= '/' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
                 }
             }
 

programming_language: PHP
filename: include.php
change_type: ModificationType.MODIFY
diff: @@ -12,12 +12,12 @@
  * @copyright 2009-2022 Nils Laumaillé
  * @license   https://spdx.org/licenses/GPL-3.0-only.html#licenseText GPL-3.0
  *
- * @version   3.0.0.22
+ * @version   3.0.0.23
  *
  * @see      http://www.teampass.net
  */
 define('TP_VERSION', '3.0.0');
-define('TP_VERSION_FULL', TP_VERSION.'.22');
+define('TP_VERSION_FULL', TP_VERSION.'.23');
 define('TP_TOOL_NAME', 'Teampass');
 define('TP_ONE_DAY_SECONDS', 86400);
 define('TP_ONE_WEEK_SECONDS', 604800);

programming_language: PHP
filename: load.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      load.js.php
  * ---
  *

programming_language: PHP
filename: login.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      login.js.php
  * ---
  *

programming_language: PHP
filename: login.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      login.php
  * ---
  *

programming_language: PHP
filename: logout.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      logout.php
  * ---
  *

programming_language: PHP
filename: otv.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      otv.php
  * ---
  *

programming_language: PHP
filename: arabic.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      arabic.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: bulgarian.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      bulgarian.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: catalan.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      catalan.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: chinese.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      chinese.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: czech.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      czech.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: dutch.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      dutch.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: english.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      english.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)
@@ -517,7 +517,7 @@ return array(
     'api_whitelist_ips' => 'API IPs Whitelist',
     'api_whitelist_ips_tip' => 'If no API client IP addresses are explicitly listed here, then any IP address is authorized.',
     'email_share_item_subject' => 'A password item was shared with you',
-    'email_share_item_mail' => 'Hello,<br><br>This is a generated email from Teampass passwords manager.<br><br>#tp_user# has shared with you the password item #tp_item#.<br><br><a href=\'#tp_link#\'>Click this link</a> to access the item.<br><br><br>Greetings',
+    'email_share_item_mail' => 'Hello,<br><br>This is a generated email from Teampass passwords manager.<br><br>#tp_user# has shared with you the password item #tp_item#.<br><br><a href="#tp_link#">Click this link</a> to access the item.<br><br><br>Greetings',
     'index_maintenance_mode_admin' => 'Maintenance mode is enabled. Users cannot sign in.',
     '2fa_authentication_selector' => 'Select a 2 factor authentication method',
     'upload_empty_file' => 'Upload empty file',

programming_language: PHP
filename: estonian.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      estonian.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: french.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      french.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: german.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      german.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: greek.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      greek.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: hungarian.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      hungarian.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: italian.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      italian.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: japanese.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      japanese.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: norwegian.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      norwegian.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: polish.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      polish.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: portuguese.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      portuguese.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)
@@ -65,14 +65,14 @@ return array(
     'settings_ldap_hosts_tip' => 'The hosts option is an array of IP addresses or host names located on your network that serve an LDAP directory (seprated by a comma). You insert as many servers or as little as you would like depending on your forest (with the minimum of one of course).',
     'base_distiguished_name' => 'Base DN',
     'settings_ldap_bdn_tip' => 'The root distinguished name (DN) to use when running queries against the directory server. Examples: o=example,c=com ; cn=users,dc=ad,dc=example,dc=com',
-    'username' => 'Username',
+    'username' => 'Utilizador',
     'settings_ldap_username_tip' => 'The distinguished name of the user that the application will use when connecting to the directory server. Examples: cn=administrator,cn=users,dc=ad,dc=example,dc=com ; cn=user,dc=domain,dc=name',
-    'settings_ldap_password_tip' => 'The password of the user specified above.',
+    'settings_ldap_password_tip' => 'A palavra-passe do utilizador especificado acima.',
     'settings_ldap_port_tip' => 'Default non secure LDAP port: 389, default secure LDAP port: 636',
-    'undefined' => 'Undefined',
-    'error_cannot_open_file' => 'File cannot be opened',
+    'undefined' => 'Indefinido',
+    'error_cannot_open_file' => 'O ficheiro não pode ser aberto',
     'provide_current_psk_and_click_launch' => 'When ready, click button Launch',
-    'start' => 'Start',
+    'start' => 'Iniciar',
     'data_inconsistency' => 'Data inconsistency found. Please reload the page!',
     'one_time_code_expected' => 'One-Time-Code expected',
     'data_are_missing' => 'Expected data are missing',
@@ -83,13 +83,13 @@ return array(
     'ldap_user_password_is_used_for_authentication' => 'User password in LDAP is used for authentication',
     'local_user_password_is_used_for_authentication' => 'User password in Teampass is used for authentication',
     'provide_your_current_password' => 'Provide your current password',
-    'current_password' => 'Current password',
-    'password_is_not_correct' => 'This password is not correct',
+    'current_password' => 'Palavra-passe atual',
+    'password_is_not_correct' => 'Esta palavra-passe não é a correta',
     'ldap_password_change_warning' => 'Your login password has changed since last connection. It is requested to re-encrypt all the keys using this new password. For this operation, please fill in the next field with your previous ldap password. The operation can take several minutes.',
-    'personal_items' => 'Personal items',
+    'personal_items' => 'Itens pessoais',
     'logout_on_going' => 'You will now be logout. Use your new password for being connected from now.',
     'fill_in_fields_and_hit_launch' => 'Provide expected data and hit Launch button',
-    'please_select_a_folder' => 'Please select a folder',
+    'please_select_a_folder' => 'Por favor seleccione uma pasta',
     'user_must_have_login_and_email' => 'User must have a login and an email',
     'user_has_this_role_in_teampass' => 'O utilizador tem esta função no Teampass',
     'select_role_to_create' => 'Seleccione função a criar',
@@ -101,14 +101,14 @@ return array(
     'remove_install_folder' => 'Install folder has to be removed',
     'list_users' => 'List users',
     'ldap_synchronization' => 'LDAP synchronization',
-    'in_progress' => 'In progress',
+    'in_progress' => 'Em progresso',
     'clipboard_password_life_duration' => 'Delay before the clipboard is cleared (in seconds)',
     'clipboard_password_life_duration_tip' => 'Permits to define a delay in seconds before which the password copied in clipboard will be cleared from the browser clipboard. Set to 0 to disable.',
     'clipboard_will_be_cleared' => 'Password is now in clipboard. It will soon be cleared...',
     'file_folder_not_accessible' => 'Files folder is not accessible',
     'error_missing_id' => 'An error occurred. Missing ID ... ?',
     'error_folder_not_allowed' => 'Selected folder is not allowed',
-    'all_fields_mandatory' => 'All fields are mandatory',
+    'all_fields_mandatory' => 'Todos os campos são obrigatórios',
     'history_insert_entry' => 'Insert in History',
     'clear_form' => 'Clear form',
     'info_about_history_insertion' => 'Caution - This feature permits you to insert manually an event in the item history log. Once added it will not be possible to remove it. Also notice that your account id will be associated to this new entry.',
@@ -126,14 +126,14 @@ return array(
     'password_overview_delay_tip' => 'This setting permits to define the number of seconds the clear password will be displayed to the user.',
     'select_date_showing_items_expiration' => 'List the expired items at date',
     'renewal_page_info' => 'This page permits to identify the items currently expired or expiring in next period.',
-    'filename' => 'Filename',
-    'exported_to_file' => 'Exported to file',
-    'operation_progress' => 'Operation is in progress',
-    'exporting_items' => 'Exporting items',
-    'select_folders_to_export' => 'Select folders to export',
-    'export_format_type' => 'Select the export format type',
-    'export_items' => 'Export items',
-    'loading_item' => 'Loading item',
+    'filename' => 'Nome do ficheiro',
+    'exported_to_file' => 'Exportado para ficheiro',
+    'operation_progress' => 'A operação está em progresso',
+    'exporting_items' => 'A exportar itens',
+    'select_folders_to_export' => 'Seleccione pastas para exportar',
+    'export_format_type' => 'Seleccione o formato de exportação',
+    'export_items' => 'Exportar itens',
+    'loading_item' => 'A carregar item',
     'otv_message' => 'You can share this item with someone without a Teampass account. One-Time-View permits your guest to access basic fields of this item only once without being authenticated in Teampass. Please notice that this link is valid for a period of ##otv_expiration_period##  days. Copy and share the link below.',
     'no_sharekey_found' => 'No key found for this file and your account',
     'otv_link' => 'One-time-view link',
@@ -499,7 +499,7 @@ return array(
     'server_time' => 'Server time',
     'settings_tree_counters' => 'Show more counters in folder tree',
     'settings_tree_counters_tip' => 'Enabling shows three numbers next to each folder: number of items in base folder; number of items including subfolders; number of subfolders. Enabling this feature may slow loading of the folder tree pane.',
-    'admin_action_check_pf' => 'Criar pastas pessoas para todos os utilizadores que não têm',
+    'admin_action_check_pf' => 'Criar pastas pessoas para todos os utilizadores que não as têm',
     'enable_personal_folder_feature_tip' => 'Personal folders are a private location for individual user passwords. Password items are encrypted by a user\'s salt key (more secure) or by their password (easier). Enabling this feature does not create the actual folders for existing users - you must also run the create personal folders task.',
     'administrators_only' => 'Administrators only',
     'managers_of' => 'Gestores da função',
@@ -724,7 +724,7 @@ return array(
     'level' => 'Nivel',
     'login' => 'Login (se necessário)',
     'mask_pw' => 'Oculta/Mostra a senha',
-    'max_last_items' => 'Maximo de últimos itens visto por um usuários (Padrão é 10)',
+    'max_last_items' => 'Tamanho da lista dos últimos itens vistos (padrão é 10)',
     'minutes' => 'minutos',
     'name' => 'Nome',
     'nb_false_login_attempts' => 'Número de tentativas de login sem sucesso para bloquear a conta (0 é desativado)',
@@ -737,14 +737,14 @@ return array(
     'not_allowed_to_see_pw' => 'Você não esta autorizado a ver este item!',
     'not_allowed_to_see_pw_is_expired' => 'Este item esta expirado',
     'not_defined' => 'Não definido',
-    'number_of_used_pw' => 'Número de novas senhas que o usuário precisa ingressar antes de usar uma senha antiga',
+    'number_of_used_pw' => 'Número de palavras-passe antigas guardadas para evitar reutilização (0 para desativar)',
     'pages' => 'Paginas',
     'pdf_download' => 'Dowload do arquivo',
     'personal_salt_key' => 'Sua senha pessoal \'SALT KEY\'',
     'pw' => 'Senha',
     'pw_generate' => 'Gera',
     'pw_is_expired_-_update_it' => 'Este item expirou! Precisa alterar a senha.',
-    'pw_life_duration' => 'Vida útil da senha de um usuário para expirar (em dia, 0 para desativar)',
+    'pw_life_duration' => 'Palavras-passe de sessão expiram ao fim de xx dias (0 para desativar)',
     'readme_open' => 'Abrir o arquivo README completo',
     'read_only_account' => 'Somente Leitura',
     'restore' => 'Recuperar',
@@ -767,7 +767,7 @@ return array(
     'settings_ldap_ssl' => 'Usar SSL (LDAPS)',
     'settings_ldap_tls' => 'Use LDAP a traves de TLS',
     'settings_log_accessed' => 'Ativa registros de quem acessou aos itens',
-    'settings_log_connections' => 'Guarda todos os inícios de sessão',
+    'settings_log_connections' => 'Guarda registo de todos os inícios de sessão',
     'settings_maintenance_mode' => 'Coloca TeamPass em modo de manutenção',
     'settings_manager_edit' => 'Os Gerenciadores podem editar e apagar itens que estão autorizados a ver',
     'settings_printing' => 'Habilita a opção de imprimir arquivos PDF',

programming_language: PHP
filename: portuguese_br.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      portuguese_br.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: Perl
filename: romanian.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      romanian.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: russian.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      russian.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: spanish.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      spanish.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)
@@ -447,7 +447,7 @@ return array(
     'api_whitelist_ips' => 'Lista blanca de IPs de la API',
     'api_whitelist_ips_tip' => 'Si no hay direcciones IP de clientes de la API enumeradas explícitamente aquí, cualquier dirección IP está autorizada.',
     'email_share_item_subject' => '[TeamPass] Un elemento ha sido compartido con usted',
-    'email_share_item_mail' => 'Hola,&lt;br&gt;&lt;br&gt;&lt;u&gt;#tp_user#&lt;/u&gt; ha compartido con usted el elemento &lt;b&gt;#tp_item#&lt;/b&gt;&lt;br&gt;Pulse &lt;a href=\'#tp_link#\'&gt;aquí&lt;/a&gt; para acceder.&lt;br&gt;&lt;br&gt;Saludos.',
+    'email_share_item_mail' => 'Hola,&lt;br&gt;&lt;br&gt;&lt;u&gt;#tp_user#&lt;/u&gt; ha compartido con usted el elemento &lt;b&gt;#tp_item#&lt;/b&gt;&lt;br&gt;Pulse &lt;a href="#tp_link#"&gt;aquí&lt;/a&gt; para acceder.&lt;br&gt;&lt;br&gt;Saludos.',
     'index_maintenance_mode_admin' => 'Modo de mantenimiento activado. En este momento los usuarios no pueden acceder a TeamPass.',
     '2fa_authentication_selector' => 'Select a 2 factor authenticator method',
     'upload_empty_file' => 'Upload empty file',

programming_language: PHP
filename: swedish.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      swedish.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)
@@ -447,7 +447,7 @@ return array(
     'api_whitelist_ips' => 'API IPs Whitelist',
     'api_whitelist_ips_tip' => 'If no API client IP addresses are explicitly listed here, then any IP address is authorized.',
     'email_share_item_subject' => 'A password item was shared with you',
-    'email_share_item_mail' => 'Hello,<br><br>This is a generated email from Teampass passwords manager.<br><br>#tp_user# has shared with you the password item #tp_item#.<br><br><a href=\'#tp_link#\'>Click this link</a> to access the item.<br><br><br>Greetings',
+    'email_share_item_mail' => 'Hello,<br><br>This is a generated email from Teampass passwords manager.<br><br>#tp_user# has shared with you the password item #tp_item#.<br><br><a href="#tp_link#">Click this link</a> to access the item.<br><br><br>Greetings',
     'index_maintenance_mode_admin' => 'Maintenance mode is enabled. Users cannot sign in.',
     '2fa_authentication_selector' => 'Select a 2 factor authentication method',
     'upload_empty_file' => 'Upload empty file',

programming_language: PHP
filename: turkish.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      turkish.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: ukrainian.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      ukrainian.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: vietnamese.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      vietnamese.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: index.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      index.php
  * ---
  *

programming_language: PHP
filename: install.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      install.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)
@@ -287,7 +287,7 @@ define('MIN_PHP_VERSION', 7.4);
 						<label>Absolute path to SaltKey</label>
 						<input type="text" class="form-control" name="sk_path" id="sk_path" class="ui-widget" value=""><span id="res4_check2"></span>
 						<small class="form-text text-muted">
-							The SaltKey is stored in a file called teampass-seckey.txt. For security reasons, this file should be stored in a folder outside the WWW folder of your server (example: /var/teampass/). This key will be used to encrypt data when sharing information with users without any Teampass account. If this field remains empty, this file will be stored in folder <path to Teampass>/includes/.
+							The SaltKey is stored in a file called teampass-seckey.txt and hashed for security purpose. For security reasons, this file should be stored in a folder outside the WWW folder of your server (example: /var/teampass/). This key will be used to encrypt data when sharing information with users without any Teampass account. If this field remains empty, this file will be stored in folder <path to Teampass>/includes/.
 						</small>
 					</div>
 		

programming_language: PHP
filename: install.queries.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      install.queries.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)
@@ -1350,7 +1350,8 @@ $SETTINGS = array (';
                 if ($task === 'settings.php') {
                     // first is to create teampass-seckey.txt
                     // 0- check if exists
-                    $filename_seckey = $securePath . '/teampass-seckey.txt';
+                    define('SECUREFILE', generateRandomKey(25));
+                    $filename_seckey = $securePath . '/' . SECUREFILE;
 
                     if (file_exists($filename_seckey)) {
                         if (!copy($filename_seckey, $filename_seckey . '.' . date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))))) {
@@ -1424,6 +1425,7 @@ define("DB_CONNECT_OPTIONS", array(
     MYSQLI_OPT_CONNECT_TIMEOUT => 10
 ));
 define("SECUREPATH", "' . $securePath . '");
+define("SECUREFILE", "' . SECUREFILE. '");
 
 if (isset($_SESSION[\'settings\'][\'timezone\']) === true) {
     date_default_timezone_set($_SESSION[\'settings\'][\'timezone\']);

programming_language: PHP
filename: migrate_users_to_v3.php
change_type: ModificationType.MODIFY
diff: @@ -8,7 +8,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      migrate_users_to_v3.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: tp.functions.php
change_type: ModificationType.MODIFY
diff: @@ -1,5 +1,91 @@
 <?php
 
+// new SECUREFILE - 3.0.0.23
+function handleSecurefileConstant()
+{
+    if (defined('SECUREFILE') === false) {
+        define('SECUREFILE', generateRandomKey(25));
+        
+        // manage the file itself by renaming it
+        if (rename(SECUREPATH.'/teampass-seckey.txt', SECUREPATH.'/'.SECUREFILE) === false) {
+            echo '[{
+                "error" : "File `'.SECUREPATH.'/teampass-seckey.txt` could not be renamed. Please do it by yourself and click on button Launch.",
+                "index" : ""
+            }]';
+            exit;
+        }
+
+        // Ensure DB is read as UTF8
+        if (defined('DB_ENCODING') === false) {
+            define('DB_ENCODING', "utf8");
+        }
+
+        // Now create new file
+        $file_handled = fopen('../includes/config/settings.php', 'w');
+        
+        $settingsTxt = '<?php
+// DATABASE connexion parameters
+define("DB_HOST", "' . DB_HOST . '");
+define("DB_USER", "' . DB_USER . '");
+define("DB_PASSWD", "' . DB_PASSWD . '");
+define("DB_NAME", "' . DB_NAME . '");
+define("DB_PREFIX", "' . DB_PREFIX . '");
+define("DB_PORT", "' . DB_PORT . '");
+define("DB_ENCODING", "' . DB_ENCODING . '");
+define("DB_SSL", array(
+    "key" => "'.DB_SSL['key'].'",
+    "cert" => "'.DB_SSL['cert'].'",
+    "ca_cert" => ""'.DB_SSL['ca_cert'].',
+    "ca_path" => "'.DB_SSL['ca_path'].'",
+    "cipher" => "'.DB_SSL['cipher'].'"
+));
+define("DB_CONNECT_OPTIONS", array(
+    MYSQLI_OPT_CONNECT_TIMEOUT => 10
+));
+define("SECUREPATH", "' . str_replace('\\', '\\\\', SECUREPATH) . '");
+define("SECUREFILE", "' . SECUREFILE. '");';
+
+        if (defined('IKEY') === true) $settingsTxt .= '
+define("IKEY", "' . IKEY . '");';
+        else $settingsTxt .= '
+define("IKEY", "");';
+        if (defined('SKEY') === true) $settingsTxt .= '
+define("SKEY", "' . SKEY . '");';
+        else $settingsTxt .= '
+define("SKEY", "");';
+        if (defined('HOST') === true) $settingsTxt .= '
+define("HOST", "' . HOST . '");';
+        else $settingsTxt .= '
+define("HOST", "");';
+
+
+        $settingsTxt .= '
+
+if (isset($_SESSION[\'settings\'][\'timezone\']) === true) {
+    date_default_timezone_set($_SESSION[\'settings\'][\'timezone\']);
+}
+';
+
+        $fileCreation = fwrite(
+            $file_handled,
+            utf8_encode($settingsTxt)
+        );
+
+        fclose($file_handled);
+        sleep(3);
+        if ($fileCreation === false) {
+            return [
+                'error' => true,
+                'message' => 'Setting.php file could not be created in /includes/config/ folder. Please check the path and the rights.',
+            ];
+        }
+
+        return [
+            'error' => false,
+            'message' => ''
+        ];
+    }
+}
 
 /**
  * Undocumented function
@@ -37,7 +123,8 @@ function defuseCryption($message, $ascii_key, $type)
     // init
     $err = '';
     if (empty($ascii_key) === true) {
-        $ascii_key = file_get_contents(SECUREPATH.'/teampass-seckey.txt');
+        // new check - 3.0.0.23
+        $ascii_key = file_get_contents(SECUREPATH.'/'.SECUREFILE);
     }
     
     // convert KEY

programming_language: PHP
filename: upgrade.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      upgrade.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: upgrade_ajax.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      upgrade_ajax.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)
@@ -175,6 +175,7 @@ define("DB_CONNECT_OPTIONS", array(
     MYSQLI_OPT_CONNECT_TIMEOUT => 10
 ));
 define("SECUREPATH", "' . str_replace('\\', '\\\\', SECUREPATH) . '");';
+define("SECUREFILE", "' . SECUREFILE. '");
 
 		if (defined('IKEY') === true) $settingsTxt .= '
 define("IKEY", "' . IKEY . '");';
@@ -221,6 +222,7 @@ if (isset($_SESSION[\'settings\'][\'timezone\']) === true) {
 	}
 }
 
+
 // Test DB connexion
 $pass = defuse_return_decrypted(DB_PASSWD);
 $server = DB_HOST;
@@ -852,17 +854,6 @@ if (isset($post_type)) {
 
             // Manage saltkey.txt file
             if (empty($post_sk_path) === false || defined('SECUREPATH') === true) {
-                /*
-                $filename = (empty($post_sk_path) === false ? $post_sk_path : SECUREPATH).'/teampass-seckey.txt';
-                if (file_exists($filename)) {
-                    $newfile = str_replace('teampass-seckey.txt', time());
-                    rename($filename, $newfile);
-                    unlink($filename);
-                    echo '$("#step5_saltkeyFile").html("<i class=\"fa-solid fa-circle-check fa-lg text-success ml-2 mr-2\"></i><span class=\"text-info font-italic\">You can remove file '.$newfile.'</span>");';
-                } else {
-                    echo '$("#step5_saltkeyFile").html("<i class=\"fa-solid fa-circle-check fa-lg text-success ml-2 mr-2\"></i><span class=\"text-info font-italic\">Nothing done</span>");';
-                }
-                */
                 array_push(
                     $returnStatus, 
                     array(

programming_language: PHP
filename: upgrade_run_3.0.0.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      upgrade_run_3.0.0.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)
@@ -35,6 +35,15 @@ require_once '../includes/libraries/Tree/NestedTree/NestedTree.php';
 require_once 'tp.functions.php';
 require_once 'libs/aesctr.php';
 require_once '../includes/config/tp.config.php';
+
+// 3.0.0.23
+$ret = handleSecurefileConstant();
+if ($ret['error'] === true) {
+    echo '[{"finish":"1", "msg":"", "error":"'.$ret['message'].'"}]';
+    exit();
+}
+
+// Get the encrypted password
 define('DB_PASSWD_CLEAR', defuse_return_decrypted(DB_PASSWD));
 
 //Build tree
@@ -76,6 +85,8 @@ if (mysqli_connect(
 }
 
 
+
+
 // Load libraries
 require_once '../includes/libraries/protect/SuperGlobal/SuperGlobal.php';
 $superGlobal = new protect\SuperGlobal\SuperGlobal();

programming_language: PHP
filename: upgrade_run_3.0.0_fields.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      upgrade_run_3.0.0_fields.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: upgrade_run_3.0.0_files.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      upgrade_run_3.0.0_files.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)
@@ -149,19 +149,8 @@ while ($file_info = mysqli_fetch_array($rows)) {
         // Is this file encrypted?
         // Force all files to be encrypted
         if ($file_info['status'] === 'encrypted') {
-            // load PhpEncryption library
-            /*include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'.'Crypto.php';
-            include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'.'Encoding.php';
-            include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'.'DerivedKeys.php';
-            include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'.'Key.php';
-            include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'.'KeyOrPassword.php';
-            include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'.'File.php';
-            include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'.'RuntimeTests.php';
-            include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'.'KeyProtectedByPassword.php';
-            include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'.'Core.php';*/
-
             // get KEY
-            $ascii_key = file_get_contents(SECUREPATH.'/teampass-seckey.txt');
+            $ascii_key = file_get_contents(SECUREPATH.'/'.SECUREFILE);
 
             // Now decrypt the file
             $err = '';

programming_language: PHP
filename: upgrade_run_3.0.0_logs.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      upgrade_run_3.0.0_logs.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: upgrade_run_3.0.0_passwords.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      upgrade_run_3.0.0_passwords.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: upgrade_run_3.0.0_suggestions.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      upgrade_run_3.0.0_suggestions.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: upgrade_run_3.0.0_users.php
change_type: ModificationType.MODIFY
diff: @@ -8,7 +8,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      upgrade_run_3.0.0_users.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: upgrade_scripts_manager.php
change_type: ModificationType.MODIFY
diff: @@ -7,7 +7,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      upgrade_scripts_manager.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: 2fa.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      2fa.js.php
  * ---
  *

programming_language: PHP
filename: 2fa.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      2fa.php
  * ---
  *

programming_language: PHP
filename: actions.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      actions.js.php
  * ---
  *

programming_language: PHP
filename: actions.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      actions.php
  * ---
  *

programming_language: PHP
filename: admin.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      admin.js.php
  * ---
  *

programming_language: PHP
filename: admin.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      admin.php
  * ---
  *

programming_language: PHP
filename: api.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      api.js.php
  * ---
  *

programming_language: PHP
filename: api.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      api.php
  * ---
  *

programming_language: PHP
filename: backups.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      backups.js.php
  * ---
  *

programming_language: PHP
filename: backups.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      backups.php
  * ---
  *

programming_language: PHP
filename: emails.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      emails.js.php
  * ---
  *

programming_language: PHP
filename: emails.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      emails.php
  * ---
  *

programming_language: PHP
filename: export.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      export.js.php
  * ---
  *

programming_language: PHP
filename: export.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      export.php
  * ---
  *

programming_language: PHP
filename: favorites.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      favorites.js.php
  * ---
  *

programming_language: PHP
filename: favourites.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      favourites.php
  * ---
  *

programming_language: PHP
filename: fields.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      fields.js.php
  * ---
  *

programming_language: PHP
filename: fields.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      fields.php
  * ---
  *

programming_language: PHP
filename: folders.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      folders.js.php
  * ---
  *

programming_language: PHP
filename: folders.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      folders.php
  * ---
  *

programming_language: PHP
filename: import.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      import.js.php
  * ---
  *

programming_language: PHP
filename: import.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      import.php
  * ---
  *

programming_language: PHP
filename: items.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      items.js.php
  * ---
  *
@@ -4116,6 +4116,35 @@ $var['hidden_asterisk'] = '<i class="fas fa-asterisk mr-2"></i><i class="fas fa-
     }
 
 
+    function checkAccess(itemId, treeId, userId)
+    {
+        var data = {
+            'itemId': parseInt(itemId),
+            'treeId': parseInt(treeId),
+            'userId': parseInt(userId),
+        };
+
+        //Send query
+        $.post(
+            'sources/items.queries.php', {
+                type: 'check_current_access_rights',
+                data: prepareExchangedData(JSON.stringify(data), 'encode', '<?php echo $_SESSION['key']; ?>'),
+                key: '<?php echo $_SESSION['key']; ?>'
+            },
+            function(data) {
+                //decrypt data
+                data = decodeQueryReturn(data, '<?php echo $_SESSION['key']; ?>', 'items.queries.php', 'show_details_item');
+                requestRunning = true;
+                if (debugJavascript === true) {
+                    console.log("DEBUG: checkAccess");
+                    console.log(data);
+                }
+
+
+                return false;
+            }
+        );
+    }
 
 
     /**
@@ -4124,14 +4153,6 @@ $var['hidden_asterisk'] = '<i class="fas fa-asterisk mr-2"></i><i class="fas fa-
     function Details(itemDefinition, actionType, hotlink = false) {
         if (debugJavascript === true) console.info('EXPECTED ACTION on ' + itemDefinition + ' is ' + actionType + ' -- ')
 
-        // Store current view
-        savePreviousView();
-        
-        if (debugJavascript === true) console.log("Request is running: " + requestRunning)
-
-        // Store status query running
-        requestRunning = true;
-
         // Init
         if (hotlink === false) {
             var itemId = parseInt($(itemDefinition).data('item-id')) || '';
@@ -4155,6 +4176,28 @@ $var['hidden_asterisk'] = '<i class="fas fa-asterisk mr-2"></i><i class="fas fa-
             var itemRights = parseInt($(itemDefinition).data('item-rights')) || 10;
         }
 
+        // check if user still has access
+        if (checkAccess(itemId, itemTreeId, <?php echo $_SESSION['user_id']; ?>) === false) {
+            toastr.remove();
+            toastr.warning(
+                '<?php echo langHdl('no_item_to_display'); ?>',
+                '', {
+                    timeOut: 5000,
+                    progressBar: true
+                }
+            );
+
+            // Finished
+            return false;
+        }
+
+        // Store current view
+        savePreviousView();
+        
+        if (debugJavascript === true) console.log("Request is running: " + requestRunning)
+
+        // Store status query running
+        requestRunning = true;
         userDidAChange = false;
 
         // Select tab#1

programming_language: JavaScript
filename: items.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      items.php
  * ---
  *

programming_language: PHP
filename: kb.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      kb.php
  * ---
  *

programming_language: PHP
filename: ldap.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      ldap.js.php
  * ---
  *

programming_language: PHP
filename: ldap.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      ldap.php
  * ---
  *

programming_language: PHP
filename: offline.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      offline.js.php
  * ---
  *

programming_language: PHP
filename: offline.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      offline.php
  * ---
  *

programming_language: PHP
filename: options.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      options.js.php
  * ---
  *

programming_language: PHP
filename: options.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      options.php
  * ---
  *

programming_language: PHP
filename: profile.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      profile.js.php
  * ---
  *

programming_language: PHP
filename: profile.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      profile.php
  * ---
  *

programming_language: PHP
filename: roles.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      roles.js.php
  * ---
  *

programming_language: PHP
filename: roles.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      roles.php
  * ---
  *

programming_language: PHP
filename: search.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
   * ---
   *
   * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
   *
   * @file      search.js.php
   * ---

programming_language: PHP
filename: search.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      search.php
  * ---
  *

programming_language: PHP
filename: special.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      special.php
  * ---
  *

programming_language: PHP
filename: statistics.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      statistics.js.php
  * ---
  *

programming_language: PHP
filename: statistics.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      statistics.php
  * ---
  *

programming_language: PHP
filename: suggestion.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      suggestion.php
  * ---
  *

programming_language: PHP
filename: tasks.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      tasks.js.php
  * ---
  *

programming_language: PHP
filename: tasks.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      tasks.php
  * ---
  *

programming_language: PHP
filename: uploads.js.php
change_type: ModificationType.MODIFY
diff: @@ -8,7 +8,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      uploads.js.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: uploads.php
change_type: ModificationType.MODIFY
diff: @@ -8,7 +8,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      uploads.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: users.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      users.js.php
  * ---
  *

programming_language: PHP
filename: users.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      users.php
  * ---
  *

programming_language: PHP
filename: utilities.database.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      utilities.database.js.php
  * ---
  *

programming_language: PHP
filename: utilities.database.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      utilities.database.php
  * ---
  *

programming_language: PHP
filename: utilities.deletion.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      utilities.deletion.js.php
  * ---
  *

programming_language: PHP
filename: utilities.deletion.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      utilities.deletion.php
  * ---
  *

programming_language: PHP
filename: utilities.logs.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      utilities.logs.js.php
  * ---
  *

programming_language: PHP
filename: utilities.logs.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      utilities.logs.php
  * ---
  *

programming_language: PHP
filename: utilities.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      utilities.php
  * ---
  *

programming_language: PHP
filename: utilities.renewal.js.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      utilities.renewal.js.php
  * ---
  *

programming_language: PHP
filename: utilities.renewal.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      utilities.renewal.php
  * ---
  *

programming_language: PHP
filename: admin.queries.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      admin.queries.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)
@@ -1048,7 +1048,7 @@ switch ($post_type) {
         // Check KEY
         if ($post_key !== $_SESSION['key']) {
             echo prepareExchangedData(
-    $SETTINGS['cpassman_dir'],
+                $SETTINGS['cpassman_dir'],
                 array(
                     'error' => true,
                     'message' => langHdl('key_is_not_correct'),
@@ -1060,7 +1060,7 @@ switch ($post_type) {
         // Is admin?
         if ($_SESSION['is_admin'] === true) {
             echo prepareExchangedData(
-    $SETTINGS['cpassman_dir'],
+                $SETTINGS['cpassman_dir'],
                 array(
                     'error' => true,
                     'message' => langHdl('error_not_allowed_to'),
@@ -1074,22 +1074,22 @@ switch ($post_type) {
         require_once 'main.functions.php';
 
         // store old sk
-        $_SESSION['reencrypt_old_salt'] = file_get_contents(SECUREPATH . '/teampass-seckey.txt');
+        $_SESSION['reencrypt_old_salt'] = file_get_contents(SECUREPATH.'/'.SECUREFILE);
 
         // generate new saltkey
-        $old_sk_filename = SECUREPATH . '/teampass-seckey.txt.' . date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))) . '.' . time();
+        $old_sk_filename = SECUREPATH.'/'.SECUREFILE . date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))) . '.' . time();
         copy(
-            SECUREPATH . '/teampass-seckey.txt',
+            SECUREPATH.'/'.SECUREFILE,
             $old_sk_filename
         );
         $new_key = defuse_generate_key();
         file_put_contents(
-            SECUREPATH . '/teampass-seckey.txt',
+            SECUREPATH.'/'.SECUREFILE,
             $new_key
         );
 
         // store new sk
-        $_SESSION['reencrypt_new_salt'] = file_get_contents(SECUREPATH . '/teampass-seckey.txt');
+        $_SESSION['reencrypt_new_salt'] = file_get_contents(SECUREPATH.'/'.SECUREFILE);
 
         //put tool in maintenance.
         DB::update(
@@ -1592,7 +1592,7 @@ switch ($post_type) {
 
         // Send back
         echo prepareExchangedData(
-    $SETTINGS['cpassman_dir'],
+            $SETTINGS['cpassman_dir'],
             array(
                 'error' => false,
                 'message' => '',
@@ -1609,7 +1609,7 @@ switch ($post_type) {
         // Check KEY
         if ($post_key !== $_SESSION['key']) {
             echo prepareExchangedData(
-    $SETTINGS['cpassman_dir'],
+                $SETTINGS['cpassman_dir'],
                 array(
                     'error' => true,
                     'message' => langHdl('key_is_not_correct'),
@@ -1621,7 +1621,7 @@ switch ($post_type) {
         // Is admin?
         if ($_SESSION['is_admin'] === true) {
             echo prepareExchangedData(
-    $SETTINGS['cpassman_dir'],
+                $SETTINGS['cpassman_dir'],
                 array(
                     'error' => true,
                     'message' => langHdl('error_not_allowed_to'),
@@ -1660,10 +1660,10 @@ switch ($post_type) {
 
         // restore saltkey file
         if (file_exists($previous_saltkey_filename)) {
-            unlink(SECUREPATH . '/teampass-seckey.txt');
+            unlink(SECUREPATH.'/'.SECUREFILE);
             rename(
                 $previous_saltkey_filename,
-                SECUREPATH . '/teampass-seckey.txt'
+                SECUREPATH.'/'.SECUREFILE
             );
         }
 
@@ -1672,7 +1672,7 @@ switch ($post_type) {
 
         // Send back
         echo prepareExchangedData(
-    $SETTINGS['cpassman_dir'],
+            $SETTINGS['cpassman_dir'],
             array(
                 'error' => false,
                 'message' => '',

programming_language: PHP
filename: aes.functions.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      aes.functions.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: background.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      users.background.php
  * ---
  *

programming_language: PHP
filename: backups.queries.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      backups.queries.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: checks.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      checks.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: core.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      core.php
  * ---
  *

programming_language: PHP
filename: downloadFile.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      downloadFile.php
  * ---
  *

programming_language: PHP
filename: expired.datatables.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      expired.datatables.php
  * ---
  *

programming_language: PHP
filename: export.queries.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      export.queries.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)
@@ -251,7 +251,7 @@ if (null !== $post_type) {
                                     'email' => $record['email'] !== 'none' ? (is_null($record['email']) === false ? cleanStringForExport($record['email']) : '') : '',
                                     'kbs' => implode(' | ', $arr_kbs),
                                     'tags' => implode(' ', $arr_tags),
-                                    'folder' => implode(' > ', $arr_trees),
+                                    'folder' => implode('/', $arr_trees),
                                 );
                                 ++$i;
 

programming_language: PHP
filename: favourites.queries.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      favourites.queries.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: fields.queries.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      fields.queries.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: find.queries.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      find.queries.php
  * ---
  *

programming_language: PHP
filename: folders.datatable.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      folders.datatable.php
  * ---
  *

programming_language: PHP
filename: folders.queries.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      folders.queries.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: identify.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      identify.php
  * ---
  *

programming_language: PHP
filename: import.queries.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      import.queries.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: items.logs.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      items.logs.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: items.queries.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      items.queries.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)
@@ -6005,6 +6005,7 @@ if (is_null($inputData['type']) === false) {
                 break;
             }
             $arr_data = [];
+            $arr_folders = [];
 
             // decrypt and retreive data in JSON format
             $dataReceived = prepareExchangedData(
@@ -6125,6 +6126,7 @@ if (is_null($inputData['type']) === false) {
                         $arr_data['folders'][$inc]['disabled'] = $disabled;
                         $arr_data['folders'][$inc]['parent_id'] = (int) $folder->parent_id;
                         $arr_data['folders'][$inc]['perso'] = (int) $folder->personal_folder;
+                        //array_push($arr_folders, (int) $folder->id);
 
                         // Is this folder an active folders? (where user can do something)
                         $is_visible_active = 0;
@@ -6140,6 +6142,7 @@ if (is_null($inputData['type']) === false) {
                     }
                 }
             }
+            /*
             if (isset($arr_data['folders']) === true) {
                 // save to cache_tree
                 cacheTreeUserHandler(
@@ -6148,7 +6151,16 @@ if (is_null($inputData['type']) === false) {
                     $SETTINGS,
                     'visible_folders',
                 );
+
+                // save to cache_tree
+                cacheTreeUserHandler(
+                    (int) $_SESSION['user_id'],
+                    json_encode($arr_folders),
+                    $SETTINGS,
+                    'folders',
+                );
             }
+            */
 
             // send data
             echo (string) prepareExchangedData(
@@ -6788,6 +6800,61 @@ if (is_null($inputData['type']) === false) {
                 'encode'
             );
 
+            break;
+
+        /*
+        * CASE
+        * check_current_access_rights
+        */
+        case 'check_current_access_rights':
+            // Check KEY
+            if ($inputData['key'] !== $_SESSION['key']) {
+                echo (string) prepareExchangedData(
+                    $SETTINGS['cpassman_dir'],
+                    array(
+                        'error' => 'key_not_conform',
+                        'message' => langHdl('key_is_not_correct'),
+                    ),
+                    'encode'
+                );
+                break;
+            }
+            // decrypt and retrieve data in JSON format
+            $dataReceived = prepareExchangedData(
+                $SETTINGS['cpassman_dir'],
+                $inputData['data'],
+                'decode'
+            );
+
+            // prepare variables
+            $inputData['userId'] = (int) filter_var($dataReceived['userId'], FILTER_SANITIZE_NUMBER_INT);
+            $inputData['itemId'] = (int) filter_var($dataReceived['itemId'], FILTER_SANITIZE_NUMBER_INT);
+            $inputData['treeId'] = (int) filter_var($dataReceived['treeId'], FILTER_SANITIZE_NUMBER_INT);
+
+            $data = DB::queryFirstRow(
+                'SELECT visible_folders
+                FROM ' . prefixTable('cache_tree') . ' WHERE user_id = %i',
+                $inputData['userId']
+            );
+            // Check if tree ID is in visible folders.
+            if (null !== $data['visible_folders']) {
+                $arr = json_decode($data['visible_folders'], true);
+                $ids = array_column($arr, 'id');
+            }
+
+
+            $data = array(
+                'error' => false,
+                'access' => isset($inputData['treeId']) === true && in_array($inputData['treeId'], $ids) === true ? true : false,
+            );
+
+            // send data
+            echo (string) prepareExchangedData(
+                $SETTINGS['cpassman_dir'],
+                $data,
+                'encode'
+            );
+
             break;
     }
 }

programming_language: PHP
filename: ldap.queries.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      ldap.queries.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: logs.datatables.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      logs.datatables.php
  * ---
  *

programming_language: PHP
filename: main.functions.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      main.functions.php
  * ---
  *
@@ -125,7 +125,7 @@ function bCrypt(
  */
 function cryption(string $message, string $ascii_key, string $type, ?array $SETTINGS = []): array
 {
-    $ascii_key = empty($ascii_key) === true ? file_get_contents(SECUREPATH . '/teampass-seckey.txt') : $ascii_key;
+    $ascii_key = empty($ascii_key) === true ? file_get_contents(SECUREPATH.'/'.SECUREFILE) : $ascii_key;
     $err = false;
     
     $path = __DIR__.'/../includes/libraries/Encryption/Encryption/';
@@ -637,7 +637,7 @@ function identUser(
     foreach ($rows as $record) {
         //if (isset($record['id_tree'])) {
             $foldersLimited[$record['id_tree']][$inc] = $record['item_id'];
-            array_push($foldersLimitedFull, $record['item_id']);
+            array_push($foldersLimitedFull, $record['id_tree']);
             ++$inc;
         //}
     }
@@ -651,7 +651,7 @@ function identUser(
         $noAccessPersonalFolders,
         $foldersLimitedFull,
         $allowedFoldersByRoles,
-        $restrictedFoldersForItems,
+        array_keys($restrictedFoldersForItems),
         $readOnlyFolders,
         $noAccessFolders,
         isset($SETTINGS['enable_pf_feature']) === true ? $SETTINGS['enable_pf_feature'] : 0,
@@ -1293,7 +1293,7 @@ function prepareSendingEmail(
                     'receivers' => $email,
                     'body' => $body,
                     'receiver_name' => $receiverName,
-                ]),
+                ], JSON_HEX_QUOT | JSON_HEX_TAG),
                 'updated_at' => '',
                 'finished_at' => '',
                 'output' => '',
@@ -1433,7 +1433,7 @@ function buildEmail(
     foreach (array_filter(explode(',', $email)) as $dest) {
         $mail->addAddress($dest);
     }
-
+    
     // Prepare HTML
     $text_html = emailBody($textMail);
     $mail->WordWrap = 80;
@@ -2301,7 +2301,7 @@ function prepareFileWithDefuse(
     $target_file = $antiXss->xss_clean($target_file);
     if (empty($password) === true || is_null($password) === true) {
         // get KEY to define password
-        $ascii_key = file_get_contents(SECUREPATH . '/teampass-seckey.txt');
+        $ascii_key = file_get_contents(SECUREPATH.'/'.SECUREFILE);
         $password = \Defuse\Crypto\Key::loadFromAsciiSafeString($ascii_key);
     }
 

programming_language: PHP
filename: main.queries.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      main.queries.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: roles.queries.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      roles.queries.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)
@@ -251,6 +251,40 @@ if (null !== $post_type) {
                 }
             }
 
+            /*
+            // update folders rights for users in cache_tree
+            // Requested for real-time changes
+            $rows = DB::query(
+                'SELECT increment_id, folders
+                FROM ' . prefixTable('cache_tree'),
+            );
+
+            foreach($rows as $row) {
+                if ($row['folders'] === '' || $post_selectedFolders === null) {
+                    continue;
+                }
+                // get visible folders
+                $arr = json_decode($row['folders'], true);
+                
+                foreach($arr as $folder) {
+                    if (in_array($folder, $post_selectedFolders) === true) {
+                        unset($arr[$folder]);
+                    }
+                }
+                print_r($arr);
+
+                // update
+                /*DB::update(
+                    prefixTable('cache_tree'),
+                    array(
+                        'folders' => json_encode($arr),
+                    ),
+                    'increment_id = %i',
+                    $row['increment_id']
+                );*/
+            }
+            */
+
             echo prepareExchangedData(
                 $SETTINGS['cpassman_dir'],
                 array(

programming_language: PHP
filename: scheduler.php
change_type: ModificationType.MODIFY
diff: @@ -8,7 +8,7 @@
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      scheduler.php
  * ---
  *

programming_language: PHP
filename: tree.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      tree.php
  *
  * @author    Nils Laumaillé (nils@teampass.net)
@@ -251,8 +251,17 @@ function showFolderToUser(
     array $listRestrictedFoldersForItemsKeys
 ): bool
 {
-    $big_array = array_diff(array_unique(array_merge($session_groupes_visibles, $listFoldersLimitedKeys, $listRestrictedFoldersForItemsKeys), SORT_NUMERIC), $session_forbiden_pfs);
-    //print_r($session_groupes_visibles);
+    $big_array = array_diff(
+        array_unique(
+            array_merge(
+                $session_groupes_visibles, 
+                $listFoldersLimitedKeys, 
+                $listRestrictedFoldersForItemsKeys
+            ), 
+            SORT_NUMERIC
+        ), 
+        $session_forbiden_pfs
+    );
     if ($nodeId === 0 || in_array($nodeId, $big_array) === true) {
         return true;
     }

programming_language: PHP
filename: upload.attachments.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      upload.attachments.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: upload.files.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      upload.files.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: user.logs.datatables.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      user.logs.datatables.php
  * ---
  *

programming_language: PHP
filename: users.datatable.php
change_type: ModificationType.MODIFY
diff: @@ -11,7 +11,7 @@ declare(strict_types=1);
  * ---
  *
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      users.datatable.php
  * ---
  *

programming_language: PHP
filename: users.queries.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      users.queries.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: utilities.queries.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      utilities.queries.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP
filename: utils.queries.php
change_type: ModificationType.MODIFY
diff: @@ -10,7 +10,7 @@ declare(strict_types=1);
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  * ---
  * @project   Teampass
- * @version   3.0.0.22
+ * @version   3.0.0.23
  * @file      utils.queries.php
  * ---
  * @author    Nils Laumaillé (nils@teampass.net)

programming_language: PHP