diff options
| author | ilotterytea <iltsu@alright.party> | 2025-05-03 01:39:13 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-05-03 01:39:13 +0500 |
| commit | 64f0533dc1779e7cca5f2678f7ae560df8d922bb (patch) | |
| tree | be319637f1a6ae6839b3685d6348a528025a7248 /public/account/login | |
| parent | 0c25e3dd54225b126ad8e48e10f4fbde8ce26ec5 (diff) | |
feat: config sample and more config options
Diffstat (limited to 'public/account/login')
| -rw-r--r-- | public/account/login/index.php | 22 | ||||
| -rw-r--r-- | public/account/login/twitch.php | 12 |
2 files changed, 25 insertions, 9 deletions
diff --git a/public/account/login/index.php b/public/account/login/index.php index e104a88..954ccc9 100644 --- a/public/account/login/index.php +++ b/public/account/login/index.php @@ -3,12 +3,20 @@ include "../../../src/accounts.php"; authorize_user(); include "../../../src/partials.php"; +include_once "../../../src/config.php"; +include_once "../../../src/alert.php"; + +if (!ACCOUNT_REGISTRATION_ENABLE) { + generate_alert("/404.php", "Account registration is disabled", 403); + exit; +} + ?> <html> <head> - <title>Log in to alright.party</title> + <title>Login - <?php echo INSTANCE_NAME ?></title> <link rel="stylesheet" href="/static/style.css"> </head> @@ -20,13 +28,15 @@ include "../../../src/partials.php"; <section class="content"> <section class="box" style="width: 400px;"> <div class="box navtab"> - <p>Log in to alright.party</p> + <p>Log in to <?php echo INSTANCE_NAME ?></p> </div> <div class="box content"> - <form action="/account/login/twitch.php" method="GET"> - <button type="submit" class="purple" style="padding:8px 24px; font-size: 18px;">Login with - Twitch</button> - </form> + <?php if (TWITCH_REGISTRATION_ENABLE): ?> + <form action="/account/login/twitch.php" method="GET"> + <button type="submit" class="purple" style="padding:8px 24px; font-size: 18px;">Login with + Twitch</button> + </form> + <?php endif; ?> </div> </section> </section> diff --git a/public/account/login/twitch.php b/public/account/login/twitch.php index 1c72bc3..dfd319f 100644 --- a/public/account/login/twitch.php +++ b/public/account/login/twitch.php @@ -1,10 +1,16 @@ <?php include "../../../src/utils.php"; include_once "../../../src/config.php"; +include_once "../../../src/utils.php"; -$client_id = "472prq7kqn0a21l5um2lz7374471pp"; -$client_secret = "koho369mw8p51di4fx34jm2ogdmbj2"; -$redirect_uri = "http://localhost:8000/account/login/twitch.php"; +if (!TWITCH_REGISTRATION_ENABLE) { + generate_alert("/404.php", "Registration via Twitch is disabled", 405); + exit; +} + +$client_id = TWITCH_CLIENT_ID; +$client_secret = TWITCH_SECRET_KEY; +$redirect_uri = TWITCH_REDIRECT_URI; if (isset($_GET["error"])) { header("Location: /account/login"); |
