Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Signup Validation Settings Not Working
xifekobo
New
Hi, I'm trying to limit the character usernames signup on my forum, but when I set it using one of the tutorials found here, it still does not apply and says 3-20. I set it below 10. I tried both the array(3,10) and {3,10} method but no luck.
Please help.
Tagged:
0
Comments
should we guess which ones you looked at and "didn't work" , or do you want to provide links. than you can be advised.
Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.
for the english language this is one way.
Changes message that appears
in conf/locale.php add this.
$Definition['UsernameError'] = 'Username can only contain letters, numbers, underscores, and must be between 5 and 10 characters long.';
https://vanillaforums.org/discussion/comment/207043#Comment_207043
https://vanillaforums.org/discussion/26597/tutorial-how-to-change-wording-how-to-change-text-how-to-change-language-how-to-change-locale/p1
Validates between 5 and 10
in conf/config.php
$Configuration['Garden']['User']['ValidationLength'] = "{5,10}";
https://vanillaforums.org/discussion/comment/218973/#Comment_218973
Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.
thanks I think all tutorials have the same solution as it is one key like that but with different combinations that I mentioned above.
I tried the bracket and array type. Though I did not put the UserNameError message, is that required? afaik know that is only for displaying.
well the translation is for displaying, that is what I tried to say. translation displays. config statement validates.
you could make this easier!
-what language are you using? english? what user name did you try! please provide a specific example.
$Configuration['Garden']['User']['ValidationRegex']
? if so, what?you could temporarily debug here
https://github.com/vanilla/vanilla/blob/Vanilla_2.2.1/library/core/functions.validation.php#L254
by inserting
var_dump($ValidateUsernameRegex);
die();
then printing your result and then removing the two lines.
non -intrusive test
alternatively you could create a regextext.php file and run it from your web browser.
then post the results.
Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.
Thanks. Of course English and I already changed it, here's my settings on that part:
For now I only would like to set a preferred username limit like this:
my sample is just entering 2 chacters username, when I entered a valid email correctly, the 2 char username also validates. This is becoming a bit of a problem now for me
Ok I will try the debugging there.
Are there any plugins that can do this for a forum? like min-max characters. tickers for uppercase, lowercase then numbers.. etc.
too complicated for a normal owner and I should point out again that the default messages says 3 char minimum whereas I already tested it validates for 2 only. That's a bug right there unless you have typo on the message.