initial commit

This commit is contained in:
root
2026-03-26 15:03:38 +07:00
commit 6464c750f2
19 changed files with 2129 additions and 0 deletions

15
setup.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
require_once 'db.php';
$schema = file_get_contents('schema.sql');
$pdo->exec($schema);
$stmt = $pdo->prepare("SELECT id FROM users WHERE username = 'admin'");
$stmt->execute();
if (!$stmt->fetch()) {
$hash = password_hash('admin', PASSWORD_DEFAULT);
$stmt = $pdo->prepare("INSERT INTO users (username, password_hash, is_admin) VALUES ('admin', ?, 1)");
$stmt->execute([$hash]);
echo "Setup complete. Admin user created. <a href='index.php'>Go to Login</a>";
} else {
echo "Setup already completed. <a href='index.php'>Go to Login</a>";
}