-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.php
44 lines (35 loc) · 917 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
// Initial checkup.
if(!file_exists('config.php')){
if(file_exists('setup.php')){
die(header("Location: setup.php"));
}
http_response_code(500);
die("Config file not found. Please configure or reinstall.");
}
if(file_exists('setup.php')){
http_response_code(500);
die("Setup file found. Please delete setup.php before running.");
}
require 'auth.php';
$config = require 'config.php';
$web = file_get_contents("templates/render.html");
$main = "";
$modules = ["webhook", "sysinfo"];
foreach($modules as $m){
$main .= require "modules/$m.php";
}
foreach(scandir('modules/') as $m){
$file = "modules/$m.php";
if(file_exists($file) and is_readable($file)){
$main .= require_once $file;
}
}
$main .= file_get_contents("templates/loader.html");
$web = str_replace(
["%%TITLE%%", "%%BOTNAME%%", "%%MENU%%", "%%MAIN%%"],
["Dashboard", $config['bot']['name'], "", $main],
$web
);
echo $web;
?>