untold4you
07-15-2005, 10:00 PM
In Reply to this thread: https://vborg.vbsupport.ru/showthread.php?t=92308
Only accept usernames with no special characters or spaces.
Database query:
Open up PhpMyAdmin, goto to your vbulletin database, run following query:
INSERT INTO setting ( varname , grouptitle , value , defaultvalue , optioncode , displayorder , advanced , volatile )
VALUES (
'az09characters', 'register', '1', '1', 'yesno', '101', '0', '1'
)
Phrases To Add:
Phrase Type: Front-End Error Messages
Varname: az09charactersonly
Text: Only characters A-Z, 0-9 may be used in usernames, no spaces, no special ascii-type letters.
Phrase Type: vBulletin Settings
Varname: setting_az09characters_title
Text: Disallow Special Characters
Phrase type: vBulletin Settings
Varname: setting_az09characters_desc
Text: Setting this to "yes" prevents users from using special characters or spaces in there user name.
File Modifications:
Open:
[forumroot]/register.php
Find:
// check username does not contain semi-colons
if (preg_match('/(?<!&#[0-9]{3}|&#[0-9]{4}|&#[0-9]{5});/', $_POST['username']))
{
//eval(print_standard_error('error_username_semicolo n'));
eval('$errors[10] = "' . fetch_phrase('username_semicolon', PHRASETYPEID_ERROR) . '";');
}
Above that add:
// Only A-Z, 0-9 Characters Only */
if ($vboptions['az09characters'])
{
if (!eregi("^[A-Za-z0-9]+$", $_POST['username']))
{
eval(print_standard_error('error_az09charactersonl y'));
}
}
Save:
register.php
Now users can not use special chars or spaces in their username when signing up.
To disable the function goto, Admin CP > vBulletin Options > User Registration Options.
Find the yes/no option under ?Disallow Special Characters ?
That's all, Gr3?Tz Untold....
Only accept usernames with no special characters or spaces.
Database query:
Open up PhpMyAdmin, goto to your vbulletin database, run following query:
INSERT INTO setting ( varname , grouptitle , value , defaultvalue , optioncode , displayorder , advanced , volatile )
VALUES (
'az09characters', 'register', '1', '1', 'yesno', '101', '0', '1'
)
Phrases To Add:
Phrase Type: Front-End Error Messages
Varname: az09charactersonly
Text: Only characters A-Z, 0-9 may be used in usernames, no spaces, no special ascii-type letters.
Phrase Type: vBulletin Settings
Varname: setting_az09characters_title
Text: Disallow Special Characters
Phrase type: vBulletin Settings
Varname: setting_az09characters_desc
Text: Setting this to "yes" prevents users from using special characters or spaces in there user name.
File Modifications:
Open:
[forumroot]/register.php
Find:
// check username does not contain semi-colons
if (preg_match('/(?<!&#[0-9]{3}|&#[0-9]{4}|&#[0-9]{5});/', $_POST['username']))
{
//eval(print_standard_error('error_username_semicolo n'));
eval('$errors[10] = "' . fetch_phrase('username_semicolon', PHRASETYPEID_ERROR) . '";');
}
Above that add:
// Only A-Z, 0-9 Characters Only */
if ($vboptions['az09characters'])
{
if (!eregi("^[A-Za-z0-9]+$", $_POST['username']))
{
eval(print_standard_error('error_az09charactersonl y'));
}
}
Save:
register.php
Now users can not use special chars or spaces in their username when signing up.
To disable the function goto, Admin CP > vBulletin Options > User Registration Options.
Find the yes/no option under ?Disallow Special Characters ?
That's all, Gr3?Tz Untold....