Just married, Openfire plugin

Hey guys,

we are using our Openfire within our corporate environment with more than 13000 registered accounts.

We often had requests to change the username because somebody married and changed the family name.

Our usernames are a combination of the forename and the surname like forename.surname@jabberserver.

So we need to edit the usernames, but sadly Openfire does not support that because the username is unique and the primary key for nearly all user relations in the database.

So I created a plugin that creates a new user and copies all the roster entries, groups, password, preferences, vcard et cetera from an other user and deletes the old user (if you want). You can also create just a copy from an existing user for testing purpose or something like that.

This is the first version of the plugin, so use it on your own risk. You might keep the old user in database as long as your sure everything works as intended!

If you find some bugs feel free to comment, create tickets (if your allowed to) or fix it on your own. Sourcecode is available in openfire svn trunk.

Greetz,

Stytrix

2 Likes

I love the plugin name, well done!

+1 for the name

Will test it, as we also often have such issues and currently we have a procedure of removing old username, creating new, etc. Will save some time.

GUI looks a bit different from the rest of Admin Console. Button is blue and input fields glow with blue light and are too tiny (can’t see letters in full height). Also Huge bolded title on the main plugin page looks bad.

Thanks for the feedback.

I am using another css stylesheet to render the GUI, because I am bored of the standard global.css file that is used by openfire.

The huge headline was not intended so I removed the style information for headlines, should be fixed now! I also increased the height of the input fields, hopefully that fixes the problem you mentioned. (I guess you are using firefox)

Yes, Firefox. Now it looks better.

I see that you have updated the plugin in the SVN. Have you updated the attachment? Or maybe it is better to attach it to a document http://community.igniterealtime.org/docs/DOC-2302

updated this attachment as well as the document’s attachment

Hello. I think i have discovered a flaw in this plugin. When it creates a new user with the new username it probably copies it roster also. So all roster items become “unique” and therefor any changes to users, which should appear via Sharing groups do not sync to such user’s roster. Actually it sync the group changes and new users still appear, but if you change Name of some other user, it will still stay tha same on the roster of the user created with Just married plugin. As we have phone numbers attached to names (and some users change names after the marriage) this information often changes and such users are left with the wrong phones in their list.

Maybe there could be an option to omit the copying of the roster items. This way it would get up to date roster from the shared groups.

hi wroot,

it is kind of hard to follow your description.

maybe you could describe how I can reproduce the flaw in just married.

what do you mean with “unique” roster items, when they are copied?!

And the option to omit copying roster items should only be prevented for shared groups?

greetings

Sorry for the rushed description. I’m not at work this week, so can’t do more testing. And on my test server at home i can’t test, because any changes to the names are not propogated without the server restart… weird. Will try to do more tests on Monday or Tuesday.

By unique roster item i meant, that if you rename someone manually in your client, it will stay like that, no matter what shared group is pushing to you (name i mean). We sometimes have such issues when users fool with renaming their coworkers and then they can’t get any changes for them (if name changes or a phone number, which we put into Name field). But this time 4-5 users were affected and all of them have been recently renamed with Just Married, so i assumed plugin was the cause. But i can’t reporduce this on my test server now, with it behaving weirdly.

The steps would be:

create users:

user1 - name: User One

user2 - name: User Two

put them into group Test and make it shared group (share with all)

with Just Married plugin rename user1 to user3 - name: User Three

login with User Three and make sure it sees User Two ok.

then in the users list edit properties of user2 and change its name to User Four.

check with user3 how it sees user2 (User Two or User Four), log off and login with user3 again to see if it catches the change of the name, if it still shows the old name, try restarting the server

If you can reproduce this (user3 still showing the old name of user2 even after the server restart), then i think having an option to omit copying of roster items ONLY for shared groups would be good. Because the user would still get all contacts from the shared group.

Holger, another update. This time it looks like it is after all an issue of Just Married plugin. My reproduction steps are still valid in the 9 post, but i will try to describe it better now:

  • Have users johnd (Name: John Doe) and maryj (Name: Mary Jane)

  • Add them to the group “managers”, add sharing name for this group “Managers” and share it with all users

  • Check Roster of user johnd and check is it seeing maryj as Mary Jane on his roster (you can do it via Admin Console in user’s properties)

  • Change name of maryj user to Mary Elly Jane (NOT with Just married plugin, just via editing user’s properties in Admin Console)

  • Check Roster of user johnd and see that it probably still shows maryj as Mary Jane on his roster

  • Restart the server

  • Check Roster of user johnd and see that it should now show maryj as Mary Elly Jane on his roster (cache is slow and it takes very long for Openfire to update changed names to the rosters, so restart is usually needed to force the update)

  • Use Just married plugin to rename johnd user to johnd2 (changing his name to John Doe Second)

  • Now rename maryj user (again, just via properties) to Mary Elly Smith

  • Restart the server

  • Check Roster of user johnd and see that it is still showing maryj as Mary Elly Jane on his roster (though it should be Mary Elly Smith now)

After the user is renamed with Just married plugin, all items in his roster are “freezed” and all names stay the same, even after the server restart.

Because of that we had to remove Just married plugin for now and revert to the old procedure, deleting the old user and creating new one (deleting johnd and creating johnd2). This way new user gets a fresh shared roster which is dynamically updated when names change.

So, yes. We need an option for Just married plugin to remove all roster items (if they come from shared groups) and let it repopulate the roster again from the server, when doing username renaming (johnd to johnd2).

Not sure if this is the right place to put this, but i have a feature request for Just Married.

This a a great plugin, i get a lot of requests to setup a new user with the same rosters as another existing user.

the copy feature works great but with one pitfall. Nicknames.

When you copy a user and give them a new name. they get added to everyone’s roster properly, but with the old persons nickname.

My feature request would be to either null out nicknames during a copy, or add it as an editable field in your name changer interface.

Cheers,

Chris

That makes sense. I’ve logged this feature request as [OF-1134] JustMarried: Allow roster alias to be changed - IgniteRealtime JIRA

We are somewhat dependent on contributions from developers that have time available to implement changes (and there are a lot of pending changes), so there’s no telling when this will be done. If you can contribute the required changes (or know of someone that can), please feel free to create a pull request on github!

Plugin seems not to be working on openfire 4.6.4

After inputing details a new page shows up with no info and no changes are being made.

1 Like

I have filed your report as a github issue against this plugin project there.

Cheers mate! :+1::slightly_smiling_face:

Clean install openfire v4.9.2 (Ubuntu 24.04) and Just married Plugin v1.2.4 java error when copy users with Groups having Contact List (Roster) Sharing ENABLED.

 **ERROR** [Jetty-QTP-AdminConsole-78]: org.jivesoftware.openfire.container.PluginServlet - java.lang.NoSuchMethodError: 'boolean org.jivesoftware.openfire.user.UserManager.isRegisteredUser(java.lang.String)'
javax.servlet.ServletException: java.lang.NoSuchMethodError: 'boolean org.jivesoftware.openfire.user.UserManager.isRegisteredUser(java.lang.String)'

![image|281x500](upload://2qKezGZhkdN1UxHKBi99IawY0Ek.png)

ERROR [Jetty-QTP-AdminConsole-78]: org.jivesoftware.openfire.container.PluginServlet - java.lang.NoSuchMethodError: 'boolean org.jivesoftware.openfire.user.UserManager.isRegisteredUser(java.lang.String)'
javax.servlet.ServletException: java.lang.NoSuchMethodError: 'boolean org.jivesoftware.openfire.user.UserManager.isRegisteredUser(java.lang.String)'
        at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:657) ~[apache-jsp-9.0.52.jar:9.0.52]
        at org.jivesoftware.openfire.plugin.justmarried.married_jsp._jspService(married_jsp.java:173) ~[?:?]
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) ~[apache-jsp-9.0.52.jar:9.0.52]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:590) ~[jetty-servlet-api-4.0.6.jar:?]
        at org.jivesoftware.openfire.container.PluginServlet.handleJSP(PluginServlet.java:446) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.jivesoftware.openfire.container.PluginServlet.service(PluginServlet.java:106) ~[xmppserver-4.9.2.jar:4.9.2]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:590) ~[jetty-servlet-api-4.0.6.jar:?]
        at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1419) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1665) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:174) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:299) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129) ~[sitemesh-2.4.2.jar:?]
        at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77) ~[sitemesh-2.4.2.jar:?]
        at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:73) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:49) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:174) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:299) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:210) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.jivesoftware.admin.ContentSecurityPolicyFilter.doFilter(ContentSecurityPolicyFilter.java:53) ~[xmppserver-4.9.2.jar:4.9.2]
        at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:527) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131) ~[jetty-server-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:598) ~[jetty-security-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122) ~[jetty-server-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:223) ~[jetty-server-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1570) ~[jetty-server-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221) ~[jetty-server-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1384) ~[jetty-server-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176) ~[jetty-server-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484) ~[jetty-servlet-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1543) ~[jetty-server-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174) ~[jetty-server-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1306) ~[jetty-server-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129) ~[jetty-server-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149) ~[jetty-server-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:141) ~[jetty-server-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122) ~[jetty-server-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.server.Server.handle(Server.java:563) ~[jetty-server-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.server.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1598) ~[jetty-server-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:753) ~[jetty-server-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:501) ~[jetty-server-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:287) ~[jetty-server-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:314) ~[jetty-io-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100) ~[jetty-io-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:558) ~[jetty-io-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:379) ~[jetty-io-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:146) ~[jetty-io-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100) ~[jetty-io-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53) ~[jetty-io-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:421) ~[jetty-util-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:390) ~[jetty-util-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:277) ~[jetty-util-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:199) ~[jetty-util-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:411) ~[jetty-util-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:969) ~[jetty-util-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1194) ~[jetty-util-10.0.18.jar:10.0.18]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1149) ~[jetty-util-10.0.18.jar:10.0.18]
        at java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: java.lang.NoSuchMethodError: 'boolean org.jivesoftware.openfire.user.UserManager.isRegisteredUser(java.lang.String)'
        at org.jivesoftware.openfire.plugin.married.JustMarriedPlugin.addNewUserToOthersRoster(JustMarriedPlugin.java:148) ~[?:?]
        at org.jivesoftware.openfire.plugin.married.JustMarriedPlugin.copyRoster(JustMarriedPlugin.java:127) ~[?:?]
        at org.jivesoftware.openfire.plugin.married.JustMarriedPlugin.changeName(JustMarriedPlugin.java:50) ~[?:?]
        at org.jivesoftware.openfire.plugin.justmarried.married_jsp._jspService(married_jsp.java:137) ~[?:?]
        ... 71 more

UPDATE:
same behaviour when try to copy test user test21 with manual rosters.

image

Thanks for reporting this, and apologies for taking so long to resolve these issues.

I’ve been working on a potential fix. Can you please use the 1.3.0 SNAPSHOT version (that can be downloaded here) to see if this resolves your issues?

Thank you for quick fix. I can confirm your 1.3.0 SNAPSHOT worked like a charm.

1 Like