min value username

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
Daniel
Posts: 1
Joined: 2016-06-27 13:15

min value username

Post by Daniel » 2016-06-27 13:31

Using AppGini 5.50

Found various posts about max user name etc. but I need to allow usernames from 1 to 999 ...
Was trying to find out which settings / php file restricts user names >4 char, but was not yet able to determine...

Regards, Daniel

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 352
Joined: 2013-03-21 04:37

Re: min value username

Post by peebee » 2016-06-28 08:45

Try this:

In admin/incFunctions.php find the following code (around line 715 in V5.50)

Code: Select all

function is_allowed_username($username){
		$username = trim(strtolower($username));
		if(!preg_match('/^[a-z0-9][a-z0-9 _.@]{3,19}$/', $username) || preg_match('/(@@|  |\.\.|___)/', $username)) return false;
		if(sqlValue("select count(1) from membership_users where lcase(memberID)='{$username}'")) return false;
		return $username;
	}
Edit the {3,19} part of the regular expression to be {0,19} and that should permit a minimum of 1 character and a maximum of 20.

I think that should do it to allow for usernames from 1 to 999 (assuming you mean the numbers 1 to 999 and not 999 character long usernames).....?

Post Reply