diff options
author | Minteck <contact@minteck.org> | 2022-04-12 15:42:17 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-04-12 15:42:17 +0200 |
commit | 300ab1d94c7d476a6c87f1d32d1756d8b04e3dbf (patch) | |
tree | 76de0ad8e98228eb63becd9db6f57141302b23ab /admin | |
parent | 62c7e1a74b35ef6d054fdf015d60ba52dc10eb14 (diff) | |
download | cloudsdale-300ab1d94c7d476a6c87f1d32d1756d8b04e3dbf.tar.gz cloudsdale-300ab1d94c7d476a6c87f1d32d1756d8b04e3dbf.tar.bz2 cloudsdale-300ab1d94c7d476a6c87f1d32d1756d8b04e3dbf.zip |
Improvements on PluralKit
Diffstat (limited to 'admin')
-rwxr-xr-x[-rw-r--r--] | admin/callback/index.php | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | admin/contact/index.php | 0 | ||||
-rwxr-xr-x | admin/general/index.php | 69 | ||||
-rwxr-xr-x[-rw-r--r--] | admin/index.php | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | admin/login/index.php | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | admin/pluralkit/index.php | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | admin/projects/index.php | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | admin/users/index.php | 0 |
8 files changed, 70 insertions, 1 deletions
diff --git a/admin/callback/index.php b/admin/callback/index.php index 7aaed70..7aaed70 100644..100755 --- a/admin/callback/index.php +++ b/admin/callback/index.php diff --git a/admin/contact/index.php b/admin/contact/index.php index 3310762..3310762 100644..100755 --- a/admin/contact/index.php +++ b/admin/contact/index.php diff --git a/admin/general/index.php b/admin/general/index.php new file mode 100755 index 0000000..95de883 --- /dev/null +++ b/admin/general/index.php @@ -0,0 +1,69 @@ +<?php require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/admin/session.php"; global $_USER; ?> +<?php + +if (isset($_GET['submit'])) { + if (isset($_GET["description"])) { + $config = json_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/data/general.json"), true); + if (trim($_GET['description']) === "") { + file_put_contents($_SERVER["DOCUMENT_ROOT"] . "/data/general.json", json_encode([ + "description" => "Lorem ipsum dolor sit amet", + "name" => $config["name"] + ], JSON_PRETTY_PRINT)); + } else { + file_put_contents($_SERVER["DOCUMENT_ROOT"] . "/data/general.json", json_encode([ + "description" => $_GET['description'], + "name" => $config["name"] + ], JSON_PRETTY_PRINT)); + } + header("Location: /admin/general"); + die(); + } + if (isset($_GET["name"])) { + $config = json_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/data/general.json"), true); + if (trim($_GET['name']) === "") { + file_put_contents($_SERVER["DOCUMENT_ROOT"] . "/data/general.json", json_encode([ + "description" => $config["description"], + "name" => "Cloudburst System" + ], JSON_PRETTY_PRINT)); + } else { + file_put_contents($_SERVER["DOCUMENT_ROOT"] . "/data/general.json", json_encode([ + "description" => $config['description'], + "name" => $_GET["name"] + ], JSON_PRETTY_PRINT)); + } + header("Location: /admin/general"); + die(); + } +} + +?> +<?php require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/admin/header.php"; $config = json_decode(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/data/general.json"), true); ?> + +<br> +<div class="container"> + <h1>General Preferences</h1> + + <form class="input-group mb-3" style="max-width: 500px;"> + <input name="description" value="<?= $config['description'] === 'Lorem ipsum dolor sit amet' ? '' : $config['description'] ?>" type="text" class="form-control" placeholder="Website Description"> + <input type="hidden" name="submit"> + <button class="btn btn-primary" type="submit">Save and apply</button> + </form> + + <form class="input-group mb-3" style="max-width: 500px;"> + <input name="name" value="<?= $config['name'] ?>" type="text" class="form-control" placeholder="Website Name"> + <input type="hidden" name="submit"> + <button class="btn btn-primary" type="submit">Save and apply</button> + </form> +</div> + +<style> + #system-icon { + border-radius: 999px; + width: 24px; + vertical-align: middle; + background: lightgray; + margin-right: 5px; + } +</style> + +<?php require_once $_SERVER["DOCUMENT_ROOT"] . "/includes/admin/footer.php"; ?>
\ No newline at end of file diff --git a/admin/index.php b/admin/index.php index f45cd62..7722af8 100644..100755 --- a/admin/index.php +++ b/admin/index.php @@ -11,7 +11,7 @@ <div class="card-body"> <h4 class="card-title">General</h4> <p class="card-text">General website configuration data.</p> - <a href="/admin/general" class="btn btn-primary disabled">Manage</a> + <a href="/admin/general" class="btn btn-primary">Manage</a> </div> </div> </div> diff --git a/admin/login/index.php b/admin/login/index.php index 9a12ac5..9a12ac5 100644..100755 --- a/admin/login/index.php +++ b/admin/login/index.php diff --git a/admin/pluralkit/index.php b/admin/pluralkit/index.php index c976882..c976882 100644..100755 --- a/admin/pluralkit/index.php +++ b/admin/pluralkit/index.php diff --git a/admin/projects/index.php b/admin/projects/index.php index 78e2b04..78e2b04 100644..100755 --- a/admin/projects/index.php +++ b/admin/projects/index.php diff --git a/admin/users/index.php b/admin/users/index.php index 1bc81d2..1bc81d2 100644..100755 --- a/admin/users/index.php +++ b/admin/users/index.php |