|
|
|
@ -111,18 +111,19 @@ if (isset($_REQUEST["username"]) && isset($_REQUEST["email"])) {
|
|
|
|
|
$name = trim($_REQUEST["username"]);
|
|
|
|
|
if ($name == "")
|
|
|
|
|
$message .= "<li>fill in your desired username</li>\n";
|
|
|
|
|
else {
|
|
|
|
|
if ($name != "" && strlen($name) < 2)
|
|
|
|
|
$message .= "<li>username is too short (2 character min)</li>\n";
|
|
|
|
|
|
|
|
|
|
if (strlen($name) > 32)
|
|
|
|
|
$message .= "<li>username too long (32 character max)</li>\n";
|
|
|
|
|
|
|
|
|
|
if ($name != "" && strlen($name) < 2)
|
|
|
|
|
$message .= "<li>username is too short (2 character min)</li>\n";
|
|
|
|
|
if (strlen($name) > 32)
|
|
|
|
|
$message .= "<li>username too long (32 character max)</li>\n";
|
|
|
|
|
|
|
|
|
|
if (strlen($name) > 1 && !preg_match('/^[a-z][a-z0-9]{1,31}$/', $name))
|
|
|
|
|
$message .= "<li>username contains invalid characters (lowercase only, must start with a letter).</li>\n";
|
|
|
|
|
if (strlen($name) > 1 && !preg_match('/^[a-z][a-z0-9]{1,31}$/', $name))
|
|
|
|
|
$message .= "<li>username contains invalid characters (lowercase only, must start with a letter).</li>\n";
|
|
|
|
|
|
|
|
|
|
if (posix_getpwnam($name) || forbidden_name($name))
|
|
|
|
|
$message .= "<li>sorry, the username $name is unavailable</li>\n";
|
|
|
|
|
if (posix_getpwnam($name) || forbidden_name($name))
|
|
|
|
|
$message .= "<li>sorry, the username $name is unavailable</li>\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Check the e-mail address.
|
|
|
|
|
$email = trim($_REQUEST["email"]);
|
|
|
|
@ -135,7 +136,7 @@ if (isset($_REQUEST["username"]) && isset($_REQUEST["email"])) {
|
|
|
|
|
elseif ($result["email"] != $email)
|
|
|
|
|
$message .= "<li>invalid email address. did you mean: " . htmlspecialchars($result["email"]) . "</li>";
|
|
|
|
|
|
|
|
|
|
elseif (forbidden_email($email)) {
|
|
|
|
|
elseif ($name != "" && forbidden_email($email)) {
|
|
|
|
|
$message .= "<li>your email is banned!</li><br />";
|
|
|
|
|
add_ban_info($name, $email);
|
|
|
|
|
}
|
|
|
|
|