diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 9b2bf47..18a860b 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -5,7 +5,16 @@ "mcp__visualize__show_widget", "Bash(git init *)", "Bash(git add *)", - "Bash(git commit *)" + "Bash(git commit *)", + "Bash(git mv *)", + "Bash(php -l api.php)", + "Bash(php -l auth.php)", + "Bash(php -l migrate.php)", + "Bash(php -l setup.php)", + "PowerShell(php -l \"C:\\\\Users\\\\danie\\\\Desktop\\\\guessTheLiar\\\\api.php\")", + "PowerShell(php -l \"C:\\\\Users\\\\danie\\\\Desktop\\\\guessTheLiar\\\\auth.php\")", + "PowerShell(php -l \"C:\\\\Users\\\\danie\\\\Desktop\\\\guessTheLiar\\\\migrate.php\")", + "Bash(grep -v \"^\\\\s*//\")" ] } } diff --git a/config.php b/config.php index 91f2895..55e2a66 100644 --- a/config.php +++ b/config.php @@ -8,8 +8,8 @@ declare(strict_types=1); */ return [ 'host' => 'localhost', - 'dbname' => 'DEINE_DATENBANK', - 'user' => 'DEIN_DB_USER', - 'pass' => 'DEIN_DB_PASSWORT', + 'dbname' => 'guess_appform', + 'user' => 'guess_appform', + 'pass' => 'Z_O9Vcpidy!ot1f7', 'charset' => 'utf8mb4', ]; diff --git a/setup.php b/setup.php deleted file mode 100644 index ba4e6ba..0000000 --- a/setup.php +++ /dev/null @@ -1,113 +0,0 @@ - PDO::ERRMODE_EXCEPTION, - PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, - PDO::ATTR_EMULATE_PREPARES => false, - ]); -} - -$error = $success = ''; - -if ($_SERVER['REQUEST_METHOD'] === 'POST') { - $adminUser = trim($_POST['username'] ?? ''); - $adminPass = $_POST['password'] ?? ''; - $adminPass2 = $_POST['password2'] ?? ''; - - if (!preg_match('/^[a-zA-Z0-9_\-]{2,40}$/', $adminUser)) { - $error = 'Username: 2–40 Zeichen, nur Buchstaben/Zahlen/_/-'; - } elseif (strlen($adminPass) < 8) { - $error = 'Passwort muss mindestens 8 Zeichen haben.'; - } elseif ($adminPass !== $adminPass2) { - $error = 'Passwörter stimmen nicht überein.'; - } else { - try { - $pdo = db($cfg); - $check = $pdo->prepare("SELECT id FROM gtl_users WHERE role = 'admin' LIMIT 1"); - $check->execute(); - if ($check->fetch()) { - $error = 'Admin-Konto existiert bereits. Setup-Datei löschen!'; - } else { - $hash = password_hash($adminPass, PASSWORD_DEFAULT); - $now = time(); - $ins = $pdo->prepare( - "INSERT INTO gtl_users (username, credential_hash, role, created_at) - VALUES (?, ?, 'admin', ?)" - ); - $ins->execute([$adminUser, $hash, $now]); - $uid = $pdo->lastInsertId(); - $pdo->prepare("INSERT INTO gtl_user_stats (user_id) VALUES (?)")->execute([$uid]); - - // Create uploads directory - $dir = __DIR__ . '/uploads/avatars'; - if (!is_dir($dir)) { - mkdir($dir, 0755, true); - } - - $success = 'Admin-Konto „' . htmlspecialchars($adminUser) . '" erfolgreich angelegt! Lösche diese Datei jetzt.'; - } - } catch (Throwable $e) { - $error = 'DB-Fehler: ' . $e->getMessage(); - } - } -} -?> - - - - - -Setup – Guess the Liar - - - -
-

🎭 Admin-Setup

-

Legt das erste Admin-Konto an. Danach diese Datei löschen!

-
-
- -
- - - - - - - -
- -
⚠️ Diese Datei nach dem Setup löschen oder per .htaccess sperren!
-
- -