diff options
| author | ilotterytea <iltsu@alright.party> | 2025-12-09 01:43:12 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-12-09 01:43:12 +0500 |
| commit | 29477e67ede12347b153e2255325327374e1b073 (patch) | |
| tree | be9170a20d332eab1fcc8b380f70f231921aac45 /account/login/index.php | |
| parent | 28bb4f3618e2e947d14a05a24e99d826c26c0ce3 (diff) | |
feat: new configuration
Diffstat (limited to 'account/login/index.php')
| -rw-r--r-- | account/login/index.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/account/login/index.php b/account/login/index.php index 7aef703..b4223f2 100644 --- a/account/login/index.php +++ b/account/login/index.php @@ -21,13 +21,13 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $password = $_POST["password"]; $remember = intval($_POST["remember"] ?? "0") != 0; - $db = new PDO(DB_URL, DB_USER, DB_PASS); + $db = new PDO(CONFIG['database']['url'], CONFIG['database']['user'], CONFIG['database']['pass']); $stmt = $db->prepare("SELECT secret_key, password FROM users WHERE username = ? AND password IS NOT NULL"); $stmt->execute([$username]); if ($row = $stmt->fetch()) { if (password_verify($password, $row["password"])) { - setcookie("secret_key", $row["secret_key"], $remember ? (time() + ACCOUNT_COOKIE_MAX_LIFETIME) : 0, "/"); + setcookie("secret_key", $row["secret_key"], $remember ? (time() + CONFIG['account']['maxcookielifetime']) : 0, "/"); header("Location: /account"); exit; } else { @@ -44,7 +44,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { <html> <head> - <title>Login - <?php echo INSTANCE_NAME ?></title> + <title>Login - <?php echo CONFIG['instance']['name'] ?></title> <link rel="stylesheet" href="/static/style.css"> <link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon"> </head> @@ -57,7 +57,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { <?php display_alert() ?> <section class="box"> <div class="box navtab"> - <p>Log in to <?php echo INSTANCE_NAME ?></p> + <p>Log in to <?php echo CONFIG['instance']['name'] ?></p> </div> <div class="box content"> <form action="/account/login/" method="post"> @@ -75,7 +75,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { </div> <div> <button type="submit">Log in</button> - <?php if (ACCOUNT_REGISTRATION_ENABLE): ?> + <?php if (CONFIG['account']['registration']): ?> <a href="/account/register.php">Register</a> <?php endif; ?> </div> @@ -83,11 +83,11 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { </div> </section> - <?php if (TWITCH_REGISTRATION_ENABLE): ?> + <?php if (CONFIG['twitch']['registration']): ?> <section class="box column"> <a href="/account/login/twitch.php" class="button purple big">Login with Twitch</a> <p style="font-size: 12px;">Logging in via Twitch gives you the ability to use - <?php echo INSTANCE_NAME ?> emotes in your Twitch chat. + <?php echo CONFIG['instance']['name'] ?> emotes in your Twitch chat. </p> </section> <?php endif; ?> |
