-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
44 lines (39 loc) · 1.27 KB
/
index.php
File metadata and controls
44 lines (39 loc) · 1.27 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
<?php
session_start();
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Coding contribution badges: POC</title>
<meta charset="utf-8" />
<link type="text/css" rel="stylesheet" href="css/style.css" />
</head>
<body>
<h1>Open Badges for Firefox releases</h1>
<p>
This is a proof-of-concept for issuing badges recognising contributions to a particular Firefox release.
</p>
<?php
function outputError($errorVar, $spanText) {
if (isset($_SESSION[$errorVar])) {
echo '<span class="error">' . $spanText . "</span>";
unset($_SESSION[$errorVar]);
}
}
outputError("empty", "Please enter an email address");
outputError("emailError", "Please enter a valid email address");
outputError("nobody", "nobody@mozilla.org would have earned a badge, but what about you?");
outputError("bzError", "Bugzilla error");
outputError("jsonError", "JSON error");
outputError("fileError", "File error");
unset($_SESSION["badgeIssued"]);
unset($_SESSION["nobugs"]);
unset($_SESSION["expiry"]);
?>
<form action="issuer.php" method="post" id="theform">
<label for="bugmail">Enter your bugmail:</label>
<input type="email" id="bugmail" name="bugmail">
<input type="submit" id="submit" value="Submit">
</form>
</body>
</html>