This commit is contained in:
2025-03-31 12:45:58 -06:00
parent b6f707c929
commit 282ad2d8cb
327 changed files with 340 additions and 192 deletions
Regular → Executable
+20 -19
View File
@@ -10,7 +10,7 @@ if (isset($_POST['username']) && isset($_POST['password'])) {
$password = $_POST['password'];
if (array_key_exists($username, $users) && $users[$username] === $password) {
$_SESSION['access'] = true;
$_GET['file'] = 'includes/fbi.txt';
$_GET['file'] = 'spies/includes/fbi.txt';
} else {
$_GET['error'] = true;
}
@@ -18,7 +18,7 @@ if (isset($_POST['username']) && isset($_POST['password'])) {
if (isset($_GET['logout'])) {
$_SESSION['access'] = false;
header('Location: .');
header('Location: ./spies');
}
?>
@@ -27,23 +27,23 @@ if (isset($_GET['logout'])) {
<html lang="en">
<head>
<title>Spies</title>
<link href="css/styles.css" type="text/css" rel="stylesheet">
<script src="js/index.js"></script>
<title>Spies</title>
<link href="spies/css/styles.css" type="text/css" rel="stylesheet">
<script src="spies/js/index.js"></script>
</head>
<body>
<h1>View Confidential Information</h1>
<?php
if ($_SESSION['access'] !== true) {
if (isset($_GET['error']) && $_GET['error'] === true) {
echo '
<h1>View Confidential Information</h1>
<?php
if ($_SESSION['access'] !== true) {
if (isset($_GET['error']) && $_GET['error'] === true) {
echo '
<div class="card error">
<h5 class="error">Access Denied.</h5>
</div>
';
}
echo '
}
echo '
<form method="post">
<div class="row">
<input name="username" type="text" placeholder="username">
@@ -55,23 +55,24 @@ if ($_SESSION['access'] !== true) {
</div>
</form>
';
} else if (isset($_GET['file']) && isset($_SESSION['access'])) {
echo '
} else if (isset($_GET['file']) && isset($_SESSION['access'])) {
echo '
<div class="card success">
<h5 class="success">Access Granted.</h5>
</div>
<form method="get">
<div class="row">
<button name="file" value="includes/fbi.txt">FBI</button>
<button name="file" value="includes/spies.txt">Spies</button>
<button name="file" value="spies/includes/fbi.txt">FBI</button>
<button name="file" value="spies/includes/spies.txt">Spies</button>
<button name="logout" value="true" class="reset">Logout</button>
</div>
</form>
';
fileRead($_GET['file']);
}
?>
fileRead($_GET['file']);
}
?>
</body>
</html>
<?php