forked from oliverh57/Vision
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
75 lines (71 loc) · 2.86 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
<!DOCTYPE html>
<html>
<head>
<title>Remote Viewer</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway"> </head>
<style>
body,
h1,
h2,
h3,
h4,
h5 {
font-family: "Raleway", sans-serif
}
</style>
<body class="w3-light-grey">
<div class="w3-content" style="max-width:1400px">
<!-- Header -->
<header class="w3-container w3-center w3-padding-32">
<h1><b>Remote Camera</b></h1>
<p>Secure image <span class="w3-tag">viewer</span></p>
</header>
<!-- Grid -->
<div class="w3-row">
<!-- Blog entries -->
<!-- Blog entry -->
<div class="w3-card-4 w3-margin w3-white"> <img src="/images/loginBanner.jpg" alt="banner" style="width:100%">
<div class="w3-container">
<h3><b>Login</b></h3>
</div>
<div class="w3-container">
<div class="w3-row">
<div class="w3-col m8 s12">
<form id="loginform" name="input" action="" method="post"> <label for="username" style="display: inline-block; width: 6em;">Username: </label><input type="text" value="" id="username" name="username" style="max-width:100%;" />
<p style="font-size:0px;"> <br></p> <label for="password" style="display: inline-block; width: 6em;">Password: </label><input type="password" value="" id="password" name="password" style="max-width:100%;" /> <br><br>
<p>
<?php
$config = include("setup/config.php");
setcookie("auth", $config['auth'], time() + (86400 * 30), "/");
header("Location: /auth");
if (isset($_POST["username"]) && isset($_POST["password"])){
if ($_POST["username"] == "user" && $_POST["password"] == "pass"){
header("Location: /auth");
setcookie("auth", $config['auth'], time() + (86400 * 30), "/");
header("Location: /auth");
die();
}else {
echo "username/password incorrect";
}
}
?>
</p> <br> <button class="w3-button w3-padding-large w3-white w3-border" type="submit">submit »</button> <br> <br> </form>
</div>
<div class="w3-col m4 w3-hide-small"> </div>
</div>
</div>
</div>
<hr>
<!-- END GRID -->
</div><br>
<!-- END w3-content -->
</div>
<!-- Footer -->
<footer class="w3-container w3-dark-grey w3-padding-32 w3-margin-top">
<p>Copyright Oliver Hynds and <a href="https://www.w3schools.com">W3Schools</a></p>
</footer>
</body>
</html>