Page 1 of 1

min value username

Posted: 2016-06-27 13:31
by Daniel
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

Re: min value username

Posted: 2016-06-28 08:45
by peebee
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).....?