powered by Jive Software

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.

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

Cheers mate! :+1::slightly_smiling_face: