miniBB ®  
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
How To miniBB Support Forums / How To /   

Limit username length to minimum 2 characters (also as the maximum)

Author Patrick
Guest
#1 | Posted: 9 Sep 2005 10:43 
Hi which file has the information on how many characters a username can have. Right now, i believe you need to have more than 3 letters i'd like to set this to 2 letters.

Author Team
8-)
#2 | Posted: 9 Sep 2005 10:44 
bb_func_checkusr.php

Change $userRegExp="#^[".$userRegName."]{3,40}\$#";

istead of "3" type "2".

Author michael1234
Registered
#3 | Posted: 15 Aug 2006 19:28 
Any way to limit the amount of letters in a username?

Author Paul
Lead Developer
#4 | Posted: 16 Aug 2006 08:03 
user_dataform.html - limit maxlength of the login field here.
bb_func_checkusr.php - limit {3,40} to {3,MAXLENGTH} here.

Author michael1234
Registered
#5 | Posted: 18 Aug 2006 01:26 
Thank you Paul.

Author otto
Registered
#6 | Posted: 2 Feb 2007 07:18 
Thank you Paul.

Author Paul
Lead Developer
#7 | Posted: 2 Feb 2007 11:32 
My little addition - if you change the script above, it will be still a core-destructive solution.

However, it's more than simple to change "login" field's maxlength in templates/user_dataform.html for example, also as "user_usr" in templates/user_login_form.html. Of course an experienced "hacker" will be able to register longer username, if you don't change bb_func_checkusr.php. But for 95% of users it won't be an easy and even possible task ;-)

Author Prince
Registered
#8 | Posted: 17 Jul 2012 16:04 
I think there is a bug for bb_func_checkusr!

I set this $umin=4; and $umax=14; but they still can register with 15 character, and also in dataform they still can enter 15 even $umax is 14.

I'm using new version.. any one got same issue or can help?

Author Prince
Registered
#9 | Posted: 17 Jul 2012 16:15 
Ok found it.. it was in Index.. and made it to 14 now :)

Author Paul
Lead Developer
#10 | Posted: 19 Jul 2012 18:33 | Edited by: Paul 
From the manual:

//$uname_minlength=3; non-mandatory option (not available by default). Non-destructively specifies the minimum username length upon registration.
//$uname_maxlength=40; non-mandatory option (not available by default). Non-destructively specifies the maximum username length upon registration.

You may try to add/unslash these settings in setup_options.php without destroying the most important core file.

Author Prince
Registered
#11 | Posted: 19 Jul 2012 19:57 
Paul:
You may try to add/unslash these settings in setup_options.php without destroying the most important core file.

Thanks for that :)

How To miniBB Support Forums / How To / Limit username length to minimum 2 characters (also as the maximum) Top
Your Reply Click this icon to move up to the quoted message
 Short link for this topic:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
  Extend your miniBB-forums, attaching the images and files,
get the File and Picture Attachments add-on!
Galleries / Attachments Addon for miniBB