forked from StevenUlmer/touche
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·87 lines (78 loc) · 2.17 KB
/
index.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
#
# Copyright (C) 2002 David Whittington
#
# See the file "COPYING" for further information about the copyright
# and warranty status of this work.
#
# arch-tag: admin/index.php
#
# include("lib/admin_config.inc");
include("lib/create.inc");
session_name("TOUCHE-CREATE");
session_start();
$_SESSION = array();
if($_SERVER['REQUEST_METHOD'] == 'GET'){
?>
<!DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script language="javascript">
function set_focus() {
if (document.f.user.value) {
document.f.password.focus();
} else {
document.f.user.focus();
}
}
</script>
</head>
<body bgcolor=<?=$page_bg_color?> onLoad="set_focus()">
<form name="f" method="post" action="index.php">
<table align="center" height="100%" border="0"><tr><td>
<table cellpadding="1" cellspacing="0" border="0" bgcolor="#000000"><tr><td>
<table cellpadding="5" cellspacing="0" border="0" bgcolor="<?=$title_bg_color?>"><tr><td>
<font color="#ffffff">
<b>Touche</b><br>
<small>Creating Contest</small>
</font>
</td></tr><tr><td bgcolor="#ffffff">
<?php
if (isset($state) && $state == 1) {
echo "<center><font color=#cc0000><b>";
echo "Login or Password Invalid</b></font></center>\n";
}
else if (isset($state) && $state == 2) {
echo "<center><font color=#cc0000><b>";
echo "You are not yet logged in</b></font></center>\n";
}
?><table cellpadding="5" cellspacing="0" border="0">
<tr><td>Login:</td><td><input type="text" name="user" size="20">
</td></tr>
<tr><td>Password:</td><td><input type="password" name="password" size="20"></td></tr>
<tr><td> </td><td><input type="submit" name="submit" value=" OK ">
<input type="reset" name="submit" value=" Cancel "></td></tr>
</table>
</td></tr></table>
</td></tr></table>
</td></tr></table>
</form>
</body>
</html>
<?php
}
else if($_SERVER['REQUEST_METHOD'] == 'POST'){
$user = $_POST['user'];
$password = $_POST['password'];
if($user == $create_user && $password == $create_pass) {
$_SESSION['admin_user'] = $user;
$_SESSION['admin_pass'] = $password;
header ("Location: createcontest.php");
exit(0);
}
else {
header ("Location: index.php?state=1");
exit(0);
}
}
?>