HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
username restriction
rloyola
New
Is there a way to restrict the allowed string in the username during registration in a custom plugin?
example: spaces, . etc are not allowed
0
Comments
Thank you!
Great posts, guys! Now is there any way to restrict predefined usernames?
You mean to prevent certain words to be ever registered as a username by somebody (without due permission)?
Yes, exactly!
You would need to add this function to your plugin or themehook, after the last closing curly bracket
TESTED, AND WORKS!!!
To make
$myBlackList
more configurable, make a config for it (comma-separated list of names, case does not matter!):If you are curious what the existing vanilla blacklist is:
Thanks a bunch, @donshakespeare! I appreciate your help. I'll try this out as soon as I can.
Cheers!
When you try it let us know how it goes.
I use SSO, so I have a custom solution from the mother site :)
UPDATE...
I went and tested the code, so I corrected a few things above. Works as expected now.
Any recommended changes since the release of 2021.003 in regards to the username blacklist?
@somerandomfellow You can also just add a ban rule for the user name to prevent it being registered.
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
@Bleistivt Where are the ban rules located?
I wondered if I could just append it as this method doesn't seem to work anymore.
See left side
@Kaspar You know what, didn't even realize the UI/Dashboard had a selection for username.
Thought it was just IP and email.
Nvm, although am still curious where the ban rules are in the directory as I'd like to change the alert/message users receive when being rejected.