Moved the Agents into their own repo. Kept the agent.pl just for reference

This commit is contained in:
Frank Harris 2025-09-11 13:27:32 -04:00
parent 22381be29a
commit 8680a02b13
18132 changed files with 0 additions and 2569420 deletions

View file

@ -1,42 +0,0 @@
/* Made for Revolution Based Themes */
.main-content {
background:transparent;
border:none;
padding:0;
border-radius:0px;
-moz-border-radius:0px;
}
#column2 #ref.online_servers div{
float:left;
text-align:left;
width:35%;
height:15px;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
-moz-binding: url('assets/xml/ellipsis.xml#ellipsis');
}
#column2 #ref.online_servers div#gamelink{
width:36%;
float:right;
text-align:right;
}
#column2 #ref.online_servers div.name{
width:29%;
height:18px;
white-space:nowrap;
}
#column2 #noref.online_servers div#gamelink{
float:right;
text-align:right;
width:40%;
height:18px;
overflow: hidden;
}
#column2 #noref.online_servers div.name{
float:left;
text-align:left;
width:57%;
height:18px;
overflow: hidden;
}

View file

@ -1,309 +0,0 @@
<script type="text/javascript" src="js/jquery/plugins/jquery.json-2.3.min.js"></script>
<script type="text/javascript" src="js/modules/dashboard.js"></script>
<?php
/*
*
* OGP - Open Game Panel
* Copyright (C) 2008 - 2018 The OGP Development Team
*
* http://www.opengamepanel.org/
*
* 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
require_once('includes/lib_remote.php');
function exec_ogp_module()
{
global $db, $settings, $loggedInUserInfo;
$isAdmin = $db->isAdmin($_SESSION['user_id']);
$user_id = $_SESSION['user_id'];
$page_user = (isset($_GET['page']) && (int)$_GET['page'] > 0) ? (int)$_GET['page'] : 1; // thanks for Adjokip
$limit_user = isset($_GET['limit']) ? $_GET['limit'] : 10;
if(hasValue($loggedInUserInfo) && is_array($loggedInUserInfo) && $loggedInUserInfo["users_page_limit"] && !(isset($_GET['limit']) and !empty($_GET['limit']))){
$limit_user = $loggedInUserInfo["users_page_limit"];
}
//show if new server created
$cartresult = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE user_id='".$_SESSION['user_id']."' AND status = 'paid' ");
$newServices=0;
foreach($cartresult as $res){
$newServices=$newServices + 1;
}
//Popup notification
if($newServices > 0) {
echo'<div class="alert alert-success alert-dismissible">
<a href="#" class="close" data-dismiss="alert" aria-label="close"></a>
<strong>GOOD NEWS!</strong> You have a new server! <br>
<form method="post" action="home.php?m=billing&p=create_servers">
<input type="hidden" name="cart_id" value="'. $res['cart_id'].'">
<button type="submit" name="submit_param" value="submit_value" class="link-button">
Create Server
</button>
</form>
</div>';
}
//Invoice is due.
$orderresult = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE user_id='".$_SESSION['user_id']."' AND status = 'renew'");
$invoicesDue=0;
foreach($orderresult as $res){
$invoicesDue=$invoicesDue + 1;
}
//Popup notification WARNING
if($invoicesDue > 0) {
echo'<div class="alert alert-warning alert-dismissible">
<a href="#" class="close" data-dismiss="alert" aria-label="close"></a>
You have an Invoice Due <br>
<form method="post" action="home.php?m=billing&p=create_servers">
<input type="hidden" name="cart_id" value="'. $res['cart_id'].'">
<button type="submit" name="submit_param" value="submit_value" class="link-button">
View Invoice
</button>
</div>';
}
//Server is suspended DANGER
$orderresult = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE user_id='".$_SESSION['user_id']."' AND status = 'suspended'");
$invoicesDue=0;
foreach($orderresult as $res){
$invoicesDue=$invoicesDue + 1;
}
//Popup notification
if($invoicesDue > 0) {
echo'<div class="alert alert-danger alert-dismissible">
<a href="#" class="close" data-dismiss="alert" aria-label="close"></a>
<strong>Warning!</strong> You have an OVERDUE invoice<br>
<form method="post" action="home.php?m=billing&p=create_servers">
<input type="hidden" name="cart_id" value="'. $res['cart_id'].'">
<button type="submit" name="submit_param" value="submit_value" class="link-button">
View Overdue Invoice
</button>
</div>';
}
if( isset($settings['welcome_title']) && $settings['welcome_title'] == "1" )
{
if( isset($settings['welcome_title_message']) && !empty($settings['welcome_title_message'] ))
{
echo "<div>" . $settings['welcome_title_message'] . "</div>";
}
}
require_once("includes/refreshed.php");
$refresh = new refreshed();
$OnlineServers .= "<p>Recent updates and changes</p>";
?>
<div style="margin-top:20px;">
<?php
//$title[$id] = "The Title";
//$content[$id] = "Content of the Widget";
$title = array();
$content = array();
$href = array();
// Order History
$title[1] = "Order History"; // get_lang('orders');
$content[1] = 'View all your orders, invoices and expiration dates. ';
$href[1] = 'home.php?m=billing&p=orders';
// Recent News
//$xml=simplexml_load_file("modules/news/data/listings.xml");
//$lastnews = count($xml)-1;
//$title[2] = "Recent News";
//$content[2] = $xml->listing[$lastnews]->title;
//$href[2] = 'home.php?m=news&p=news';
// Notifications
$title[3] = "Notifications"; // get_lang('orders');
$content[3] = 'View all your notifications. ';
$href[3] = 'home.php?m=circular&p=show_circular&list=true';
// Invoices
$title[4] = 'Current Invoices';
$content[4] ='An Invoice will be created before your server expires. Click here to view current invoices.<br>Invoices Due : '. $invoicesDue ;
$href[4] = 'home.php?m=billing&p=cart';
// Support
$title[5] = (isset($settings['support_widget_title']) && $settings['support_widget_title'] != "") ?
$settings['support_widget_title'] : get_lang('support');
$content[5] = '<img src="themes/' . $settings['theme'] . '/images/icons/support.png" style="width:48px;float:right;margin:0 0 0 8px" /> Submit a SUPPORT TICKET or use our Discord Chat at the bottom right. Click this box to JOIN our Discord';
$href[5] = 'https://discord.gg/cWHAbav';
$widgets = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXwidgets_users WHERE user_id='".$_SESSION['user_id']."' ORDER BY sort_no");
if(!$widgets)
{
if($db->createUserWidgets($_SESSION['user_id']))
$widgets = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXwidgets_users WHERE user_id='".$_SESSION['user_id']."' ORDER BY sort_no");
}
if($widgets)
{
$colhtml[1] = '<div class="column one_fourth" id="column1" >';
$colhtml[2] = '<div class="column one_two" id="column2" >';
$colhtml[3] = '<div class="column one_fourth" id="column3" >';
foreach($widgets as $widget)
{
if(array_key_exists($widget["widget_id"], $title)){
if( (!isset($settings['old_dashboard_behavior']) or $settings['old_dashboard_behavior'] == 0) AND $widget['widget_id'] == "3" )
continue;
$colhtml[$widget['column_id']] .= '<div class="dragbox bloc rounded" id="item'.$widget['widget_id'].'">'.
'<h4><span class="configure"></span>';
if(!is_null($title[$widget['widget_id']]))
$colhtml[$widget['column_id']] .= $title[$widget['widget_id']];
$colhtml[$widget['column_id']] .= '</h4><div class="dragbox-content" ';
if(!is_null($href[$widget['widget_id']]))
{
$colhtml[$widget['column_id']] .= "onclick=\"location.href='". $href[$widget['widget_id']] . "'\" style=\"cursor:pointer;";
if($widget['collapsed']==1)
$colhtml[$widget['column_id']] .= 'display:none;';
$colhtml[$widget['column_id']] .= '"';
}
elseif($widget['collapsed']==1)
$colhtml[$widget['column_id']] .= 'style="display:none;"';
$colhtml[$widget['column_id']] .= '>';
if(!is_null($content[$widget['widget_id']]))
$colhtml[$widget['column_id']] .= $content[$widget['widget_id']];
$colhtml[$widget['column_id']] .= '</div></div>';
}
}
foreach($colhtml as $html )
echo $html.'</div>';
}
if( $isAdmin AND $db->isModuleInstalled('status') )
{
echo "<h0>".get_lang('server_status')."</h0><br>";
$servers = $db->getRemoteServers();
echo "<div id='column4' style='float:left;width:40%;' >
<div class='bloc rounded' >
<h4>".get_lang('select_remote_server')."</h4>
<div>
<br>
<center>
<form action='' method='GET'>
<input type='hidden' name='m' value='".$_GET['m']."'/>
<input type='hidden' name='p' value='".$_GET['p']."'/>
<select name='remote_server_id' onchange=".'"this.form.submit()"'.">\n";
$agents_ips = array();
foreach ( $servers as $server_row )
{
$agents_ips[$server_row['remote_server_id']] = gethostbyname($server_row['agent_ip']);
if( !empty( $server_row['remote_server_id'] ) and !isset( $_GET['remote_server_id'] ) OR !empty( $server_row['remote_server_id'] ) and empty( $_GET['remote_server_id'] ) )
{
$_GET['remote_server_id'] = $server_row['remote_server_id'];
}
if( isset($_GET['remote_server_id']) AND $_GET['remote_server_id'] == $server_row['remote_server_id'] )
{
$remote = new OGPRemoteLibrary( $server_row['agent_ip'], $server_row['agent_port'],
$server_row['encryption_key'], $server_row['timeout'] );
$host_stat = $remote->status_chk();
if( $host_stat === 1 )
{
$checked = "selected='selected'";
}
else
{
$checked = '';
$_GET['remote_server_id'] = 'webhost';
}
}
else
{
$checked = '';
}
echo "<option value='".$server_row['remote_server_id']."' $checked >".$server_row['remote_server_name']."</option>\n";
}
if ( function_exists('exec') )
{
$host_ip = isset($_SERVER['LOCAL_ADDR']) ? $_SERVER['LOCAL_ADDR'] : $_SERVER['SERVER_ADDR'];
$remote_server_id = array_search($host_ip,$agents_ips);
$show_webhost = true;
if($remote_server_id)
{
$remote_server = $db->getRemoteServer($remote_server_id);
$remote = new OGPRemoteLibrary( $remote_server['agent_ip'], $remote_server['agent_port'],
$remote_server['encryption_key'], $remote_server['timeout'] );
$host_stat = $remote->status_chk();
if( $host_stat === 1 )
$show_webhost = false;
}
if($show_webhost)
{
$checked = ( isset($_GET['remote_server_id']) AND $_GET['remote_server_id'] == 'webhost' ) ? "selected='selected'" : "";
echo "<option value='webhost' $checked >Webhost Status</option>";
}
}
echo " </select>
</form>
</center>
<br><br>
</div>
</div>
</div>\n";
if( isset($_GET['remote_server_id']) AND ( $_GET['remote_server_id'] == "webhost" or $_GET['remote_server_id'] == "" ) )
unset($_GET['remote_server_id']);
if( isset($_GET['remote_server_id']) )
$remote_server = "&remote_server_id=".$_GET['remote_server_id'];
else
$remote_server = "";
if( isset($_GET['remote_server_id']) OR function_exists('exec') )
echo $refresh->getdiv($refresh->add("home.php?m=status&type=cleared".$remote_server));
}
?>
</div>
<script type="text/javascript">
$(document).ready(function(){
<?php echo $refresh->build(isset($settings['query_cache_life']) ? $settings['query_cache_life'] * 2000 : 60000); ?>
});
</script>
<?php
}
?>

View file

@ -1,243 +0,0 @@
<script type="text/javascript" src="js/jquery/plugins/jquery.json-2.3.min.js"></script>
<script type="text/javascript" src="js/modules/dashboard.js"></script>
<?php
/*
*
* OGP - Open Game Panel
* Copyright (C) 2008 - 2018 The OGP Development Team
*
* http://www.opengamepanel.org/
*
* 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
require('includes/lib_remote.php');
function exec_ogp_module()
{
global $db, $settings, $loggedInUserInfo;
$isAdmin = $db->isAdmin($_SESSION['user_id']);
$user_id = $_SESSION['user_id'];
$page_user = (isset($_GET['page']) && (int)$_GET['page'] > 0) ? (int)$_GET['page'] : 1; // thanks for Adjokip
$limit_user = isset($_GET['limit']) ? $_GET['limit'] : 10;
if(hasValue($loggedInUserInfo) && is_array($loggedInUserInfo) && $loggedInUserInfo["users_page_limit"] && !(isset($_GET['limit']) and !empty($_GET['limit']))){
$limit_user = $loggedInUserInfo["users_page_limit"];
}
$RecentNews = "Are you ready to get your own server? Click on the SHOP menu";
$RecentNewsTitle = "Rent a GameServer";
$result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE user_id='".$_SESSION['user_id']."' AND end_date IN (0, -1 , -2) ");
$invoicesDue=0;
foreach($result as $res){
$invoicesDue=$invoicesDue + 1;
}
if( isset($settings['welcome_title']) && $settings['welcome_title'] == "1" )
{
if( isset($settings['welcome_title_message']) && !empty($settings['welcome_title_message'] ))
{
echo "<div>" . $settings['welcome_title_message'] . "</div>";
}
}
require_once("includes/refreshed.php");
$refresh = new refreshed();
$OnlineServers .= "<p>Recent updates and changes</p>";
$RecentNews .= "<table style='width:100%;' class='online_servers' id='ref'>";
$RecentNews .= "</table><br>";
?>
<div style="margin-top:20px;">
<?php
//$title[$id] = "The Title";
//$content[$id] = "Content of the Widget";
$title = array();
$content = array();
$href = array();
// Game Monitor
$title[1] = get_lang('game_monitor');
$content[1] = '<img src="themes/' . $settings['theme'] . '/images/icons/game_monitor.png" style="width:48px;float:right;margin:0 0 0 8px" />View all your servers from the Game Monitor. This is where you can START/STOP and configure your server. ';
$href[1] = 'home.php?m=gamemanager&p=game_monitor';
// Online Server
$title[2] = $RecentNewsTitle;
$content[2] = $RecentNews;
$href[2] = 'home.php?m=billing&p=shop';
// Currently Online
$title[3] = "Something else";
$content[3] = "Something Else content";
$href[3] = null;
// Invoices
$title[4] = 'View Invoices';
$content[4] ='An Invoice will be created before your server expires. Click here to view all your past and current invoices.<h0><img src="images/invoice.png" style="width:48px;float:right;margin:0 0 0 8px" />Invoices Due : '. $invoicesDue . '</h0>';
$href[4] = 'home.php?m=billing&p=cart';
// Support
$title[5] = (isset($settings['support_widget_title']) && $settings['support_widget_title'] != "") ?
$settings['support_widget_title'] : get_lang('support');
$content[5] = (isset($settings['support_widget_content']) && $settings['support_widget_content'] != "") ?
$settings['support_widget_content'] : '<img src="themes/' . $settings['theme'] .
'/images/icons/support.png" style="width:48px;float:right;margin:0 0 0 8px" />' . get_lang('dashboard_support_text');
$href[5] = (isset($settings['support_widget_link']) && $settings['support_widget_link'] != "") ?
$settings['support_widget_link'] : '';
$widgets = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXwidgets_users WHERE user_id='".$_SESSION['user_id']."' ORDER BY sort_no");
if(!$widgets)
{
if($db->createUserWidgets($_SESSION['user_id']))
$widgets = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXwidgets_users WHERE user_id='".$_SESSION['user_id']."' ORDER BY sort_no");
}
if($widgets)
{
$colhtml[1] = '<div class="column one_fourth" id="column1" >';
$colhtml[2] = '<div class="column one_two" id="column2" >';
$colhtml[3] = '<div class="column one_fourth" id="column3" >';
foreach($widgets as $widget)
{
if( (!isset($settings['old_dashboard_behavior']) or $settings['old_dashboard_behavior'] == 0) AND $widget['widget_id'] == "3" )
continue;
$colhtml[$widget['column_id']] .= '<div class="dragbox bloc rounded" id="item'.$widget['widget_id'].'">'.
'<h4><span class="configure"></span>';
if(!is_null($title[$widget['widget_id']]))
$colhtml[$widget['column_id']] .= $title[$widget['widget_id']];
$colhtml[$widget['column_id']] .= '</h4><div class="dragbox-content" ';
if(!is_null($href[$widget['widget_id']]))
{
$colhtml[$widget['column_id']] .= "onclick=\"location.href='". $href[$widget['widget_id']] . "'\" style=\"cursor:pointer;";
if($widget['collapsed']==1)
$colhtml[$widget['column_id']] .= 'display:none;';
$colhtml[$widget['column_id']] .= '"';
}
elseif($widget['collapsed']==1)
$colhtml[$widget['column_id']] .= 'style="display:none;"';
$colhtml[$widget['column_id']] .= '>';
if(!is_null($content[$widget['widget_id']]))
$colhtml[$widget['column_id']] .= $content[$widget['widget_id']];
$colhtml[$widget['column_id']] .= '</div></div>';
}
foreach($colhtml as $html )
echo $html.'</div>';
}
if( $isAdmin AND $db->isModuleInstalled('status') )
{
echo "<h0>".get_lang('server_status')."</h0><br>";
$servers = $db->getRemoteServers();
echo "<div id='column4' style='float:left;width:40%;' >
<div class='bloc rounded' >
<h4>".get_lang('select_remote_server')."</h4>
<div>
<br>
<center>
<form action='' method='GET'>
<input type='hidden' name='m' value='".$_GET['m']."'/>
<input type='hidden' name='p' value='".$_GET['p']."'/>
<select name='remote_server_id' onchange=".'"this.form.submit()"'.">\n";
$agents_ips = array();
foreach ( $servers as $server_row )
{
$agents_ips[$server_row['remote_server_id']] = gethostbyname($server_row['agent_ip']);
if( !empty( $server_row['remote_server_id'] ) and !isset( $_GET['remote_server_id'] ) OR !empty( $server_row['remote_server_id'] ) and empty( $_GET['remote_server_id'] ) )
{
$_GET['remote_server_id'] = $server_row['remote_server_id'];
}
if( isset($_GET['remote_server_id']) AND $_GET['remote_server_id'] == $server_row['remote_server_id'] )
{
$remote = new OGPRemoteLibrary( $server_row['agent_ip'], $server_row['agent_port'],
$server_row['encryption_key'], $server_row['timeout'] );
$host_stat = $remote->status_chk();
if( $host_stat === 1 )
{
$checked = "selected='selected'";
}
else
{
$checked = '';
$_GET['remote_server_id'] = 'webhost';
}
}
else
{
$checked = '';
}
echo "<option value='".$server_row['remote_server_id']."' $checked >".$server_row['remote_server_name']."</option>\n";
}
if ( function_exists('exec') )
{
$host_ip = isset($_SERVER['LOCAL_ADDR']) ? $_SERVER['LOCAL_ADDR'] : $_SERVER['SERVER_ADDR'];
$remote_server_id = array_search($host_ip,$agents_ips);
$show_webhost = true;
if($remote_server_id)
{
$remote_server = $db->getRemoteServer($remote_server_id);
$remote = new OGPRemoteLibrary( $remote_server['agent_ip'], $remote_server['agent_port'],
$remote_server['encryption_key'], $remote_server['timeout'] );
$host_stat = $remote->status_chk();
if( $host_stat === 1 )
$show_webhost = false;
}
if($show_webhost)
{
$checked = ( isset($_GET['remote_server_id']) AND $_GET['remote_server_id'] == 'webhost' ) ? "selected='selected'" : "";
echo "<option value='webhost' $checked >Webhost Status</option>";
}
}
echo " </select>
</form>
</center>
<br><br>
</div>
</div>
</div>\n";
if( isset($_GET['remote_server_id']) AND ( $_GET['remote_server_id'] == "webhost" or $_GET['remote_server_id'] == "" ) )
unset($_GET['remote_server_id']);
if( isset($_GET['remote_server_id']) )
$remote_server = "&remote_server_id=".$_GET['remote_server_id'];
else
$remote_server = "";
if( isset($_GET['remote_server_id']) OR function_exists('exec') )
echo $refresh->getdiv($refresh->add("home.php?m=status&type=cleared".$remote_server));
}
?>
</div>
<script type="text/javascript">
$(document).ready(function(){
<?php echo $refresh->build(isset($settings['query_cache_life']) ? $settings['query_cache_life'] * 2000 : 60000); ?>
});
</script>
<?php
}
?>

View file

@ -1,60 +0,0 @@
<?php
/*
*
* OGP - Open Game Panel
* Copyright (C) 2008 - 2018 The OGP Development Team
*
* http://www.opengamepanel.org/
*
* 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
// Module general information
$module_title = "Dashboard";
$module_version = "1.0";
$db_version = 0;
$module_required = TRUE;
$module_menus = array( array( 'subpage' => 'dashboard', 'name'=>'Dashboard', 'group'=>'user' ) );
$install_queries = array();
$install_queries[0] = array(
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."widgets;",
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."widgets` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`column_id` int(11) NOT NULL,
`sort_no` int(11) NOT NULL,
`collapsed` tinyint(4) NOT NULL,
`title` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."widgets_users",
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."widgets_users` (
`user_id` int(11) NOT NULL,
`widget_id` int(11) NOT NULL,
`column_id` int(11) NOT NULL,
`sort_no` int(11) NOT NULL,
`collapsed` tinyint(4) NOT NULL,
`title` varchar(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
"INSERT INTO `".OGP_DB_PREFIX."widgets` (`id`, `column_id`, `sort_no`, `collapsed`, `title`) VALUES
(1, 1, 1, 0, 'Game Monitor'),
(2, 2, 0, 0, 'Online Server'),
(3, 2, 1, 0, 'Currently Online'),
(4, 3, 0, 0, 'FTP'),
(5, 3, 1, 0, 'Support'); ");
?>

View file

@ -1,5 +0,0 @@
<navigation>
<page key="dashboard" file="dashboard.php" access="admin,user,subuser" />
<page key="updateWidgets" file="updateWidgets.php" access="admin,user" />
<page key="query_ref" file="query_ref.php" access="admin,user,subuser" />
</navigation>

View file

@ -1,149 +0,0 @@
<?php
/*
*
* OGP - Open Game Panel
* Copyright (C) 2008 - 2018 The OGP Development Team
*
* http://www.opengamepanel.org/
*
* 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
function print_player_list_ogp_dashboard($player_list,$players,$playersmax,$gamename)
{
$data = "<center><table class='currently-online' >".
"<tr><td style='text-align:left;'>".
$gamename." [".$players.'/'.$playersmax."] ".
get_lang('players').":</td>\n</tr>";
foreach( $player_list as $player )
{
$data .= "<tr><td style='text-align:center;color:#".rand(0,5).rand(0,5).rand(0,5).";' >".$player['name']."</td></tr>";
}
$data .= '</table></center><br><br>';
return $data;
}
function exec_ogp_module()
{
$server_key = 'server_'.$_GET['ip'].'_'.$_GET['port'];
if(isset($_GET['show']) and $_GET['show'] == "players")
{
if(isset($_SESSION[$server_key]['online_players']))
{
echo $_SESSION[$server_key]['online_players'];
}
return;
}
if(isset($_GET['show']) and $_GET['show'] == "player_statistics")
{
//if($_SESSION['player_statistics']['playersmax'] > 0)
echo $_SESSION['player_statistics']['players'] . "/" . $_SESSION['player_statistics']['playersmax']. " " . players;
return;
}
global $db;
require('modules/gamemanager/home_handling_functions.php');
require('modules/config_games/server_config_parser.php');
$server_home = $_SESSION[$server_key];
$server_xml = read_server_config(SERVER_CONFIG_LOCATION."/".$server_home['home_cfg_file']);
$port = $server_home['port'];
$query_name = "";
$mod = "";
$stats_players = 0;
$stats_maxplayers = 0;
$ip = $server_home['ip'];
$port = $server_home['port'];
// Check if the screen running the server is running.
if ($server_xml->protocol == "gameq")
{
function print_player_list_gameq($player_list,$players,$playersmax){return FALSE;}
require('protocol/GameQ/GameQMonitor.php');
}
else if ($server_xml->protocol == "lgsl")
{
require('protocol/lgsl/functions.php');
require('protocol/lgsl/LGSLMonitor.php');
}
else if ($server_xml->protocol == "teamspeak3")
{
require('protocol/TeamSpeak3/TS3Monitor.php');
}
else
{
$status = "half";
}
if($status == "online")
{
echo "<div class='name' ><a title='".htmlentities($server_home['home_name']).
"' href='?m=gamemanager&amp;p=game_monitor&amp;home_id-mod_id-ip-port=".
$server_home['home_id']."-".$server_home['mod_id']."-".$server_home['ip']."-".$server_home['port'].
"' ><img style='border:0;height:12px;' src='images/magnifglass.png'/><span>".
htmlentities($server_home['home_name'])."</span></a></div>".
"<div><div style='font-size:8pt;' >[".$players.'/'.$playersmax."]</div> " . ((isset($mapRaw) && !empty($mapRaw)) ? htmlentities($mapRaw) : $map) .'</div>'.
"<div id='gamelink' >$address</div>";
$_SESSION[$server_key]['playersmax'] = $playersmax;
if ( $players >= 1 )
{
$_SESSION[$server_key]['online_players'] = print_player_list_ogp_dashboard($playersList,$players,$playersmax,$server_home['game_name']);
}
elseif(isset($_SESSION[$server_key]['online_players']))
unset($_SESSION[$server_key]['online_players']);
if ( isset($_SESSION[$server_key]['server_playersmax']) )
{
if( $_SESSION[$server_key]['server_playersmax'] != $playersmax )
{
$_SESSION['player_statistics']['playersmax'] += ($playersmax - $_SESSION['player_statistics']['playersmax']);
$_SESSION[$server_key]['server_playersmax'] = $playersmax;
}
}
else
{
$_SESSION['player_statistics']['playersmax'] += $playersmax;
$_SESSION[$server_key]['server_playersmax'] = $playersmax;
}
if ( isset($_SESSION[$server_key]['server_players']) )
{
if($_SESSION[$server_key]['server_players'] != $players)
{
$_SESSION['player_statistics']['players'] += ($players - $_SESSION[$server_key]['server_players']);
$_SESSION[$server_key]['server_players'] = $players;
}
}
else
{
$_SESSION['player_statistics']['players'] += $players;
$_SESSION[$server_key]['server_players'] = $players;
}
}
elseif($status == "half")
{
echo "<div class='name' ><a href='?m=gamemanager&amp;p=game_monitor&amp;home_id-mod_id-ip-port=" .
$server_home['home_id'] . "-" . $server_home['mod_id'] . "-" . $server_home['ip'] . "-" .
$server_home['port'] . "' ><img style='border:0;height:12px;' src='images/magnifglass.png'/>" .
htmlentities($server_home['home_name']) . "</a></div>".
"<div><div style='font-size:8pt;' ></div> </div>".
"<div id='gamelink' >" . $server_home['ip'] . ":$port</div>";
if(isset($_SESSION[$server_key]['online_players']))
unset($_SESSION[$server_key]['online_players']);
}
else
{
if(isset($_SESSION[$server_key]['online_players']))
unset($_SESSION[$server_key]['online_players']);
}
}

View file

@ -1,53 +0,0 @@
<?php
/*
*
* OGP - Open Game Panel
* Copyright (C) 2008 - 2018 The OGP Development Team
*
* http://www.opengamepanel.org/
*
* 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 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
function exec_ogp_module()
{
global $db;
if(!$_POST["data"]){
echo "Invalid data";
exit;
}
//decode JSON data received from AJAX POST request
$data=$_POST["data"];
$data = str_replace('\\','',$data);
$data = json_decode($data);
foreach($data->items as $item)
{
//Extract column number for panel
$col_id = preg_replace('/[^\d\s]/', '', $item->column);
//Extract id of the panel
$widget_id = preg_replace('/[^\d\s]/', '', $item->id);
if (is_numeric($col_id) && is_numeric($widget_id)) {
$db->query("UPDATE ".OGP_DB_PREFIX."widgets_users SET column_id='$col_id', sort_no='".(int)$item->order."', collapsed='".(int)$item->collapsed."' WHERE widget_id='".$widget_id."' AND user_id='".$_SESSION['user_id']."'");
}
}
echo "success";
}
?>