Back to vBulletin 3.0 Add-Ons

Limited character set in usernames (Registration)
Mod Version: 1.00, by arpy

This modification is in the archives.
vB Version: 3.0.3 Rating: (0 vote - 0 average) Installs: 2
Released: 31 Dec 2004 Last Update: Never Downloads: 0
Not Supported  

I had the problem that I wanted to limit the possible usernames to a special set of characters - a regular expression.

Vb has only a function to disallow special characters, but this is not what I need, I wanted to have the first character is a char, other characters are char or numeric and the only special chars are "-" and "_".

Here is my solution I want to share with you:

Open register.php

find:
Code:
if (preg_match('/(?<!&#[0-9]{3}|&#[0-9]{4}|&#[0-9]{5});/', $_POST['username']))
replace with:
Code:
if (!preg_match('/^([a-zA-Z][a-zA-Z0-9-_]*)$/', $_POST['username']))
Change the phrase "username_semicolon" to an appropriate text.

That it

I don't want to give support for this hack, because most question will probably be about regex and I'm not a regex-guru and I don't think that there is any need for support - but I'll watch this thread.

arpy

EDIT:
I don't believe it - I've searched for a solution this morning, couldn't find anything and produced this hack - and now, a half hour ago Reynaldovb also released a very similiar hack here: http://www.vbulletin.org/forum/showthread.php?threadid=73559.
I didn't know about the thread he mentioned.

So please choose which hack meets your need best.

Download

No files for download.

Similar Mods

Add-On Releases Limited Guest Viewing -- Improve community registration rates vBulletin 3.6 Add-ons

vblts.ru supports vBulletin®, 2022-2024