vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Restrict usernames to alphanumeric and underscore (https://vborg.vbsupport.ru/showthread.php?t=106877)

Reynaldovb 01-31-2006 10:00 PM

Restrict usernames to alphanumeric and underscore
 
This is a vB 3.5.x port of the same mini mod.
( https://vborg.vbsupport.ru/showthread.php?t=73559 )

What is this Plugin about?

Are you tired of seeing in your forums usernames like these?:
1.- The Super Boy (spaces)
2.- my_new_name (underscore abuse)
3.- im?a??nd?b?ar (international characters)

Well, with this simple addon you can prevent that from happening from now on (it can't correct already spoiled usernames). When a user tries to register using one of those chars, a nice error message makes sure the user picks another "normal" name.

Installation instructions
1.- Download the attached .xml
2.- Go to Admin Control Panel => Plugin System => Manage Products => Add/Import Product => and browse for the the location where you downloaded the .xml
3.- Hit Import
4.- To configure it (not really needed, but it is there), go to Vbulletin Forum Options => Restrict Usernames on registration

By default this addon prevents spaces and any char other than numbers and (english) letters while allowing underscore.

**
Fixed to work with 3.6.8 and 3.7

Reynaldovb 02-01-2006 07:09 AM

--- This space left intentionally blank ---

redspider 02-01-2006 07:12 AM

I got some new members that been using emails as user name would this block the @ symbol?
thank you

Reynaldovb 02-01-2006 07:24 AM

Quote:

Originally Posted by redspider
I got some new members that been using emails as user name would this block the @ symbol?
thank you

Yes, by default it would block anything but letters a-z, numbers, and the underscore. Anything else and the user gets an error message asking him to modify his username.

In short: yes, it would block the @ symbol as well the dot used in .com|.net

redspider 02-01-2006 07:28 AM

thank you.

hiiped 02-01-2006 08:57 AM

good job

thanks

xswrex 02-01-2006 09:38 AM

thank you, simple yet effective.

installed !!!

Snake 02-01-2006 10:22 AM

I've it installed on my forums. Thanks!

duplu 02-01-2006 10:27 AM

Thanks, just what I needed. I have another piece of software which feeds usernames off of the vbulletin user file and it doesn't like non-alphanumeric characters in the username - so this will be ideal.

Reynaldovb 02-01-2006 03:42 PM

I remember when I moved from Xoops to vBulletin I wanted to start clean and "correct" those names with non alphanumeric chars, so I made an small tool that checked every name and if it didnt comply, changed it to normal standards.

It was a brute and ugly tool, but it did the job. After that I emailed all the users in the forum letting them know that some of them had their name changed, and included their current name in the email (vBulletin mailing system).

If you would want me to release that tool, I would be glad to help you get your forums "clean". LOL

the Sandman 02-01-2006 03:53 PM

How does this interact with the default User Registration Options > Illegal User Names settings? I have some names and symbols in there already. Should I just leave them there? Remove the symbols and leave the words?

Reynaldovb 02-01-2006 04:02 PM

Quote:

Originally Posted by the Sandman
How does this interact with the default User Registration Options > Illegal User Names settings? I have some names and symbols in there already. Should I just leave them there? Remove the symbols and leave the words?

As far as I know, that option is to prevent users from registering certain names, like "support", "password", "system" etc etc

This mod goes beyond that. You can still enter names on that vB setting, but the mod will prevent people from using any symbols that you hadnt explicity allowed (through the mod options).

the Sandman 02-01-2006 04:26 PM

Quote:

Originally Posted by Reynaldovb
As far as I know, that option is to prevent users from registering certain names, like "support", "password", "system" etc etc

This mod goes beyond that. You can still enter names on that vB setting, but the mod will prevent people from using any symbols that you hadnt explicity allowed (through the mod options).

It works for symbols as well - you just enter them one at a time with a space between them. There are two problems with using the default system for symbols though - you have to list them all, and if the user tries to register using one of them they don't get a message telling them why - they think the username is taken. So your solution is definitely better. I was just wondering how the two systems interact - which is checked first, yours or the default?

BTW, here's what I currently have in my default illegal username field:
Code:

admin moderator ' ! @ # $ % ^ &* ( ) + | - = \ { [ } } : ; ' " < , > ? / ~ ` ' www .com
I suppose I should remove all the symbols and leave the words?

Reynaldovb 02-01-2006 04:34 PM

I have no idea, which one goes first. It would probably be the best idea to delete the symbols and leave just names there.

the Sandman 02-01-2006 04:41 PM

Quote:

Originally Posted by Reynaldovb
I have no idea, which one goes first. It would probably be the best idea to delete the symbols and leave just names there.

I did a test before removing the symbols from my default illegal user name field - the default system comes first FWIW.

Thanks! Great hack!

Tk1 02-01-2006 06:29 PM

Thanks alot Reynaldovb!
That was pretty quick of you to come up with the port! :D

Very Happy!!

XFSImperial 02-02-2006 01:55 AM

Thanks, I've been wanting something like this to block out all the annoying symbols people manage to find.

*installs*

sportsoutlaw 02-02-2006 12:39 PM

Does this plugin allow you to use 1 underscore and just prevent the use of multiple underscores?

Reynaldovb 02-02-2006 03:36 PM

Quote:

Originally Posted by sportsoutlaw
Does this plugin allow you to use 1 underscore and just prevent the use of multiple underscores?

Hmmm. not really, people can use the allowed chars multiple times. I guess that is an idea for a next version ;-)

By the way, did you mean multiple underscores like this:
my_nick_name

or like this:

my___nickname

moonclamp 02-02-2006 04:38 PM

What happens to users who already have illegal characters? Will they still be able to login or update their info?

Reynaldovb 02-02-2006 04:43 PM

Quote:

Originally Posted by moonclamp
What happens to users who already have illegal characters? Will they still be able to login or update their info?

This mod only affects future registrations. Existing users would have to have their names changed.

If I remember correctly, I think I saw somewhere a piece of Search and Replace SQL code you could use to do a massive search and replace. Of course you would be wise to back up your database first and email the users letting them know about the change in their names.

moonclamp 02-02-2006 04:50 PM

Cool, I'm fine with the existing members, I just want to restrict people who use email addresses as usernames. Ideally I'd love to be able to stop people using all uppercase names too but I guess we can't have everything.

Also ... If I wanted to allow more than one character (EG ~ and -) would I seperate them with spaces or commas?

Anyway, thank you ... just installed :)

quanvo81 02-19-2006 07:54 PM

LOL
This is a cool hack.
You know what, I will creat alots more user names with space, @, uppercase....I think around hundreds of them, then install this hack.
The result is, the user names I created will be .... RARE . It means I can trade for something else if a member want that nick so bad . LOL, just like Yahoo ! rare nicks.
Lol, just a thought, I am not going have free time just to sit there and manual add users. But I will wait untill my board get busy and lots of users sign up, then I will installed this hack. At that time my board will be crazy with rare nicks trading.
thanks again.

ndahiya 03-02-2006 09:56 PM

installed. thanks!

Joey805 03-03-2006 06:27 PM

Works perfectly!

Thanks!

Nathan2006 03-16-2006 12:42 AM

Thank you

Install

HolisticEarth 04-12-2006 11:57 PM

Thank you for writing this plugin. It is a complete asset!

The default username restriction seems exceptionary while this system is inclusionary, meaning the default system lets you create exceptions for what you can register, while this system lets you include what can be registered.

This is much better IMO because people could keep finding characters that you haven't put on your ban list, and you would have to make an exception for each one.

It is very important for sites like mine which in the end will have MediaWiki integrated into it. MediaWiki can only allow printable characters in page names, and page names can be user names, so user names must be only printable characters. This hack solves the problem.

Again, thank you. Installed.

akanevsky 04-13-2006 12:49 AM

[HOW-TO] Allow Russian Letters

Option 1:
Type А-я in the "custom symbol box".

Option 2:
In register_addmember_process, FIND

Code:

$ru_searchpattern .= "]+/";
ADD BEFORE

Code:

$ru_searchpattern .= "А-я";

dan35 04-13-2006 05:23 AM

Thx! Installed :)

kj_ugs 06-15-2006 05:40 PM

this works on 3.5.4 and can be fully uninstalled right? sounds good to me.

Kronomancer 07-13-2006 05:05 PM

I get this in my template... "Could not find phrase 'username_invalidchars'."
3.6 beta 4... any help?

ndahiya 07-30-2006 04:10 PM

Quote:

Originally Posted by Kronomancer
I get this in my template... "Could not find phrase 'username_invalidchars'."
3.6 beta 4... any help?


so do i!!

magmf 10-20-2006 07:32 PM

Quote:

Originally Posted by Kronomancer
I get this in my template... "Could not find phrase 'username_invalidchars'."
3.6 beta 4... any help?

Me too

any solution ?

VbStudent1 10-25-2006 09:52 AM

I will throw my hat in here as well. Is there a fix? The error is coming about due to PHRASETYPEID which has been removed in versions 3.6.x. Everything else works well except for the error message. Someone may know enough about SQL to make the plugin point to the correct phrase. I am only a beginner but I wouldn't think it would be too difficult.

KatScript 03-09-2007 10:52 PM

I'm running version 3.6.5

I have attached my version.

or get the one from the download and do this:

Find:
Code:

eval('$userdata->errors[] = "' . fetch_phrase('username_invalidchars', PHRASETYPEID_ERROR) . '";');
Replace with:
Code:

$userdata->error('username_invalidchars');
Hope this helps someone.

RedGTiVR6 02-27-2008 04:55 PM

Anyone know if this has been done in 3.7?

Reynaldovb 02-27-2008 05:37 PM

I upgraded to 3.7 and it seems to be working, but I don't know if it would work on a brand new board. I would have to check and make the necessary corrections.

Reynaldovb 02-27-2008 05:54 PM

Working on a fix...

RedGTiVR6 02-27-2008 06:27 PM

Great! I'm just trying to go through all of my currently installed mods and see if they will work with 3.7 when we update.

Reynaldovb 02-27-2008 07:00 PM

Quote:

Originally Posted by RedGTiVR6 (Post 1452368)
Great! I'm just trying to go through all of my currently installed mods and see if they will work with 3.7 when we update.

The updated version works with both 3.6.8 and 3.7
I dont have 3.5 version or lower anymore so I cant guarantee if it works with those.


All times are GMT. The time now is 10:28 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01380 seconds
  • Memory Usage 1,819KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete