Jump to content

Minimum username length


Boomer12

Recommended Posts

Posted
6 minutes ago, superj707 said:

Max would be nice too.

There already is a max (members->profile->profile settings), but a minimum is really important too - for a start, it's more difficult to search for a member with a short name.

Posted
1 hour ago, Ahmad E. said:

For those who cannot wait: Username Minimum Lenght.xml

Nice one:) I hope i'm allowed to post some critique :)

This is changing only the core registration form; users created while the commerce checkout, users created via the acp and probably users created via login handlers won't have this check (not sure about the login handler users). I can garantee that this will cause troubles:D . Another issue is, that you're overwriting the whole username element. This will conflict with other hooks doing the same...

I would suggest to hook into \IPS\Helpers\Form\Text and to add your validation code direct  to this class when the accountUsername option is set

3. You've left some debugcode in your plugin ;)
$form->add( new \IPS\Helpers\Form\Text( 'test', NULL, TRUE, array( 'minLength' => \IPS\Settings::i()->usernameMinLength ?: 3 ) ) );

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...