nextcloud / desktop

💻 Desktop sync client for Nextcloud
https://nextcloud.com/install/#install-clients
GNU General Public License v2.0
3.04k stars 800 forks source link

Sync Folder name is a GUID instead of DisplayName if users are from LDAP #3305

Open peacepenguin opened 3 years ago

peacepenguin commented 3 years ago

Expected behaviour

When syncing multiple accounts in the desktop sync client, all folders shown in the File NAV bar should be human readable, logical named entries that represent that nextcloud account.

Top level Folders in the OS file Nav bar should always look consistent, something like this:

Nextcloud - bob@nextcloud.company1.com
Nextcloud - bob@nextcloud.company2.com

Actual behaviour

File tree looks like this when LDAP user backend is in use on the Nextcloud server:

Nextcloud - 9B651B57-830B-4F34-86FA-F874AE6441E5@nextcloud.company1.com
Nextcloud - D516A112-7585-4C1E-8294-2D48FE8FEEE8@nextcloud.company2.com

Problem summary:

The "displayName" is supposed to be used for the folder naming. But the desktop client incorrectly maps the Nextcloud "Internal UID" to the "DisplayName" field, so for LDAP sync'd user backends, the DisplayName shown is actually the LDAP GUID instead of the configured Nextcloud Display Name for that user.

Potential fix: (tested)

# \src\gui\navigationpanehelper.cpp
#Line 101:
                if (AccountManager::instance()->accounts().size() > 1)
-                    title = title % " - " % folder->accountState()->account()->displayName();
+                    title = folder->accountState()->account()->url().host() % " - " % folder->accountState()->account()->davDisplayName();

This proposed "title" variable change would result in this layout for the top level folder name in the nav bar:

nextcloud.company1.com - Bob
nextcloud.company2.com - Bob

This UI change makes LDAP backend sync folders look much nicer and easier for the end-user to identify the associated account.

How to use GitHub

mgallien commented 3 years ago

@peacepenguin Thanks for the report do you want to try opening a PR yourself because I am under the impression that you already did a lot of work ? I will try to find somebody do it quickly if you cannot do it yourself

peacepenguin commented 3 years ago

@mgallien yes no problem, I've opened a pull request with the proposed changes: https://github.com/nextcloud/desktop/pull/3419

Thanks!

joshtrichards commented 2 months ago

Related: #836 / #1459