nextcloud / richdocuments

📑 Collabora Online for Nextcloud
https://nextcloud.com/collaboraonline
349 stars 115 forks source link

Properly set the username for federated editing #760

Open deusoz opened 4 years ago

deusoz commented 4 years ago

If NextcloudServer1 user "jon" jon@nc.tld1 opens document via other server running Collabora, then a different guy named "jon" on NextcloudServer2 jon@nc.tld2 opens a document, the Collabora admin panel counts these both as 1 user in the "Users online" tab. It says correctly in large letters, that there are 2 users, but the "Users online" Collabora Admin tab @loleaflet/dist/admin/admin.html combines any users with the same name even though they are different people.

I'm wondering if there's anyway to include the domain in the username that gets sent to collabora server or if this has another workaround, or is this a Collabora bug or perhaps there's a loolwsd admin setting I can't find. I deem this NOT good for the purpose of monitoring usage for 2 NextCloud instances sharing a Collabora server.

deusoz commented 4 years ago

Screenshot_2019-12-29 Collabora Online Development Edition (CODE) - Admin console

deusoz commented 4 years ago

2 users named db5d, one from a NC in Los Angeles, other from unconnected NC in Spain, sharing a server running Collabora

juliushaertl commented 4 years ago

I agree that we probably should add the remote url to the username that is sent to collabora then.

deusoz commented 3 years ago

A step in the right direction.

line 164 lib/Controller/WopiController.php ( I added the BOLD part after getDisplayName() and now at on the Collabora Admin Panel "Documents" list it shows who belongs to each document, albeit the "Users" list still combines them and uses the "display name" of first user.

$userDisplayName = $user !== null && !$isPublic ? $user->getDisplayName()."@".$_SERVER['HTTP_HOST'] : $wopi->getGuestDisplayname();

image

THE USER LIST STILL SHOWS 1 BUT THE DOCUMENT LIST SHOWS THE DIFFERENT USERS (with same username from different nextclouds using same Collabora stand-alone server)

image