summaryrefslogtreecommitdiff
path: root/public/report/list.php
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-04-27 21:12:02 +0500
committerilotterytea <iltsu@alright.party>2025-04-27 21:12:02 +0500
commit9f1906c4cbb9878c5888723b7923fa8e4bebb51f (patch)
tree25f838ee0bb91f2a14d061906dde96967dd72a95 /public/report/list.php
parent00ab9aeaf0eac4c82e6480faee70add916db514f (diff)
feat: roles
Diffstat (limited to 'public/report/list.php')
-rw-r--r--public/report/list.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/public/report/list.php b/public/report/list.php
index 128f994..087eb55 100644
--- a/public/report/list.php
+++ b/public/report/list.php
@@ -3,11 +3,17 @@ include_once "../../src/accounts.php";
include_once "../../src/config.php";
include_once "../../src/partials.php";
include_once "../../src/utils.php";
+include_once "../../src/alert.php";
if (!authorize_user(true)) {
exit;
}
+if (isset($_SESSION["user_role"]) && !$_SESSION["user_role"]["permission_report"]) {
+ generate_alert("/404.php", "Not enough permissions", 403);
+ exit;
+}
+
$db = new PDO(DB_URL, DB_USER, DB_PASS);
$stmt = $db->prepare("SELECT * FROM reports WHERE sender_id = ? ORDER BY sent_at DESC");