New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nextcloud - populate list with organization users #655

Closed
Thatkookooguy opened this Issue Jan 1, 2018 · 18 comments

Comments

Projects
None yet
5 participants
@Thatkookooguy
Copy link

Thatkookooguy commented Jan 1, 2018

Expected behavior

when registering to your own chat server, all organization contacts disappeared from the list. users need to add them manually

Actual behavior

should add all organization contacts automatically or have an option to do that

Steps to reproduce the behavior

  1. enable plugin from app store
  2. register to a managed (beta service) server type
  3. contacts are suddently empty in the chat sidebar

Environment

  • JSXC version:
  • Host system and version: NextCloud
  • Browser vendor and version: Version 63.0.3239.108 (Official Build) (64-bit)
  • Any browser plugins enabled? no. run on incognito
  • XMPP server vendor and version: jsxc.ch/managed.
  • Is your XMPP server working with other clients as expected? didn't check other clients

@Thatkookooguy Thatkookooguy changed the title nextcloud populate list with organization users nextcloud - populate list with organization users Jan 1, 2018

@MarcelWaldvogel

This comment has been minimized.

Copy link
Contributor

MarcelWaldvogel commented Jan 3, 2018

Happy New Year! Sorry for the inconvenience, will look into this shortly.

@MarcelWaldvogel

This comment has been minimized.

Copy link
Contributor

MarcelWaldvogel commented Jan 3, 2018

We had a database issue which I hope should be fixed now. Could you please try again?

@freakyc

This comment has been minimized.

Copy link

freakyc commented Jan 4, 2018

I'm not sure when I registered on the managed server if it was before or after the database issue you mentioned, so I did a re-register today and the user list doesn't add auto-populate like the internal server did. I'm not sure if it's supposed to and actually prefer that it doesn't automatically add my admin account, but I thought I'd add my experience with it.

@Thatkookooguy

This comment has been minimized.

Copy link

Thatkookooguy commented Jan 6, 2018

@freakyc I agree there should be an option to change this in the preferences.
As an admin, I don't care. But for new users I add to my server, not all of them are tech savvy and I think some of them find this a little odd.

maybe have an option that if a user is part of a group, you can set certain groups (like their teamates) as the default added chat contacts

@olegbolden

This comment has been minimized.

Copy link

olegbolden commented Oct 4, 2018

Let me continue this discussion.
After I turned my server type from internal to managed I have to add newly created users of Nextcloud to all accounts that have always been registered before.
When using internal jabber server new user was automatically added to the list for all users and his own list populated with these users automatically. Now with managed server every existent user should add new contact manually. Moreover, Full name of newly added user is not processed by managed server, so if I need to change Full name of some account I can not change his/her name in one place - every member of our company should change Full name of the corresponding Nextcloud account manually.
I wonder why all existent users from various groups were added to managed server when I just created it in admin panel, but newly added Nextcloud users are not processed at all on myserver.jsxc.ch ?
May be there are some synchronization for this?
It is very inconvenient to set all up in company with even 30-40 members.

@MarcelWaldvogel

This comment has been minimized.

Copy link
Contributor

MarcelWaldvogel commented Oct 4, 2018

The service authentication backend, xcauth, does support managing shared roster groups (and full names) based on Nextcloud groups.

Our managed server uses this. But somehow it currently does not do what it should. I'm investigating.

PS: Full names will usually only be set once, so the user can change it.

@MarcelWaldvogel

This comment has been minimized.

Copy link
Contributor

MarcelWaldvogel commented Oct 4, 2018

@olegbolden: Can you try again?

@olegbolden

This comment has been minimized.

Copy link

olegbolden commented Oct 4, 2018

@MarcelWaldvogel , thank you for your prompt reply.
What should I try in particular?

@MarcelWaldvogel

This comment has been minimized.

Copy link
Contributor

MarcelWaldvogel commented Oct 4, 2018

Sorry for not being clear: Please log in with a user.

When a user logs in:

  1. the roster groups (s)he is in are updated based on the Nextcloud groups and
  2. the user's full name is set if it has not previously been set to anything useful (i.e., neither the empty string, the username, nor the JID).
@olegbolden

This comment has been minimized.

Copy link

olegbolden commented Oct 4, 2018

Yes, it works!
Thank you @MarcelWaldvogel !
It would be also great if user changes it's Full Name and this change is automatically reflected in all other user accounts (of course, if it wasn't changed manually in client apps).

@olegbolden

This comment has been minimized.

Copy link

olegbolden commented Oct 4, 2018

Strange but group synchronization stopped working again...

@MarcelWaldvogel

This comment has been minimized.

Copy link
Contributor

MarcelWaldvogel commented Oct 4, 2018

I see a lot of HTTP '500' error codes when the managed server is trying to access the groups of the user logging in, starting at 13:47 UTC. Can you check your (Nextcloud, Web server) logs?

(The authentication requests immediately before that are successful.)

If you do not want to see that information on GitHub, you can also send mail to marcel@jsxc.ch.

@MarcelWaldvogel

This comment has been minimized.

Copy link
Contributor

MarcelWaldvogel commented Oct 5, 2018

The error message seems to be

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1 OFFSET 0'

This seems to be executed by when the JSXC app asks for the usersInGroup from the Nextcloud group backend:

SELECT `uid`, `displayname` FROM `oc_users` `u` LEFT JOIN `oc_preferences` `p` ON (`userid` = `uid`) AND (`appid` = 'settings') AND (`configkey` = 'email') WHERE (`uid`  COLLATE UTF8_general_ci LIKE ?) OR (`displayname`  COLLATE UTF8_general_ci LIKE ?) OR (`configvalue`  COLLATE UTF8_general_ci LIKE ?) ORDER BY `uid_lower` ASC LIMIT -1 OFFSET 0

LIMIT -1 does not seem to be valid for MySQL. The SELECT documentation says:

The LIMIT clause can be used to constrain the number of rows returned by the SELECT statement. LIMIT takes one or two numeric arguments, which must both be nonnegative integer constants […]
and
For compatibility with PostgreSQL, MySQL also supports the LIMIT row_count OFFSET offset syntax.

So maybe this has sneaked into Nextcloud from someone trying to make the code cleaner? Could this be related to the groups not working in 14.0.1?

Did the problem appear after you upgraded to 14.0.1?

@olegbolden

This comment has been minimized.

Copy link

olegbolden commented Oct 5, 2018

I found two extensions giving errors and extensive logging:
Everyone Group
User and Group SQL Backends

I intended to use Everyone Group extension in order that all users can see each other independent of groups, because group sorting and hiding can be easily tuned up in modern client messengers. This very extension broke proper fetching of users and group information by JSXC.

Now everything works fine except following

  1. When user change his/her Full Name nothing changes in rosters of other users.
  2. After user is deleted his/her contact is not deleted from roster of others.

Synchronization like this is most needed functionality to use especially within corporate environment.

@olegbolden

This comment has been minimized.

Copy link

olegbolden commented Oct 5, 2018

I revealed some more problems wtih user and group management.

  1. If I eventually add myself to contact list (just by mistake or importing userlist with myself inside from some messenger) I cannot delete myself from contact list. And I can send messages to myself :)
  2. If I delete group admin was added to before deletion, this group is not deleted from admins roster. This deleted group is not visible by other users as expected.
  3. If I delete some user within Nextcloud and create another user with the same name I see old Full Name and can read old messages of deleted user. This happens most probably because user is not actually deleted from JSXC server.

MarcelWaldvogel added a commit to jsxc/xmpp-cloud-auth that referenced this issue Oct 7, 2018

@MarcelWaldvogel

This comment has been minimized.

Copy link
Contributor

MarcelWaldvogel commented Oct 7, 2018

To the different items:

  1. Full name change: xcauth now supports this and it has been deployed on the managed server. On the next login of that user or anyone in any of his groups, the name should be changed.
  2. User deletion: The next time any of his group buddies log in, the deleted user should disappear from the shared rosters (not from the manually added rosters; if you want that, jsxc.nextcloud would need to be involved and it's not going to be pretty.
  3. Self in roster: This addition was done in JSXC, not another XMPP app? Then please create an issue in jsxc.nextcloud.
  4. Delete group admin: I do not understand what you mean here. Could you please create a more descriptive issue in jsxc.nextcloud? Thanks!
  5. Re-create user: The old full name part should be fixed. And yes, there is no real deletion yet. See User deletion above.

I am sorry to ask you to create these issues, but separating it (and explaining it in more detail, for Delete group admin) helps us to fix it. It is already confusing now to have multiple itemized lists in multple comments.

I hope that at least the Full name part is working fine for you now. And we will do our best to address the other issues.

@MarcelWaldvogel

This comment has been minimized.

Copy link
Contributor

MarcelWaldvogel commented Oct 7, 2018

After creating the new issues, could you please close this issue? Thanks!

@olegbolden

This comment has been minimized.

Copy link

olegbolden commented Oct 7, 2018

@MarcelWaldvogel ,
I'm really happy to prove that most needed items 1, 2 and 5 now working flowlessly for users!!!
Thank you for your time!
As for the rest couple of issues I'll create separate ones to continue with.
Also it seems I have no rights to close this issue because I'm not a topic starter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment