summaryrefslogtreecommitdiff
path: root/system/index.php
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-12-08 21:53:36 +0500
committerilotterytea <iltsu@alright.party>2025-12-08 21:53:36 +0500
commit57472eab3c7b035392c6a5aa240593ecaa7d1ccf (patch)
tree9da30829290f225be2dab3d383549cbfda82ed19 /system/index.php
parent6541d0f3888862ab049055fd418b700f73eed367 (diff)
upd: moved all /public/ files to the root folder
Diffstat (limited to 'system/index.php')
-rw-r--r--system/index.php69
1 files changed, 69 insertions, 0 deletions
diff --git a/system/index.php b/system/index.php
new file mode 100644
index 0000000..95b17a5
--- /dev/null
+++ b/system/index.php
@@ -0,0 +1,69 @@
+<?php
+include_once "../../src/partials.php";
+include_once "../../src/accounts.php";
+include_once "../../src/alert.php";
+include_once "../../src/config.php";
+
+if (!MOD_SYSTEM_DASHBOARD) {
+ generate_alert("/404.php", "System dashboard is disabled", 405);
+ exit;
+}
+
+if (!authorize_user(true) || (!$_SESSION["user_role"]["permission_approve_emotes"] && !$_SESSION["user_role"]["permission_report_review"])) {
+ generate_alert("/404.php", "Not enough permissions", 403);
+ exit;
+}
+
+$db = new PDO(DB_URL, DB_USER, DB_PASS);
+
+?>
+
+<html>
+
+<head>
+ <title>System panel - <?php echo INSTANCE_NAME ?></title>
+ <link rel="stylesheet" href="/static/style.css">
+ <link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon">
+</head>
+
+<body>
+ <div class="container">
+ <div class="wrapper">
+ <?php html_navigation_bar() ?>
+ <section class="content">
+ <section class="box">
+ <div class="box navtab">System panel</div>
+ <div class="box content">
+ <?php
+ if (MOD_EMOTES_APPROVE && $_SESSION["user_role"]["permission_approve_emotes"]) {
+ echo '<a href="/system/emotes">Emotes';
+
+ $results = $db->query("SELECT COUNT(*) FROM emotes WHERE visibility = 2")->fetch()[0];
+
+ if ($results > 0) {
+ echo " ($results pending)";
+ }
+
+ echo '</a>';
+ }
+
+ if (REPORTS_ENABLE && $_SESSION["user_role"]["permission_report_review"]) {
+ echo '<a href="/system/reports">Reports';
+
+ $results = $db->query("SELECT COUNT(*) FROM reports WHERE resolved_by IS NULL")->fetch()[0];
+
+ if ($results > 0) {
+ echo " ($results pending)";
+ }
+
+ echo '</a>';
+ }
+ ?>
+ </div>
+ </section>
+ </section>
+ </div>
+ </div>
+</body>
+
+</html> \ No newline at end of file