please fill in your desired username";
if (strlen($name) > 32)
$message .= "
username too long (32 character max)";
if (!preg_match('/^[A-Za-z][A-Za-z0-9]{2,31}$/', $name))
$message .= "username contains invalid characters (lowercase only, must start with a letter)";
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"]) . "";
}
if ($_REQUEST["sshkey"] == "") {
$message .= "ssh key required: please create one and submit the public key";
}
if ($message == "") { // no validation errors
$msgbody = "
desired username: {$_REQUEST["username"]}
contact email: {$_REQUEST["email"]}
reason: {$_REQUEST["interest"]}
ssh key:
{$_REQUEST["sshkey"]}
sudo makeuser {$_REQUEST["username"]} {$_REQUEST["email"]} \"{$_REQUEST["sshkey"]}\"
";
if (mail('sudoers', 'new tilde.team signup', $msgbody)) {
echo '';
} else {
echo '
something went wrong... please send an email to
sudoers@tilde.team with details of what happened
';
}
} else {
?>
please correct the following errors:
=$message?>