This repository was archived by the owner on Feb 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubmit.php
More file actions
executable file
·65 lines (55 loc) · 2.3 KB
/
submit.php
File metadata and controls
executable file
·65 lines (55 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
die('Nominace již byly ukončeny.');
$response = file_get_contents("mail_response.html");
foreach ($_POST as $key => $value) {
$response = str_replace("@@" . $key . "@@", htmlspecialchars($value), $response);
}
// Forward the response!
$headers = "From: Wikikonference 2019 <wikikonference@wikimedia.cz>\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
mail("martin.urbanec@wikimedia.cz", "[Wikikonference 2019] Nominace témat a řečníků", $response, $headers);
// Store the response!
$html = str_replace("@@response@@", $response, file_get_contents('layout.html'));
$id = uniqid("response", true);
file_put_contents('responses/' . $id . ".html", $html);
// Link the response!
$config = yaml_parse('config.yaml');
$token = md5($config['secret'] . $id);
$link = "view.php?id=$id&token=$token";
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<style>
td, tr {
text-align: center;
}
</style>
<title>Nominace řečníků na Wikikonferenci 2019</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Wikikonference 2019</a>
</nav>
<div class="container">
<h1>Vaše odpověď byla úspěšně zaznamenána.</h1>
<p>Můžete si ji <a href="<?php echo $link; ?>">zobrazit</a>.</p>
</div>
<footer class="container-fluid">
<hr>
<div class="row">
<div class="col-md-4">
<p>© Wikimedia Česká republika, z.s.</p>
</div>
<div class="col-md-4 text-center"><a href="mailto:wikikonference@wikimedia.cz">wikikonference@wikimedia.cz</a></div>
<div class="col-md-4 text-right"><a href="https://github.com/urbanecm/wikikonference-2019-nominace">Zdrojový kód</a> (<a href="LICENSE">GNU GPL</a>)</div>
</div>
</footer>
</body>
</html>