b4e89ea9ee
Full rewrite of the legacy PHP/MySQL app using Next.js 14, PostgreSQL, Prisma, NextAuth, Tailwind CSS, and WebSocket-based live chat/grid updates. Deployed via Docker Compose with a custom Node.js server for WebSocket support. Fix chat display names by passing userId from the NextAuth session over WebSocket instead of attempting to read the HttpOnly session cookie (which is inaccessible to JavaScript). Server now looks up the user's first name from the database using the userId. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
67 lines
1.7 KiB
PHP
67 lines
1.7 KiB
PHP
<?php
|
|
@ob_start();
|
|
session_start();
|
|
?>
|
|
|
|
<!--
|
|
www.vnlisting.com
|
|
Online Super Bowl Squares Script
|
|
Please read the "Readme.txt for license agreement, installation and usage instructions
|
|
-->
|
|
|
|
<html>
|
|
<head>
|
|
<title>ADMIN - Login</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
</head>
|
|
|
|
<body>
|
|
<center>
|
|
<?php
|
|
$email=$_POST['AdminEmail'];
|
|
$pass=$_POST['AdminPass'];
|
|
|
|
// check to see if details have been passed to the script by the form
|
|
if ($email && $pass) {
|
|
if ($_SESSION['VNSB']) {
|
|
echo $email.", you are already logged in.<br/><br/>";
|
|
echo "<a href='admin.php'>Admin</a><br/><br/><a href='adminlogout.php'>Log out.</a>";
|
|
exit;
|
|
}
|
|
// check input variables against database
|
|
include "config.php";
|
|
$sql = "SELECT Admin_email, Admin_pwd FROM VNSB_settings";
|
|
$result = mysqli_query($conn,$sql);
|
|
// in case of an error, throw up an error message and exit
|
|
if (!$result) {
|
|
echo "Sorry, there is a problem with accessing your database!!!";
|
|
exit;
|
|
} else {
|
|
$record = mysqli_fetch_assoc($result);
|
|
if ($email==$record['Admin_email'] AND $pass==$record['Admin_pwd']) {
|
|
$_SESSION['VNSB']=$record['Admin_email'];
|
|
mysqli_close($conn);
|
|
header ("Location: admin.php");
|
|
} else {
|
|
echo "<center><h1>Invalid login</h1><p><a href=\"adminlogin.php\">Admin login</a></p></center>";
|
|
mysqli_close($conn);
|
|
exit;
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|
|
<br />
|
|
<br>
|
|
<h2>Admin login</h2>
|
|
|
|
<form method="post" action="adminlogin.php">
|
|
<p> Email: <input name="AdminEmail" type="text" size="30"></p>
|
|
<p> Password: <input name="AdminPass" type="password" size="30"></p>
|
|
<p> <input type="submit" value="Login"></p>
|
|
</form>
|
|
|
|
</center>
|
|
</body>
|
|
</html>
|