From 5db8118b173d9ff0c4bc2d2c55e72967090ad991 Mon Sep 17 00:00:00 2001 From: Ben Morrison Date: Tue, 30 Jun 2020 00:31:04 -0400 Subject: reducing use of php in favor of shellscript build --- html/submit.php | 144 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100755 html/submit.php (limited to 'html/submit.php') diff --git a/html/submit.php b/html/submit.php new file mode 100755 index 0000000..1b297e8 --- /dev/null +++ b/html/submit.php @@ -0,0 +1,144 @@ + + + + tilde.institute :: Sign Up + {{HEADER}} + + +
+ {{LOGONAV}} +
+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 (isTaken($name) || forbidden_name($name) || bannedUsers($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 + + // remember: + $username = $_REQUEST["username"]; + $email = $_REQUEST["email"]; + $interest = $_REQUEST["interest"]; + $sshkey = $_REQUEST["sshkey"]; + + $newuserfile = fopen("newusers.dat", "a"); + fwrite($newuserfile, "$username $email \"$sshkey\"\n\n"); + fclose($newuserfile); + $fuzzyfile = fopen("fuzzies.log", "a"); + fwrite($fuzzyfile, "$username $email $interest\n"); + fclose($fuzzyfile); +?> + +

    Thank you for signing up! Please allow up to 24 hours for an account to become active. If you have any questions or issues, please email admins@tilde.institute.

    + + + + +
    +
    + + -- cgit 1.4.1-2-gfad0