-
Notifications
You must be signed in to change notification settings - Fork 9
/
authenticate.php
65 lines (60 loc) · 2.19 KB
/
authenticate.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
//Main Login Page
//Destroy any previous session data
//This way it requires a login
session_start();
session_destroy();
//get status
$status = @$_GET['status'];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="./css/style.css" type="text/css" />
</head>
<body>
<center>
<h1>Login</h1>
<img src="images/lock.png" border="0" alt="Please Login" title="Please Login" />
<h3>Please login with your username and password.</h3>
<form action="login.php" method="POST">
<table border="0">
<tr><td class="right">
Username:</td>
<td class="left">
<input type="text" size="20" name="f_user">
</td></tr>
<tr><td class="right">
Password:</td>
<td class="left">
<input type="password" size="20" name="f_pass">
</td></tr>
<tr><td></td><td class="left">
<input type="submit" name="login" value="authentification">
</td></tr>
</table>
<?php
//Display legal stuff if file exists
if (file_exists("legalterms.txt"))
echo "<br><input type=\"checkbox\" name=\"legalterms\"> I agree to the <a href=\"legalterms.txt\">use policy and terms of service.</a>";
else //display hidden value, needed so that login.php can check the value
echo "<input type=\"hidden\" name=\"legalterms\" value=\"on\">";
if ($status == "error")
echo "<p class=\"error\">Error, username or password is incorrect.<br>Entries are cAsESEnsITiVE, do you have your capslock key on?...</p>";
if ($status == "session")
echo "<p class=\"error\">Your session has timed out, please re-login.</p>";
if ($status == "logout")
echo "<p class=\"success\">You have successfully logged out.</p>";
if ($status == "indexlogin")
echo "<p class=\"error\">Error, this tracker requires a username and password in order to view the main page.</p>";
if ($status == "legalterms")
echo "<p class=\"error\">You need to agree to the use policy and terms of service in order to log in.</p>";
?>
</form>
<br>
<a href="index.php"><img src="images/stats.png" border="0" class="icon" alt="Tracker Statistics" title="Tracker Statistics" /></a><a href="index.php">Tracker Statistics</a><br>
</center>
</body>
</html>