diff options
| author | ilotterytea <iltsu@alright.party> | 2025-12-09 01:43:12 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-12-09 01:43:12 +0500 |
| commit | 29477e67ede12347b153e2255325327374e1b073 (patch) | |
| tree | be9170a20d332eab1fcc8b380f70f231921aac45 /report | |
| parent | 28bb4f3618e2e947d14a05a24e99d826c26c0ce3 (diff) | |
feat: new configuration
Diffstat (limited to 'report')
| -rw-r--r-- | report/index.php | 7 | ||||
| -rw-r--r-- | report/list.php | 6 | ||||
| -rw-r--r-- | report/send.php | 4 |
3 files changed, 9 insertions, 8 deletions
diff --git a/report/index.php b/report/index.php index 7b1b259..fe83855 100644 --- a/report/index.php +++ b/report/index.php @@ -5,7 +5,7 @@ include_once "{$_SERVER['DOCUMENT_ROOT']}/lib/partials.php"; include_once "{$_SERVER['DOCUMENT_ROOT']}/lib/utils.php"; include_once "{$_SERVER['DOCUMENT_ROOT']}/lib/alert.php"; -if (!REPORTS_ENABLE) { +if (!CONFIG['reports']['enable']) { generate_alert("/404.php", "Reports are disabled", 403); exit; } @@ -19,7 +19,7 @@ if (isset($_SESSION["user_role"]) && !$_SESSION["user_role"]["permission_report" exit; } -$db = new PDO(DB_URL, DB_USER, DB_PASS); +$db = new PDO(CONFIG['database']['url'], CONFIG['database']['user'], CONFIG['database']['pass']); $report = null; $report_id = $_GET["id"] ?? ""; @@ -58,7 +58,8 @@ if ($contents == "") { <html> <head> - <title><?php echo ($report == null ? "Send a message to MODS" : "A message to MODS") . ' - ' . INSTANCE_NAME ?> + <title> + <?php echo ($report == null ? "Send a message to MODS" : "A message to MODS") . ' - ' . CONFIG['instance']['name'] ?> </title> <link rel="stylesheet" href="/static/style.css"> <link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon"> diff --git a/report/list.php b/report/list.php index 71c233e..94154fe 100644 --- a/report/list.php +++ b/report/list.php @@ -5,7 +5,7 @@ include_once "{$_SERVER['DOCUMENT_ROOT']}/lib/partials.php"; include_once "{$_SERVER['DOCUMENT_ROOT']}/lib/utils.php"; include_once "{$_SERVER['DOCUMENT_ROOT']}/lib/alert.php"; -if (!REPORTS_ENABLE) { +if (!CONFIG['reports']['enable']) { generate_alert("/404.php", "Reports are disabled", 403); exit; } @@ -19,7 +19,7 @@ if (isset($_SESSION["user_role"]) && !$_SESSION["user_role"]["permission_report" exit; } -$db = new PDO(DB_URL, DB_USER, DB_PASS); +$db = new PDO(CONFIG['database']['url'], CONFIG['database']['user'], CONFIG['database']['pass']); $stmt = $db->prepare("SELECT * FROM reports WHERE sender_id = ? ORDER BY sent_at DESC"); $stmt->execute([$_SESSION["user_id"]]); @@ -30,7 +30,7 @@ $reports = $stmt->fetchAll(PDO::FETCH_ASSOC); <html> <head> - <title>Report list - <?php echo INSTANCE_NAME ?></title> + <title>Report list - <?php echo CONFIG['instance']['name'] ?></title> <link rel="stylesheet" href="/static/style.css"> <link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon"> </head> diff --git a/report/send.php b/report/send.php index fe10ba6..fb4a726 100644 --- a/report/send.php +++ b/report/send.php @@ -4,7 +4,7 @@ include_once "{$_SERVER['DOCUMENT_ROOT']}/lib/config.php"; include_once "{$_SERVER['DOCUMENT_ROOT']}/lib/utils.php"; include_once "{$_SERVER['DOCUMENT_ROOT']}/lib/alert.php"; -if (!REPORTS_ENABLE) { +if (!CONFIG['reports']['enable']) { generate_alert("/404.php", "Reports are disabled", 403); exit; } @@ -18,7 +18,7 @@ if (isset($_SESSION["user_role"]) && !$_SESSION["user_role"]["permission_report" exit; } -$db = new PDO(DB_URL, DB_USER, DB_PASS); +$db = new PDO(CONFIG['database']['url'], CONFIG['database']['user'], CONFIG['database']['pass']); if (!isset($_POST["contents"])) { generate_alert("/report", "Not enough POST fields"); |
