Username Restrictions – my first Mura plugin

One of the great things about Mura – much like Mango – is its extensibility via its plugin architecture.

The basic user validation in Mura doesn’t do much in the way of checking a username. It’s required, and it cannot be the same as an existing username. That’s as far as it goes.

If you have forums, or other public displays of usernames, you probably don’t want users registering with a name containing “admin” or your company or product name. And one-letter usernames aren’t great, either.

So, wanting a bit more, I set about writing a plugin – and just a few hours later, here it is, ready for release into the wild.

The Username Restrictions plugin (sorry, not a very snappy title, but it does what it sayson the tin) allows you to define a list of restricted usernames. There are actually two lists – one of simple, full usernames; the other is a list of regular expressions to try against the username. If it matches an item on either list, the username will not be allowed.

It’s possible you already have registered users with usernames that violate your newly-applied rules. You can choose whether these users have to change their username when they update their profile, or whether the rules will only be enforced if they actually try to change their username to a new one.

You can also set a minimum length of username, avoiding those one-letter names. And of course, if you are logged in with administrative privileges, all the plugin’s restrictions are bypassed – you can set whatever username you like.

You can find the source code on the plugin’s github repository, and you can download the plugin here.

 

Comments

Andrew

Hello - this sounds like a sweet plugin! I just deployed it to a site I'm working on, and I set everything I wanted up in the plugin settings (restricted usernames and regex's, and char limits), but it doesn't seem to be working - do I need to edit the standard dsp_edit_profile.cfm (or any custom sign-up forms i've made) to get this to work?

Thanks!

Andrew

31 July 2010, 04:53
Reply
Post a Comment
  1. Leave this field empty

Required Field