Including "/" in Username (legalized)
-
- Posts: 1
- Joined: 2016-12-06 14:30
Including "/" in Username (legalized)
Please how do I make "/" to be part of my username for example "2016/GD1234/P"
Re: Including "/" in Username (legalized)
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)
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
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;
}
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