update email verification things and pull from api

This commit is contained in:
Ben Harris 2018-01-29 14:00:45 -05:00
parent 71f926b7ad
commit 3db24f37b2
23 changed files with 21 additions and 24 deletions

0
.gitignore vendored Normal file → Executable file
View File

0
css/font-awesome.css vendored Normal file → Executable file
View File

0
css/hacker.css Normal file → Executable file
View File

0
discord/index.php Normal file → Executable file
View File

0
fonts/FontAwesome.otf Normal file → Executable file
View File

0
fonts/fontawesome-webfont.eot Normal file → Executable file
View File

0
fonts/fontawesome-webfont.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 434 KiB

After

Width:  |  Height:  |  Size: 434 KiB

0
fonts/fontawesome-webfont.ttf Normal file → Executable file
View File

0
fonts/fontawesome-webfont.woff Normal file → Executable file
View File

0
fonts/fontawesome-webfont.woff2 Normal file → Executable file
View File

9
index.php Normal file → Executable file
View File

@ -92,7 +92,14 @@
<h1>~users~</h1>
<em><a href="https://tilde.team/tilde.24h.html"><i class="fa fa-clock-o"></i> recent updates</a></em>
<br><br>
<?php echo file_get_contents("https://tilde.team/users.php"); ?>
<?php $users = json_decode(file_get_contents("https://tilde.team/~ben/api/?users"));
foreach ($users as $user): ?>
<div class="list-group">
<a href="https://tilde.team/~<?=$user?>/" class="list-group-item">
<h5 class="list-group-item-heading">~<?=$user?></h5>
</a>
</div>
<?php endforeach; ?>
</div>
</div>

0
news.php Normal file → Executable file
View File

0
news/000_first_post.json Normal file → Executable file
View File

0
news/001_new_news.json Normal file → Executable file
View File

0
news/002_dns_redirects.json Normal file → Executable file
View File

0
news/003_mastodon.json Normal file → Executable file
View File

0
news/006_tilde_theme.json Normal file → Executable file
View File

0
news/007_happy_new_year.json Normal file → Executable file
View File

0
news/008_tildegit.json Normal file → Executable file
View File

0
news/009_paperwork_notepad.json Normal file → Executable file
View File

0
news/post_template.json Normal file → Executable file
View File

View File

@ -32,41 +32,32 @@
<form method="post">
<?php
if ($_SERVER["SERVER_NAME"] != "localhost") {
if ($_SERVER["SERVER_NAME"] != "localhost")
require_once "/home/ben/ultimate-email/support/smtp.php";
}
$message = "";
if (isset($_REQUEST["username"]) && isset($_REQUEST["email"])) {
// Check the name.
$name = trim($_REQUEST["username"]);
if ($name == "") {
if ($name == "")
$message .= "<li>please fill in your desired username</li>";
}
if (strlen($name) > 32) {
if (strlen($name) > 32)
$message .= "<li>username too long (32 character max)</li>";
}
if (preg_match("/([a-z_][a-z0-9_]{0,30})/", $name) == 1) {
echo '';
} else {
if (preg_match("/([a-z_][a-z0-9_]{0,30})/", $name) != 1)
$message .= "<li>username contains invalid characters (lowercase only)</li>";
}
if (posix_getpwnam($name)) {
if (posix_getpwnam($name))
$message .= "<li>sorry, the username $name is unavailable</li>";
}
// Check the e-mail address.
$email = trim($_REQUEST["email"]);
if ($email == "") {
if ($email == "")
$message .= "<li>please fill in your email address</li>";
} else {
else {
$result = SMTP::MakeValidEmailAddress($_REQUEST["email"]);
if (!$result["success"]) {
if (!$result["success"])
$message .= "<li>invalid email address: " . htmlspecialchars($result["error"]) . "</li>";
} elseif ($result["email"] != $email) {
elseif ($result["email"] != $email)
$message .= "<li>invalid email address. did you mean: " . htmlspecialchars($result["email"]) . "</li>";
}
}
if ($message == "") {
@ -105,7 +96,7 @@
?>
<div class="form-group">
<label>your desired username (numbers and letters only, no spaces)</label>
<label>your desired username (numbers and lowercase letters only, no spaces)</label>
<input v-model="username" class="form-control" name="username" value="<?=$_REQUEST["username"] ?? ""?>" type="text" required>
</div>

7
users.php Normal file → Executable file
View File

@ -1,10 +1,9 @@
<?php foreach (scandir("/home") as $user):
if (!is_dir("/home/$user/public_html")) continue; ?>
<?php
$users = json_decode(file_get_contents("https://tilde.team/~ben/api/?users"));
foreach ($users as $user): ?>
<div class="list-group">
<a href="https://tilde.team/~<?=$user?>/" class="list-group-item">
<h5 class="list-group-item-heading">~<?=$user?></h5>
</a>
</div>
<?php endforeach;