fixed signup page

This commit is contained in:
deepend 2024-01-21 05:35:26 +00:00
parent 24df7d9359
commit 365ebab2ef
1 changed files with 44 additions and 28 deletions

View File

@ -1,9 +1,5 @@
<?php <?php
ini_set('display_errors', 1); $title = "sign up for the tilde.club!";
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$title = "Sign up for the tilde.club!";
include __DIR__."/../header.php"; include __DIR__."/../header.php";
function esc($v) { function esc($v) {
@ -11,49 +7,69 @@ function esc($v) {
} }
function isGmail($email) { function isGmail($email) {
return strpos($email, '@gmail.com') !== false; return substr(strrchr($email, "@"), 1) === 'gmail.com';
} }
$gmailError = false; $gmailError = false;
if ($_SERVER['REQUEST_METHOD'] === 'POST') { if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$email = esc('email'); if (isGmail($_REQUEST['email'])) {
if (isGmail($email)) {
$gmailError = true; $gmailError = true;
} else { } else {
// Process the form here // Process the form here only if the email is not a Gmail address
include 'signup-handler.php'; include 'signup-handler.php';
} }
} }
?> ?>
<?php if ($gmailError): ?>
<div class="alert alert-warning">
<strong>We don't accept Gmail addresses due to Google not allowing emails to go through due to a recent spam issue.</> </div>
<?php endif; ?>
<h1 id="fancyboi">Sign up to join tilde.club</h1> <h1 id="fancyboi">sign up to join tilde.club</h1>
<div class="grid"> <div class="grid">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<p>We're excited you're here! Let's get you signed up!</p> <p>We're excited you're here! Let's get you signed up!</p>
<p>Fill out this form and we'll get back to you with account info.</p> <p>Fill out this form and we'll get back to you with account info</p>
<?php if ($gmailError): ?>
<p><strong>We don't accept Gmail addresses due to Google not allowing emails to go through due to a recent spam issue.</strong></p>
<?php else: ?>
<form method="post"> <form method="post">
<div> <div>
<p>Your desired username (numbers and lowercase letters only, no spaces)</p> <p>your desired username (numbers and lowercase letters only, no spaces)</p>
<input class="form-control" name="username" value="<?= esc("username") ?>" type="text" required> <input class="form-control" name="username" value="<?=esc("username")?>" type="text" required>
</div> </div>
<div> <div>
<p>Email to contact you with account info</p> <p>email to contact you with account info</p>
<input class="form-control" name="email" value="<?= esc("email") ?>" type="text" required> <input class="form-control" name="email" value="<?=esc("email")?>" type="text" required>
</div> </div>
<!-- Rest of your form fields --> <div>
<p>what interests you about tilde.club? we want to make sure you're a real human being :)</p>
<textarea required class="form-control" name="interest" id="" cols="40" rows="7"><?=esc("interest")?></textarea>
</div>
<button class="btn btn-primary" type="submit">Submit</button> <div>
</form> <p>SSH public key</p>
</div> <textarea required class="form-control" name="sshkey" id="" cols="40" rows="10"><?=esc("sshkey")?></textarea>
</div> <p>if you don't have a key, don't worry! <a href="https://tilde.club/wiki/ssh.html">check out our guide to ssh keys</a> and make sure that you only put your pubkey here</p>
</div>
<p>
<em>signing up implies that you agree to abide by <a href="/wiki/code-of-conduct.html">our code of conduct</a></em>
<br>
no drama. be respectful. have fun. we're all trying, and we're all in this together :)
</p>
<p>you must be at least 13 years or older to sign up and use tilde.club.</p>
<button class="btn btn-primary" type="submit">Submit</button>
</form>
</td>
</tr>
</table>
</div>
</div> </div>
<?php include __DIR__."/../footer.php"; <?php include __DIR__."/../footer.php";