powered by Jive Software

Tip: User''s group list when using JDBC

This might be very obvious to a lot of people, but here’'s a small tip for those that are using the JDBC groups provider.

When it runs the SQL to get the list of groups for a user, it inserts the full user JID instead of just the node (username). For our setup we’‘re using the data from our main application to do all the authentication and shared rosters (groups), so I was scratching my head for a while trying to figure out why I wasn’‘t getting a group list (and got to the point of debugging every SQL statement being run on the database). To fix this you need to go into the JDBCGroupsProvider.java file and change line 285 (in the getGroupNames method) from user.toString() to user.getNode(), so that’‘s it’'s just inserting the username, not the full JID.

Hi,

does this also work when you have s2s connections enabled? I really wonder how Wildfire can then get the difference between "john@jabber.org" and "john@example.com" if you store only “john”.

LG

I emailed Matt Tucker with a patch to fix this. I haven’‘t heard from him so I don’‘t know its status. Here’‘s my alteration to handle local & non-local users in JDBCGroupProvider. There’'s a private member variable to add and replacement of two methods.

Message was edited by: oprig

Seem to be having a problem - I can’'t post the source code here. Contact me if you want this patch.

Message was edited by: oprig