Registration Name Restriction

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Post Reply
Adric
Registered User
Posts: 40
Joined: Tue Feb 15, 2005 10:15 pm

Registration Name Restriction

Post by Adric »

If this is considered a feature request, then please ignore it. I am the webmaster for a WoW guild, and I love the fact that we can now restrict people from using spacers in their names, as WoW doesn't allow this anyway. However, WoW also does not allow numerical characters. If it is easy enough, would it be possible to add a setting to the drop-down box to only allow alphabetical characters? I know that this would be a big help to probably all guilds of any MMORPGs that only allow their members to register under their characters in-game name, and any one else who gets sick of seeing members named jessie23. I would imagine that this would be simple enough, but i really don't want this to be a mod unless absolutely nescissary(sp).

User avatar
Dr.Death
Registered User
Posts: 25
Joined: Thu Feb 24, 2005 10:33 am
Location: Germany
Contact:

Re: Registration Name Restriction

Post by Dr.Death »

It would be easy to "MOD" this later....

Take a closer look at

Code: Select all

#
# OPEN 
#
/includes/acp/acp_board.php

#
# SEARCH
#

	/**
	* Allowed chars in usernames
	*/
	function select_username_chars($selected_value, $key)
	{
		global $user;

		$user_char_ary = array('USERNAME_CHARS_ANY' => '.*', 'USERNAME_ALPHA_ONLY' => '[\w]+', 'USERNAME_ALPHA_SPACERS' => '[\w_\+\. \-\[\]]+');
		$user_char_options = '';
		foreach ($user_char_ary as $lang => $value)
		{
			$selected = ($selected_value == $value) ? ' selected="selected"' : '';
			$user_char_options .= '<option value="' . $value . '"' . $selected . '>' . $user->lang[$lang] . '</option>';
		}
		return $user_char_options;
	}
Doc.

Image

Adric
Registered User
Posts: 40
Joined: Tue Feb 15, 2005 10:15 pm

Re: Registration Name Restriction

Post by Adric »

*Is Lost* Couldn't make heads or tails of that.

agent00shoe

Re: Registration Name Restriction

Post by agent00shoe »

The quickest way to do it would be something like changing

Code: Select all

'USERNAME_ALPHA_ONLY' => '[\w]+'
to

Code: Select all

'USERNAME_ALPHA_ONLY' => '[A-Za-z]+'
in that snippet a couple posts up then use the alpha only setting in the ACP. That will make the alpha only setting exclude numbers.

In short, it would be a very simple mod that you could do yourself. :D

Slim Vision
Registered User
Posts: 23
Joined: Thu Jan 19, 2006 6:29 pm
Location: The Universe

Re: Registration Name Restriction

Post by Slim Vision »

Hmm, if you didn't want to modify any code, you could go into the Disallow usernames section of the Users and Groups tab in ACP and add 10 usersnames like;

*1*
*2*
*3*
etc.

That way if someone tried to register with any numbers it won't allow them. Considering the time it'd take you to locate the code in the right file, modify/add to it, then reupload, it'd probably be just as quick to do it that way instead.
Slim Vision

Uchiha Nick
Registered User
Posts: 397
Joined: Tue Jul 20, 2004 6:21 am
Location: Rotterdam, The Netherlands
Contact:

Re: Registration Name Restriction

Post by Uchiha Nick »

dont forget about updating the lang files as well- they need to know before hand it isnt possible to use nummerical characters.
Image

User avatar
Dr.Death
Registered User
Posts: 25
Joined: Thu Feb 24, 2005 10:33 am
Location: Germany
Contact:

Re: Registration Name Restriction

Post by Dr.Death »

@Slim Vision: That's a really good hint ! I forgotten the "Disallow usernames" section in acp ;-)
Doc.

Image

Adric
Registered User
Posts: 40
Joined: Tue Feb 15, 2005 10:15 pm

Re: Registration Name Restriction

Post by Adric »

adding "1" "2" "3" ... "9" "0" to the dissallow usernames will still allow people to register under blah1 or susie26, wouldn;t it?

agent00shoe

Re: Registration Name Restriction

Post by agent00shoe »

Adric wrote: adding "1" "2" "3" ... "9" "0" to the dissallow usernames will still allow people to register under blah1 or susie26, wouldn;t it?

Not if you add an asterisk as a wild card around them like *1*, *2* etc. Or you could do it the hard way, like Dr. Death and I suggested. ;)

Adric
Registered User
Posts: 40
Joined: Tue Feb 15, 2005 10:15 pm

Re: Registration Name Restriction

Post by Adric »

lol, I keep forgetting about the wildcard option...

Post Reply