Modified/tidied up folder structure - moved login/logout/create-account into the user folder

This commit is contained in:
FractalParadigm 2025-03-10 13:49:35 -04:00
parent 0d69a8212a
commit 4d356bd9a3
9 changed files with 11 additions and 14 deletions

View File

@ -87,7 +87,7 @@ session_start();
echo "<iframe src=\"user_management/create_safe_admin.php\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>"; echo "<iframe src=\"user_management/create_safe_admin.php\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>";
} else { // Otherwise we'll show the nav page } else { // Otherwise we'll show the nav page
if (!isset($_SESSION["userID"])){ if (!isset($_SESSION["userID"])){
echo "<iframe src=\"../login_page.php?redirect=admin\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>"; echo "<iframe src=\"../user/login_page.php?redirect=admin\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>";
} else if (isset($_SESSION["userID"]) && $_SESSION["privileges"] == 1) { } else if (isset($_SESSION["userID"]) && $_SESSION["privileges"] == 1) {
echo "<iframe src=\"admin_nav.php\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>"; echo "<iframe src=\"admin_nav.php\" name=\"dataFrame\" class=\"dataFrame\" id=\"dataFrame\" onload=\"resizeIframe(this);\"></iframe>";
} else { } else {
@ -108,7 +108,7 @@ session_start();
<?php <?php
if (isset($_SESSION["userID"])){ if (isset($_SESSION["userID"])){
echo "<a href=\"/user/" . $_SESSION["username"] . " \" class=\"subNavLink\">ACCOUNT</a>"; echo "<a href=\"/user/" . $_SESSION["username"] . " \" class=\"subNavLink\">ACCOUNT</a>";
echo "<a href=\"../logout.php?redirect=admin\" class=\"subNavLink\" id=\"loginButton\">LOGOUT</a>"; echo "<a href=\"../user/logout.php?redirect=admin\" class=\"subNavLink\" id=\"loginButton\">LOGOUT</a>";
} }
?> ?>
</div> </div>

View File

@ -81,7 +81,7 @@
echo "<p>Account created! You may sign in now.</p>"; echo "<p>Account created! You may sign in now.</p>";
echo "<p>&nbsp;</p>"; echo "<p>&nbsp;</p>";
echo "<a href=\"/\" class=\"subNavLink\">HOME</a>"; echo "<a href=\"/\" class=\"subNavLink\">HOME</a>";
echo "<a href=\"/login_page.php\" target=\"dataFrame\" class=\"subNavLink\">SIGN IN</a>"; echo "<a href=\"/user/login_page.php\" target=\"dataFrame\" class=\"subNavLink\">SIGN IN</a>";
echo "<p>&nbsp;</p>"; echo "<p>&nbsp;</p>";
echo "</div>"; echo "</div>";
} }

View File

@ -47,7 +47,7 @@ session_start();
if (isset($_SESSION["userID"])){ if (isset($_SESSION["userID"])){
echo "<a href=\"/user/" . $_SESSION["username"] . " \" class=\"subNavLink\">ACCOUNT</a>"; echo "<a href=\"/user/" . $_SESSION["username"] . " \" class=\"subNavLink\">ACCOUNT</a>";
echo "<a href=\"/ \" class=\"subNavLink\">HOME</a>"; echo "<a href=\"/ \" class=\"subNavLink\">HOME</a>";
echo "<a href=\"/logout.php \" class=\"subNavLink\">LOGOUT</a>"; echo "<a href=\"/user/logout.php \" class=\"subNavLink\">LOGOUT</a>";
echo "<a href=\"/admin/data_management/game_form.php \" target=\"dataFrame\" class=\"subNavLink\">ADD GAME DETAILS</a>"; echo "<a href=\"/admin/data_management/game_form.php \" target=\"dataFrame\" class=\"subNavLink\">ADD GAME DETAILS</a>";
// Anything we need to show to logged in admins will be below // Anything we need to show to logged in admins will be below
if (isset($_SESSION["privileges"]) && $_SESSION["privileges"] == 1){ if (isset($_SESSION["privileges"]) && $_SESSION["privileges"] == 1){
@ -55,8 +55,8 @@ session_start();
echo "<a href=\"/admin \" class=\"subNavLink\">ADMIN PANEL</a>"; echo "<a href=\"/admin \" class=\"subNavLink\">ADMIN PANEL</a>";
} }
} else { } else {
echo "<a href=\"/login_page.php \" target=\"dataFrame\" class=\"subNavLink\">SIGN IN</a>"; echo "<a href=\"/user/login_page.php \" target=\"dataFrame\" class=\"subNavLink\">SIGN IN</a>";
echo "<a href=\"/create_account.php \" target=\"dataFrame\" class=\"subNavLink\">CREATE AN ACCOUNT</a>"; echo "<a href=\"/user/create_account.php \" target=\"dataFrame\" class=\"subNavLink\">CREATE AN ACCOUNT</a>";
echo "<a href=\"/ \" class=\"subNavLink\">HOME</a>"; echo "<a href=\"/ \" class=\"subNavLink\">HOME</a>";
} }
?> ?>

3
user/.gitignore vendored
View File

@ -1,3 +0,0 @@
admin/dev_db_config.php
.htaccess
favicon.ico

View File

@ -42,7 +42,7 @@ try { // Try opening the SQL database connection
<link rel="stylesheet" href="/styles/user_management.css" /> <link rel="stylesheet" href="/styles/user_management.css" />
<script src="/scripts/tools.js"></script> <script src="/scripts/tools.js"></script>
<script>verifyPageInFrame()</script> <script>verifyPageInFrame()</script>
<?php include ("admin/db_config.php");?> <!-- Our password-length variable is stored here --> <?php include ("../admin/db_config.php");?> <!-- Our password-length variable is stored here -->
<script src="/scripts/user_management.js"></script> <script src="/scripts/user_management.js"></script>
<script> <script>
var head = document.getElementsByTagName('HEAD')[0]; var head = document.getElementsByTagName('HEAD')[0];

View File

@ -19,7 +19,7 @@ session_start();
<body class="sqlOutput"> <body class="sqlOutput">
<?php <?php
// USER-DEFINED VARIABLES // USER-DEFINED VARIABLES
include("admin/db_config.php"); // Include database stuff include("../admin/db_config.php"); // Include database stuff
try { // Try opening the SQL database connection try { // Try opening the SQL database connection
$conn = new PDO("mysql:host=$servername; dbname=$dbName", $dbUsername, $dbPassword); $conn = new PDO("mysql:host=$servername; dbname=$dbName", $dbUsername, $dbPassword);

View File

@ -19,7 +19,7 @@ $redirect = $_GET["redirect"];
<body id="loginBody"> <body id="loginBody">
<h3 id="loginNotice">Sign in to continue</h3> <h3 id="loginNotice">Sign in to continue</h3>
<div id="loginPanel"> <div id="loginPanel">
<form id="loginForm" onsubmit="return verifyInput()" action="/login.php?redirect=<?php echo $redirect; ?>" method="POST"> <form id="loginForm" onsubmit="return verifyInput()" action="/user/login.php?redirect=<?php echo $redirect; ?>" method="POST">
<div id="inputArea"> <div id="inputArea">
<label for="username">Username:</label> <label for="username">Username:</label>
<input type="text" name="username" id="username" required> <input type="text" name="username" id="username" required>

View File

@ -103,9 +103,9 @@ try { // Try opening the SQL database connection
<?php <?php
// If someone is logged in, give them the opportunity to log out // If someone is logged in, give them the opportunity to log out
if (isset($_SESSION["userID"])){ if (isset($_SESSION["userID"])){
echo "<a href=\"../logout.php?redirect=\" class=\"subNavLink\" id=\"loginButton\">LOGOUT</a>"; echo "<a href=\"../user/logout.php?redirect=\" class=\"subNavLink\" id=\"loginButton\">LOGOUT</a>";
} else { } else {
echo "<a href=\"/login_page.php \" target=\"dataFrame\" class=\"subNavLink\">SIGN IN</a>"; echo "<a href=\"/user/login_page.php \" target=\"dataFrame\" class=\"subNavLink\">SIGN IN</a>";
echo "<a href=\"/create_account.php \" target=\"dataFrame\" class=\"subNavLink\">CREATE AN ACCOUNT</a>"; echo "<a href=\"/create_account.php \" target=\"dataFrame\" class=\"subNavLink\">CREATE AN ACCOUNT</a>";
echo "<a href=\"/ \" class=\"subNavLink\">HOME</a>"; echo "<a href=\"/ \" class=\"subNavLink\">HOME</a>";
} }