Dockerize passman for modern environments
Ported the original passman PHP/MySQL application to a Docker-based setup using Apache and MariaDB. Fixed compatibility issues with modern PHP/MariaDB versions (HTTP header handling and database collation) using minimal, targeted changes. Preserved the original application logic and structure while ensuring correct execution in a contemporary containerized environment.
This commit is contained in:
@@ -1,13 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Login Form</title>
|
||||
</head>
|
||||
|
||||
<?php
|
||||
// Start a new session (or resume an existing one)
|
||||
session_start();
|
||||
|
||||
// Check if the user is already logged in
|
||||
@@ -27,12 +18,13 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
||||
$password = trim($_POST['password']);
|
||||
|
||||
// Connect to the database
|
||||
$conn=mysqli_connect("localhost","root","","pwd_mgr");
|
||||
// Check connection
|
||||
if (mysqli_connect_errno()) {
|
||||
echo "Failed to connect to MySQL: " . mysqli_connect_error();
|
||||
exit();
|
||||
}
|
||||
// $conn=mysqli_connect("localhost","root","","pwd_mgr");
|
||||
// // Check connection
|
||||
// if (mysqli_connect_errno()) {
|
||||
// echo "Failed to connect to MySQL: " . mysqli_connect_error();
|
||||
// exit();
|
||||
// }
|
||||
require_once __DIR__ . "/config.php";
|
||||
|
||||
// xxx' OR 1=1; -- '
|
||||
$sql_query = "SELECT * FROM login_users WHERE username='{$username}' AND password='{$password}';";
|
||||
@@ -72,6 +64,14 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Login Form</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h3>Password Manager</h3>
|
||||
<form method="POST" action="">
|
||||
|
||||
Reference in New Issue
Block a user