please fill in your desired username";
if (strlen($name) > 32)
$message .= "
username too long (32 character max)";
if (!preg_match('/^[a-z][a-z0-9]{2,31}$/', $name))
$message .= "username contains invalid characters (lowercase only, must start with a letter)";
if ($_REQUEST["sshkey"] == "" || mb_substr($_REQUEST["sshkey"], 0, 4) !== "ssh-")
$message .= 'ssh key required: please create one and submit the public key. '
. 'see our ssh wiki or '
. 'hop on irc and ask for help';
if ($_REQUEST["interest"] == "")
$message .= "please explain why you're interested so we can make sure you're a real human being";
if (posix_getpwnam($name) || forbidden_name($name))
$message .= "sorry, the username $name is unavailable";
// Check the e-mail address.
$email = trim($_REQUEST["email"]);
if ($email == "")
$message .= "please fill in your email address";
else {
$result = SMTP::MakeValidEmailAddress($_REQUEST["email"]);
if (!$result["success"])
$message .= "invalid email address: " . htmlspecialchars($result["error"]) . "";
elseif ($result["email"] != $email)
$message .= "invalid email address. did you mean: " . htmlspecialchars($result["email"]) . "";
}
// no validation errors
if ($message == "") {
$msgbody = "
username: {$_REQUEST["username"]}
email: {$_REQUEST["email"]}
reason: {$_REQUEST["interest"]}
makeuser {$_REQUEST["username"]} {$_REQUEST["email"]} \"{$_REQUEST["sshkey"]}\"
";
if (mail('root', 'new tilde.club signup', $msgbody)) {
echo '';
} else {
echo '
something went wrong... please send an email to
root@tilde.club with details of what happened
';
}
} else {
?>
please correct the following errors:
=$message?>