-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy path503.php
47 lines (44 loc) · 1.28 KB
/
503.php
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
<?php
// The general idea being to give beta-testers a cookie to identify them.
// This cookie is read to give access if the proper lines are uncommented in
// .htaccess.
$passphrase = md5('guest');
if (@$_GET['access'] === $passphrase) {
// Cookie lasts a year
setcookie('beta', 'notquitesecurebutgoodenough', time()+60*60*24*365);
header('Location: ./index.php?hash=welcome');
die();
}
// To be seen by those without beta-tester access.
// Headers specify the 503 code, but to retry in a day's time.
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 86400');
?><!doctype html>
<head>
<meta charset="utf-8">
<title>CourseRoad is upgrading!</title>
<style>
body {
background-color: #EEE;
font-family: Arial;
}
</style>
</head>
<body>
<h1>Maintenance time!</h1>
<p>
Don't worry, CourseRoad will be back shortly, new and improved!
Sorry for the inconvenience. (I'll try to be quick!)
</p>
<p>
If something's gone horribly wrong and you need something <em>urgently</em>,
or you're perhaps interested in helping me by being a beta tester,
email me at <a href="[email protected]">[email protected]</a>.
</p>
<p>
Thanks,<br>
dannybd
</p>
</body>
</html>