Remade serverinfo.php. Loads stages.xml, imports config.lua from textarea instead of requiring access to OT directory. Gives much more server information.

This commit is contained in:
Znote
2017-02-16 04:38:02 +01:00
parent 96802cb348
commit 0b442e9095
3 changed files with 346 additions and 78 deletions

View File

@@ -40,23 +40,6 @@ function data_dump($print = false, $var = false, $title = false) {
echo '</pre><br>';
}
function getConfigLua() {
$filename = config('server_path') . '/config.lua';
if (!file_exists($filename)) {
return;
}
$contents = file_get_contents($filename);
$array = explode("\n", $contents);
$output = [];
foreach ($array as $arr) {
if (strpos($arr, '--') !== 0) {
$output[] = $arr;
}
}
$ini = implode("\n", $output);
return parse_ini_string($ini);
}
function accountAccess($accountId, $TFS) {
$accountId = (int)$accountId;
$access = 0;