summaryrefslogtreecommitdiff
path: root/public/account
diff options
context:
space:
mode:
Diffstat (limited to 'public/account')
-rw-r--r--public/account/index.php2
-rw-r--r--public/account/login/index.php22
-rw-r--r--public/account/login/twitch.php12
3 files changed, 26 insertions, 10 deletions
diff --git a/public/account/index.php b/public/account/index.php
index a216eea..6b1385f 100644
--- a/public/account/index.php
+++ b/public/account/index.php
@@ -70,7 +70,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
<html>
<head>
- <title>Account management - alright.party</title>
+ <title>Account management - <?php echo INSTANCE_NAME ?></title>
<link rel="stylesheet" href="/static/style.css">
</head>
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");