threadr.lostcave.ddnss.de/threadr/signup/verify-email/index.php

61 lines
2.0 KiB
PHP
Raw Normal View History

<?php
%SET_LOGIN_VARIABLE%
2020-03-02 14:13:26 +01:00
%PLEAZE_NO_CACHE%
2020-02-24 04:43:53 +01:00
//permitted chars for password salt
$permitted_chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&/()[]$:?_';
//generates password salt
function generate_salt($input, $strength = 5) {
$input_length = strlen($input);
$random_string = '';
for($i = 0; $i < $strength; $i++) {
$random_character = $input[random_int(0, $input_length - 1)];
$random_string .= $random_character;
}
return $random_string;
}
2020-02-23 22:26:00 +01:00
//for token generation
$token_salt = generate_salt($permitted_chars);
$token_hashes = hash("crc32", $_POST['email']) . hash("crc32", $_POST['username']);
$token = str_shuffle($token_hashes . $token_salt);
2020-02-23 23:08:26 +01:00
//for password hashing
$password_salt = generate_salt($permitted_chars);
$password_hash_method = "sha256";
$pdo = new PDO('mysql:host=localhost;dbname=web', 'webstuff', 'Schei// auf Pa$$w0rter!');
//$statement = $pdo->prepare('');
$navbar = "verify-email";
?>
2020-02-23 21:28:00 +01:00
<!DOCTYPE html>
<html>
<head>
<title>ThreadR - Verification</title>
2020-03-05 04:56:06 +01:00
%STYLESHEET%
2020-02-23 21:28:00 +01:00
<link rel="icon" type="image/png" href="%CONTENT_DIR%/img/favicon-32x32.png" sizes="32x32" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
%NAVBAR%
2020-02-23 21:28:00 +01:00
<div class="container">
<div class="item-1">
<h1>
2020-02-24 08:29:59 +01:00
<center>E-mail verification</center>
2020-02-23 21:28:00 +01:00
</h1>
</div>
2020-03-08 04:10:22 +01:00
<div class="item-2">
<section>
<p>Please send an e-mail containing the following token to <a class="pink-b" href="mailto:signup@lostcave.ddnss.de?subject=ThreadR%20-%20Verification&body=<?php echo $token; ?>">signup@lostcave.ddnss.de</a>:</p>
2020-02-23 21:28:00 +01:00
<form action="%CONTENT_DIR%/signup/verify-email/redirect.php" method="post">
<p>Token: <?php echo $token; ?></p>
2020-02-24 08:29:59 +01:00
<input type="submit" value="Done, sign me up!" />
2020-02-24 22:34:45 +01:00
</form>
2020-03-08 04:10:22 +01:00
</section>
2020-02-23 21:28:00 +01:00
</div>
</div>
2020-03-09 12:17:12 +01:00
%BANNER_COOKIES%
2020-02-23 21:28:00 +01:00
</body>
</html>