News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Auto Verification

Started by live627, January 10, 2010, 12:19:06 PM

Previous topic - Next topic

live627

Might be a mod conflict. Can you list your mods please?

Max22

#21
I suggest to implement a 'minimum username lenght' check:
http://www.simplemachines.org/community/index.php?topic=179439.0
http://www.simplemachines.org/community/index.php?topic=278230.0

I think there is no sense to register an username with a lenght inferior to 3 characters.
Auto verification could potentially increase new registrations with shorter usernames, due to username availability check.

Max22

Quote from: Max22 on June 15, 2011, 07:25:03 PM
I think there is no sense to register an username with a lenght inferior to 3 characters.

I implemented successfully the minimum username check:

Find:

// Clean it up like mother would.
$context['checked_username'] = preg_replace('~[\t\n\r\x0B\0' . ($context['utf8'] ? ($context['server']['complex_preg_chars'] ? '\x{A0}' : "\xC2\xA0") : '\xA0') . ']+~' . ($context['utf8'] ? 'u' : ''), ' ', $context['checked_username']);
if (strlen($context['checked_username']) > 25)
$context['checked_username'] = strip_tags(substr($context['checked_username'], 0, 25));


After:
      
if (strlen($context['checked_username']) < 3)
$context['valid_username'] = false;



Now I'm doing an integer check like this:

if (is_int($context['checked_username']))
$context['valid_username'] = false;


But it doesn't work. What am I doing wrong?

Thank you for any help.

Max22

I'd appreciate an help for anyone knows php.

live627

if (is_numeric($context['checked_username']))
$context['valid_username'] = false;

Biology Forums

#25
Could someone make this work for forums that allow guests to make posts?

When guest posting is enabled, they are not allowed to choose a username that has already been taken. Instead of going through multiple tries, this mod could easily tell the guest if the username is good to use.

Please let me know.

live627

* live627 is a cow. The cow has no idea what thee problem is.

Biology Forums

In my forum, guests are allowed to post. A guest *must* enter their username before posting. If they choose a name that is already taken by a member and they click "Post", an error will come up saying that the username is already taken, please try again.

I was asking if this mod could be applied to the post.template so that a guest realizes before clicking "Post" that the name they choose is taken already. Instead of going through multiple tries and clicking "Post", this mod could easily tell the guest if the username is good to use.

Could anyone do this for me?

KitchM

I'm not sure you have described what the mod does.  Does it check the input on some sort of list somewhere?

Arantor

No. It does what SMF 2.0 does: checks the username is available, checks password is sufficiently long and stuff.

You only need it if you are still using 1.1.x.

Advertisement: