nilsteampassnet / TeamPass

Collaborative Passwords Manager
https://www.teampass.net
1.69k stars 551 forks source link

Losing access to subfolders (layer2) after chagning personal settings #3316

Open piechota1989 opened 2 years ago

piechota1989 commented 2 years ago

Steps to reproduce

  1. Login as regular user to panel, which have role with access to Layer 1 folders and then to Layer 2 folders
  2. Go to my profile
  3. Go to settings
  4. Change any of data (name, surname, language, tree loading strategy)
  5. Logout
  6. Login again
  7. You can see only Layer 1 passwords folder, even if in previous session you saw Layer 2 folder.
  8. Changing back data doesn't solve the problem

Expected behaviour

Changing personal data shouldn't affect on accessability to passwords subfolders

Actual behaviour

Changin personal data cause, that you lost access to folders below the level 1, I mean level 2 etc. Problem occurs on standalone users and also on Active Directory Users

Server configuration

Operating system: Ubuntu 22.04.1 LTS

Web server: apache2 v 2.4.52

Database: mariadb-server v 10.6.7

PHP version: 7.4.30

Teampass version: version 3.0.0.18 - commit: b55dbf92241938f918df37fc9bfc483d127c9064

Teampass configuration file: clean, standard config with only SMTP server settings

Updated from an older Teampass or fresh install: fresh install

Client configuration

Browser: Firefox and Google Chrome

Operating system: Windows 10

Logs

Log from the web-browser developer console (CTRL + SHIFT + i)

Too much things to log, but reproducing issue is very easy to do. You will know what to log to find the issue.
nilsteampassnet commented 2 years ago

Thank you for reporting. After a lots of attempts to reproduce I cannot. There is no relationship between personal settings and folders access. Have you try for refreshing folders tree ? image Could you upgrade to latest commit?

piechota1989 commented 2 years ago

@nilsteampassnet I found the reason of issue. If you save private propeties when the polish translation is enabled for current user, value "sequential" is inserted directly to "_teampassusers" table to column "treeloadstrategy" with value "sekwencyjny", not "sequential". That action causes, that logic stops working properly. Same situation with Full loading.

changing this:

    'full' => 'Pełny',
    'sequential' => 'Sekwencyjny',

to that:

    'full' => 'Full',
    'sequential' => 'Sequential',

cause, that loading tree works well, but this makes, that value from drop-down list is displayed in english.

in file ./includes/language/polish.php

ServiceMRE commented 2 years ago

Hi, I just had the same problem with french language. To work weel, the code must be change to just use this information to display, not to use as comparator in the code.

piechota1989 commented 2 years ago

@nilsteampassnet how big chance is, that this bug will be fixed within 1 or 2 weeks? I would help you, but I am not a programmer, but sysadmin.

nilsteampassnet commented 2 years ago

@piechota1989 have you updated to latest commit?

piechota1989 commented 2 years ago

@nilsteampassnet yes. Check output shown below teampass_wrong_variable_inside_DB