Page 1 of 1

Including "/" in Username (legalized)

Posted: 2016-12-06 14:46
by scepterholders
Please how do I make "/" to be part of my username for example "2016/GD1234/P"

Re: Including "/" in Username (legalized)

Posted: 2016-12-07 22:43
by peebee
Regex is not my thing and this is not tested but I think it should work....

Find the following in admin/incFuntions.php (around line 719 in Appgini V5.51)

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 this regex part of that code to include your forward slash [a-z0-9][a-z0-9 _.@]

like so: [a-z0-9][a-z0-9 \/_.@]

If that doesn't work, there are tools for checking regular expressions, like this one: https://regex101.com