-
Notifications
You must be signed in to change notification settings - Fork 0
/
console.php
executable file
·84 lines (81 loc) · 3.19 KB
/
console.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
$build = "3193-930977370";
$version = "1.000";
$time = "1653110518";
$module = "Console";
/*
* quick_console.php
*
* Copyright 2022 Jim Richardson <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*
*/
include 'inc/master.inc.php';
$Auth = new Auth ();
$user = $Auth->getAuth();
$we_are_here = $settings['url'];
$tmp='';
if($user->loggedIn()) {
// set sidebar
// allow user to use the api (ready for v3)
}
else {
redirect('login.php');
}
$template = new template();
$template->load('templates/subtemplates/header.html');
$page['header'] = $template->get_template();
$template->load('templates/subtemplates/footer.html');
$page['footer'] = $template->get_template();
$template->load('templates/subtemplates/sidebar.html');
$page['sidebar'] = $template->get_template();
$page['bmenu'] = '';
$page['smenu'] = '';
// sidebar
$sql = "select * from server1 order by `host_name` ASC";
$servers = $database->get_results($sql);
foreach($servers as $server) {
// populate the game server section
$href = 'gameserver.php?server='.$server['host_name'];
$page['smenu'] .='<li><a class="" href="'.$href.'"><img style="width:16px;" src="'.$server['logo'].'"> '.$server['server_name'].' </a></li>';
}
$sql = "select * from base_servers where `enabled` = 1 and `extraip` = 0 ORDER BY `fname` ASC";
$base_servers = $database->get_results($sql);
foreach ($base_servers as $server) {
// populate base servers
$page['bmenu'] .='<li><a class="" href="baseserver.php?server='.$server['fname'].'"><i class="bi bi-server" style="font-size:12px;"></i>'.$server['fname'].'</a></li>';
}
$sql = "SELECT DISTINCT `host_name`,`server_name`,`url`,`bport`,`location`,`host`,`port` FROM server1 where `running` = 1 order by `host_name`";
$servers = $database->get_results($sql);
$sbox ='<option id ="" value="" path="" host ="">Choose Server</option>';
foreach ($servers as $server) {
//fill select box
$uri = parse_url($server['url']);
$url = $uri['scheme']."://".$uri['host'].':'.$server['bport'];
if (isset($uri['path'])) {$url .= $uri['path'];}
//echo "$url<br>";
//print_r($server);
$sbox .='<option id ="'.$server['host_name'].'" value="'.$url.'" path="'.$server['location'].'" host ="'.$server['host'].':'.$server['port'].'">'.$server['server_name'].'</option>';
}
$page['sbox'] = $sbox;
$template->load('templates/console.html');
//echo $template->get_template();
//die();
$template->replace_vars($page);
$template->publish();
?>