Firefox PHP

Module: Username Restrictions

Posted by Maurice Makaay 
Module: Username Restrictions
May 18, 2007 06:31PM
This module implements features for enforcing user name restrictions. The module will check the user name at registration time and show an error to the user if the new username does not meet the restrictions.

Implemented features are:

* Minimum username length;
* Maximum username length;
* Configuration of valid characters for usernames;
* Only allow lower case characters for usernames.

These features can be separately enabled and disabled through the module's settings screen.

If you have additional ideas for username restrictions or if you translated the language file to a new language, then please post in this thread.

Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce

Edited 1 time(s). Last edit at 05/18/2007 06:44PM by mmakaay.
open | download - username_restrictions-1.0.0.tar.gz (3.8 KB)
open | download - (6.5 KB)
Re: Module: Username Restrictions
May 19, 2007 04:19PM
Hello Maurice,
this mod is a nice idea :-)
Min and max are very needed.

I have a problem with the languagefile: i can't type in an AMBERSAND "&". so i could not make an vallide german languagefile :-(

One idea: The first letter and letters follow a blank or hyphen only allows like Maurice Makaay or Jean-Claude van Damme


I speek swabian and german very well - not english :-(

My Phorum on []

My testfforum with version 5.2.x is on [] (user: Phorum password: Clever)
open | download - german_du.php (1.5 KB)
Re: Module: Username Restrictions
June 08, 2007 08:13AM
The problem lies in the register.php script, which does some superfluous html character escaping. I fixed this in the code, so the next Phorum release will have the fix in it. For now, you will have to open register.php and search for:
$PHORUM["DATA"]["ERROR"] = htmlspecialchars($error);
Replace this line with:
$PHORUM["DATA"]["ERROR"] = $error;
This change will fix your language file problems.

About the idea: I'll think about it. Maybe some rules like "must start with a letter", "must end with a letter" and "no more than one special character in a row" could be useful for this.

Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Username Restrictions
June 12, 2007 09:47AM
Hi Maurice, Hi Berti,

the German Language Files Package 1.3 supports now also the Username Restrictions Module.

@Maurice: perhaps you want to include the attached files in your distribution.


Using Phorum since 7/2000: (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.

Edited 1 time(s). Last edit at 06/12/2007 10:12AM by Oliver Riesen.
open | download - german.php (1.7 KB)
open | download - german-du-female.php (1.5 KB)
open | download - german-du-male.php (1.5 KB)
Re: Module: Username Restrictions
February 29, 2008 08:59AM
hi all,

i've installed phorum 5.2 and activated the mod username restrictions. it seems, that it is not possible to limit the minimum
username length and let the maximum length unlimited. if i set a number greater than 0 for the min length and a 0 for the max number, the max number is changed from 0 to the min length setting.
to avoid that behaviour, line 31ff of settings.php should be changed from

if ($settings["max_length"] < $settings["min_length"]) {
$settings["max_length"] = $settings["min_length"];


if (($settings["max_length"] < $settings["min_length"]) && ($settings["max_length"] != 0))
$settings["max_length"] = $settings["min_length"];

or something similar.
Re: Module: Username Restrictions
February 29, 2008 09:36AM
I added the patch in changeset 3141. Please check if this one fixes it for you. I currently had no time to test the changes out (I'm at a conference and sneaked the update into the tree ;-).

Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Module: Username Restrictions
October 07, 2013 09:17PM
Please note that v. 1.0.2 of the "Username Restrictions" mod is included in Phorum v. 5.2.19. Thanks for that!!

However, say you don't want <swear word> to appear in user names, you can now prevent it with v. 1.0.3 of this "Username Restrictions" mod - attached hereto - mod of the mod coded by Skinny. It was a small mod - no biggie - but can prevent yucky user names or user names resembling things like "admin" or "<domain>" or whatever you want.

For example, should someone try and register with foo<swear word>bar or big<swear word> or <swear word>bad, and <swear word> is on your word bit list, said user won't be able to register and instead will be told...

"<swear word>" was found in your username but is not allowed. Please choose something else.

open | download - (7.8 KB)
Re: Module: Username Restrictions
January 13, 2014 06:06PM
Hello All,

I realized this is an old version but I still use it. I have translated it in French, for those interested.

Please not that on my system, I had to replace &quot; with the real ", in the language file so it would correctly show on my forum.


open | download - french.php (1.2 KB)
Sorry, only registered users may post in this forum.

Click here to login