first commit

This commit is contained in:
Lars Behrends
2025-10-17 13:29:28 +02:00
commit 929ee43001
85 changed files with 10361 additions and 0 deletions

39
check_user.php Normal file
View File

@@ -0,0 +1,39 @@
<?php
require_once __DIR__ . '/vendor/autoload.php';
// Load environment variables
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->load();
// Load database configuration
$dbConfig = require __DIR__ . '/config/database.php';
\App\Database\Database::setConfig($dbConfig);
// Initialize database
try {
$pdo = \App\Database\Database::getInstance();
$userModel = new \App\Models\User($pdo);
$existingUser = $userModel::findByUsername($pdo, 'admin');
if ($existingUser) {
echo 'Admin user exists: ' . $existingUser['username'] . PHP_EOL;
echo 'Password hash: ' . $existingUser['password'] . PHP_EOL;
echo 'Role: ' . $existingUser['role'] . PHP_EOL;
echo 'Is active: ' . $existingUser['is_active'] . PHP_EOL;
// Test password verification
$testPassword = 'admin123';
$userModel->password = $existingUser['password'];
if ($userModel->verifyPassword($testPassword)) {
echo 'Password verification: SUCCESS' . PHP_EOL;
} else {
echo 'Password verification: FAILED' . PHP_EOL;
}
} else {
echo 'Admin user does not exist in database.' . PHP_EOL;
}
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage() . PHP_EOL;
}