Commit b2e0e09f authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Added a function for validating that a username is valid for the system.

parent 2f1c2463
......@@ -608,4 +608,13 @@ function check_dir_exists($dir, $create=true, $recursive=true) {
return $status;
* Checks that a username is in valid form
* @todo need such a function for password too.
function validate_username($username) {
return preg_match('/^[a-zA-Z0-9_\.@]+$/', $username);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment