1<?php
2
3session_start();
4
5require_once '../priv/twig.php';
6require_once '../priv/pdo.php';
7
8if(!isset($_SESSION['qr']['is_admin']) || $_SESSION['qr']['is_admin'] === '0')
9{
10 header('Location: /qrkill/index.php');
11 die();
12}
13
14if($_SERVER['REQUEST_METHOD'] == 'POST')
15{
16 $conf['ga_track_id'] = $_POST['ga_track_id'];
17 $conf['killfeed_webhook'] = $_POST['killfeed_webhook'];
18 $conf['debug_webhook'] = $_POST['debug_webhook'];
19 file_put_contents(__DIR__ . "../priv/config.json", json_encode($conf));
20 header('Location: index.php');
21 die();
22}
23
24$model['database'] = DB::query('select database()')->fetchColumn();
25$model['config'] = json_decode(file_get_contents(__DIR__ . "/../priv/config.json"), true);
26echo $twig->render('admin/index.html', $model);