Trigger on username-change

Events happening in the community are now at Drupal community events on www.drupal.org.
DruKaz's picture

I want my users to be able to change their username once.
When they register, they have a role that allows them to change their username.
If they change their own username, the role would be removed and that way they can no longer change their username.

I however can't find how to make a rule that is triggered by a username change. I guess it's part of the "when user details change", but I just can't seem to find anywhere how to check if it was the username that got changed.

Anyone any ideas?

Comments

Textual comparison!

itangalo's picture

The function you're looking for is the "Textual comparison", where you can compare user name in the saved and unsaved content.
Add this as a condition, and then use the DO part to revoke a role. You'll have use of Token, if you didn't already have that module installed.

Good luck!
//Johan Falk, NodeOne, Sweden

Thank you. It works now. I

DruKaz's picture

Thank you. It works now. I was already wondering what was meant with "unchanged account".

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: