Adding contact form stuff

This commit is contained in:
Ubergeek 2019-07-13 11:01:11 -04:00
parent 56f603c1ad
commit ca1961bcc2
7 changed files with 93 additions and 15 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.swp

View File

@ -1,16 +1,17 @@
If you have any questions or problems relating to our service, or this website, please fill in the form below. Be sure to include a contact name, email address, subject line and your message below. Once you've filled in the form, click on the send button; the message will be sent and you'll receive a response within a reasonable amount of time.
<form action='/includes/email.php'>
Contact Name: <input type='text' name='contact_name'><br>
Email Address: <input type='text' name='email_address'><br>
Subject:
<form action='/includes/contact.php'>
<table>
<tr><td>Contact Name:</td> <td> <input type='text' name='contact_name'><br></td></tr>
<tr><td>Email Address:</td> <td> <input type='text' name='email_address'><br></td></tr>
<tr><td>Subject:</td> <td>
<select name="type">
<option value="abuse">Abuse</option>
<option value="support">Support</option>
<option value="copyright">Copyright Problem</option>
</select><br>
<option value="copyright">Copyright Problem</option></td></tr>
<tr><td>Type the word tildeverse here:</td> <td> <input type='textarea' name='tv'>
</select><br> </td></tr>
</table>
Message: <input type='textarea' name='message'><br>
<input type='submit'>

View File

@ -3,14 +3,15 @@ To sign up for an account with thunix, please fill in the form below. Be sure to
If you have any questions or problems, feel free to contact us.
<form action='/includes/email.php'>
Contact Name: <input type='text' name='contact_name'><br>
Email Address: <input type='text' name='email_address'><br>
Desired Username: <input type='text' name='username'><br>
What interests you about thunix: : <input type='textarea' name='interest'><br>
SSH Public Key: <input type='textarea' name='pubkey'><br>
<table>
<tr><td>Contact Name:</td> <td><input type='text' name='contact_name'></td></tr>
<tr><td>Email Address:</td> <td> <input type='text' name='email_address'></td></tr>
<tr><td>Desired Username:</td> <td> <input type='text' name='username'></td></tr>
<tr><td>What interests you about thunix:</td> <td> <input type='textarea' name='interest'></td></tr>
<tr><td>SSH Public Key:</td> <td> <input type='textarea' name='pubkey'></td></tr>
<tr><td>Type the word tildeverse here:</td> <td> <input type='textarea' name='tv'></td></tr>
<input type='submit'>
</form>
</table></form>
If you don't have a public SSH key, don't worry! Check out [this guide to SSH keys](https://tilde.team/wiki/?page=ssh) and make sure that you only fill in your public SSH key here.

3
articles/success1.md Normal file
View File

@ -0,0 +1,3 @@
# Success!
You will hear back shortly from us!

3
articles/success2.md Normal file
View File

@ -0,0 +1,3 @@
# Success!
You will hear back shortly from us!

34
includes/contact.php Normal file
View File

@ -0,0 +1,34 @@
<?php
include "../config.php";
$name = $_GET['contact_name'];
$email = $_GET['email_address'];
$subject = $_GET['type'];
$body = $_GET['message'];
$tv = $_GET['tv'];
$destination_addr = "ubergeek@thunix.net";
$subject = "Contact Form";
$mailbody = "The following submission via the contact form was recieved:
Real Name: $name
Email Address: $email
Type: $interest
Message: $message";
if ( $tv != "tildeverse" ) {
print "Spam attempt";
header("Location: $site_root/success1");
die();
}
shell_exec("echo $mailbody | /usr/bin/mail -s 'New User Registration' $destination_addr ");
// In the future, here, we *should* be able to build a process that
// somehow auto-verifies the user, and instead of email, it'll kick off the new user process here
header("Location: $site_root/success2");
die()
?>

35
includes/signup.php Normal file
View File

@ -0,0 +1,35 @@
<?php
include "../config.php";
$name = $_GET['contact_name'];
$email = $_GET['email_address'];
$username = $_GET['username'];
$interests = $_GET['interest'];
$pubkey = $_GET['pubkey'];
$tv = $_GET['tv'];
$destination_addr = "ubergeek@thunix.net";
$subject = "New User Registration";
$mailbody ="A new user has tried to register.
Username: $username
Real Name: $name
Email Address: $email
Interest: $interest
Pubkey: $pubkey";
if ( $tv != "tildeverse" ) {
print "Spam attempt";
header("Location: $site_root/success1");
die();
}
shell_exec("echo $mailbody | /usr/bin/mail -s 'New User Registration' $destination_addr ");
// In the future, here, we *should* be able to build a process that
// somehow auto-verifies the user, and instead of email, it'll kick off the new user process here
header("Location: $site_root/success2");
die();
?>