mirror of
https://github.com/tildeclub/site.git
synced 2026-01-23 21:40:18 +00:00
signup improvements, user firewall block check.
This commit is contained in:
20
polls/db.php
20
polls/db.php
@@ -65,17 +65,17 @@ try {
|
||||
// Create a default admin user with a hashed password
|
||||
// NOTE: In production, you should not hardcode these credentials.
|
||||
// Instead, store them outside of your code or set them up once.
|
||||
$adminUsername = 'admin';
|
||||
$adminPlainPassword = 'password'; // Change this in production
|
||||
$adminHashedPassword = password_hash($adminPlainPassword, PASSWORD_DEFAULT);
|
||||
// $adminUsername = 'admin';
|
||||
// $adminPlainPassword = 'password'; // Change this in production
|
||||
// $adminHashedPassword = password_hash($adminPlainPassword, PASSWORD_DEFAULT);
|
||||
|
||||
$insertUser = $db->prepare("
|
||||
INSERT INTO users (username, password)
|
||||
VALUES (:username, :password)
|
||||
");
|
||||
$insertUser->bindValue(':username', $adminUsername, PDO::PARAM_STR);
|
||||
$insertUser->bindValue(':password', $adminHashedPassword, PDO::PARAM_STR);
|
||||
$insertUser->execute();
|
||||
// $insertUser = $db->prepare("
|
||||
// INSERT INTO users (username, password)
|
||||
// VALUES (:username, :password)
|
||||
// ");
|
||||
// $insertUser->bindValue(':username', $adminUsername, PDO::PARAM_STR);
|
||||
// $insertUser->bindValue(':password', $adminHashedPassword, PDO::PARAM_STR);
|
||||
// $insertUser->execute();
|
||||
}
|
||||
|
||||
// Optionally, you can return $db or leave it globally accessible
|
||||
|
||||
Reference in New Issue
Block a user