-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccess.php
More file actions
41 lines (31 loc) · 808 Bytes
/
access.php
File metadata and controls
41 lines (31 loc) · 808 Bytes
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
<?php
// Load secret config settings.
require("config.php");
//put sha1() encrypted password here - example is 'pops!'
$password = SHAPASS;
session_start();
if ($_GET['sign'] == "out") { $_SESSION['loggedIn']=false; }
if (!isset($_SESSION['loggedIn'])) {
$_SESSION['loggedIn'] = false;
}
if (isset($_POST['password'])) {
if (sha1($_POST['password']) == $password) {
$_SESSION['loggedIn'] = true;
} else {
die ('Incorrect password');
}
}
if (!$_SESSION['loggedIn']) : ?>
<html><head><title>Login</title></head>
<body>
<p>You need to login</p>
<form method="post" action="index.php">
Password: <input type="password" name="password"> <br />
<input type="submit" name="submit" value="Login">
</form>
</body>
</html>
<?php
exit();
endif;
?>