Phase 1: Update database configuration and schema (OGP to GSP)
Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
parent
ea665c34d5
commit
7f19731158
82 changed files with 730 additions and 730 deletions
File diff suppressed because it is too large
Load diff
2
home.php
2
home.php
|
|
@ -25,7 +25,7 @@ $db = createDatabaseConnection($db_type, $db_host, $db_user, $db_pass, $db_name,
|
|||
// Load languages.
|
||||
include_once("includes/lang.php");
|
||||
|
||||
if (!$db instanceof OGPDatabase) {
|
||||
if (!$db instanceof GSPDatabase) {
|
||||
ogpLang();
|
||||
die(get_lang('no_db_connection'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ $db_host="localhost";
|
|||
$db_user="localuser";
|
||||
$db_pass="Pkloyn7yvpht!";
|
||||
$db_name="panel";
|
||||
$table_prefix="ogp_";
|
||||
$table_prefix="gsp_";
|
||||
$db_type="mysql";
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
* Database connection and query functions
|
||||
*/
|
||||
|
||||
define("OGP_DB_PREFIX", "OGP_DB_PREFIX");
|
||||
define("GSP_DB_PREFIX", "GSP_DB_PREFIX");
|
||||
|
||||
abstract class OGPDatabase {
|
||||
abstract class GSPDatabase {
|
||||
|
||||
protected $queries_ = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ function real_escape_string_recursive(&$item, $key, $link){
|
|||
$item = $this->realEscapeSingle($item);
|
||||
}
|
||||
|
||||
class OGPDatabaseMySQL extends OGPDatabase
|
||||
class GSPDatabaseMySQL extends GSPDatabase
|
||||
{
|
||||
protected $link;
|
||||
|
||||
|
|
@ -1144,7 +1144,7 @@ class OGPDatabaseMySQL extends OGPDatabase
|
|||
{
|
||||
if ( !$this->link ) return FALSE;
|
||||
|
||||
$query = str_replace( "OGP_DB_PREFIX", $this->table_prefix, $query );
|
||||
$query = str_replace( "GSP_DB_PREFIX", $this->table_prefix, $query );
|
||||
|
||||
++$this->queries_;
|
||||
mysqli_query($this->link,$query);
|
||||
|
|
@ -1159,7 +1159,7 @@ class OGPDatabaseMySQL extends OGPDatabase
|
|||
|
||||
/// \brief This query return array of values or false on failure.
|
||||
public function resultQuery( $query ) {
|
||||
$query = str_replace( "OGP_DB_PREFIX", $this->table_prefix, $query );
|
||||
$query = str_replace( "GSP_DB_PREFIX", $this->table_prefix, $query );
|
||||
return $this->listQuery($query);
|
||||
}
|
||||
|
||||
|
|
@ -3370,7 +3370,7 @@ class OGPDatabaseMySQL extends OGPDatabase
|
|||
$user_id = isset($_SESSION['user_id']) ? $_SESSION['user_id'] : 0;
|
||||
$client_ip = getClientIPAddress();
|
||||
$message = $this->realEscapeSingle($message);
|
||||
$this->query("INSERT INTO OGP_DB_PREFIXlogger (date, user_id, ip, message) VALUE (FROM_UNIXTIME(UNIX_TIMESTAMP(), '%d-%m-%Y %H:%i:%s'), $user_id, '$client_ip', '$message');");
|
||||
$this->query("INSERT INTO GSP_DB_PREFIXlogger (date, user_id, ip, message) VALUE (FROM_UNIXTIME(UNIX_TIMESTAMP(), '%d-%m-%Y %H:%i:%s'), $user_id, '$client_ip', '$message');");
|
||||
}
|
||||
|
||||
public function get_logger_count($search_field) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ function createDatabaseConnection($db_type,$db_host,$db_user,$db_pass,$db_name,$
|
|||
require_once("includes/database_mysqli.php");
|
||||
else
|
||||
die("<p class='failure'>OGP requires the <a href='http://php.net/manual/en/book.mysqli.php' target='_blank'>mysqli PHP extension</a>. Please install it, and then try again.</p>");
|
||||
$database = new OGPDatabaseMysql();
|
||||
$database = new GSPDatabaseMysql();
|
||||
$connect_value = $database->connect($db_host,$db_user,$db_pass,$db_name,$table_prefix);
|
||||
|
||||
if ($connect_value === TRUE)
|
||||
|
|
@ -51,7 +51,7 @@ function createDatabaseConnection($db_type,$db_host,$db_user,$db_pass,$db_name,$
|
|||
|
||||
function get_db_error_text ($db_retval, &$error_text)
|
||||
{
|
||||
if (is_a($db_retval,"OGPDatabase"))
|
||||
if (is_a($db_retval,"GSPDatabase"))
|
||||
return FALSE;
|
||||
|
||||
switch ($db_retval) {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class OGPView {
|
|||
function printView($cleared = false, $dataType = "html") {
|
||||
global $db, $OGPLangPre;
|
||||
|
||||
if ( is_object($db) && array_key_exists( "OGPDatabase", class_parents($db) ) ) {
|
||||
if ( is_object($db) && array_key_exists( "GSPDatabase", class_parents($db) ) ) {
|
||||
$panel_settings = $db->getSettings();
|
||||
}
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ class OGPView {
|
|||
$javascript .= '</script>' . "\n";
|
||||
|
||||
// Include global JS for modules
|
||||
if(is_object($db) && array_key_exists("OGPDatabase", class_parents($db))){
|
||||
if(is_object($db) && array_key_exists("GSPDatabase", class_parents($db))){
|
||||
foreach($db->getInstalledModules() as $m)
|
||||
{
|
||||
$global_js_file = 'js/' . MODULES . "{$m['folder']}_global.js";
|
||||
|
|
@ -194,7 +194,7 @@ class OGPView {
|
|||
|
||||
$footer = "";
|
||||
|
||||
if ( is_object($db) && array_key_exists( "OGPDatabase", class_parents($db) ) ) {
|
||||
if ( is_object($db) && array_key_exists( "GSPDatabase", class_parents($db) ) ) {
|
||||
$footer .= "<div class=\"footer center\">";
|
||||
$footer .= get_lang_f('cur_theme', !empty($_SESSION['users_theme']) ? $_SESSION['users_theme'] : @$panel_settings['theme']) . " - " . $db->getNbOfQueries()." ".get_lang('queries_executed');
|
||||
$footer .= "<br />".get_lang('copyright')." © <a href=\"http://www.opengamepanel.org\">Open Game Panel</a> " . date("Y") . " - ".get_lang('all_rights_reserved')." - <span class='versionInfo'>".get_lang('show_version')."</span><br /><div class='inline-block OGPVersionArea'><span class='version hide'>" . get_lang('version') . ":</span> <span class='hide versionNumber'>".@$panel_settings['ogp_version']."</span> <span class='copyVersionResult' lang='" . get_lang('copied') . "'></span></div></div>";
|
||||
|
|
|
|||
24
index.php
24
index.php
|
|
@ -42,7 +42,7 @@ $db = createDatabaseConnection($db_type, $db_host, $db_user, $db_pass, $db_name,
|
|||
// Load languages.
|
||||
include_once("includes/lang.php");
|
||||
|
||||
if (!$db instanceof OGPDatabase) {
|
||||
if (!$db instanceof GSPDatabase) {
|
||||
ogpLang();
|
||||
die(get_lang('no_db_connection'));
|
||||
}
|
||||
|
|
@ -216,10 +216,10 @@ function ogpHome()
|
|||
{
|
||||
$client_ip = getClientIPAddress();
|
||||
|
||||
$ban_list = $db->resultQuery("SHOW TABLES LIKE 'OGP_DB_PREFIXban_list';");
|
||||
$ban_list = $db->resultQuery("SHOW TABLES LIKE 'GSP_DB_PREFIXban_list';");
|
||||
if ( empty( $ban_list ) )
|
||||
{
|
||||
$db->query("CREATE TABLE IF NOT EXISTS `OGP_DB_PREFIXban_list` (
|
||||
$db->query("CREATE TABLE IF NOT EXISTS `GSP_DB_PREFIXban_list` (
|
||||
`client_ip` varchar(255) NOT NULL,
|
||||
`logging_attempts` int(11) NOT NULL DEFAULT '0',
|
||||
`banned_until` varchar(16) NOT NULL DEFAULT '0',
|
||||
|
|
@ -227,12 +227,12 @@ function ogpHome()
|
|||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
||||
}
|
||||
|
||||
$banlist_info = $db->resultQuery("SELECT logging_attempts, banned_until FROM `OGP_DB_PREFIXban_list` WHERE client_ip='".$client_ip."';");
|
||||
$banlist_info = $db->resultQuery("SELECT logging_attempts, banned_until FROM `GSP_DB_PREFIXban_list` WHERE client_ip='".$client_ip."';");
|
||||
$login_attempts = !$banlist_info ? 0 : $banlist_info['0']['logging_attempts'];
|
||||
|
||||
if( $banlist_info AND $banlist_info['0']['banned_until'] > 0 AND $banlist_info['0']['banned_until'] <= time() )
|
||||
{
|
||||
$db->query("DELETE FROM `OGP_DB_PREFIXban_list` WHERE client_ip='$client_ip';");
|
||||
$db->query("DELETE FROM `GSP_DB_PREFIXban_list` WHERE client_ip='$client_ip';");
|
||||
$login_attempts = 0;
|
||||
}
|
||||
|
||||
|
|
@ -308,9 +308,9 @@ function ogpHome()
|
|||
$_SESSION['users_api_key'] = $db->getApiToken($userInfo['user_id']);
|
||||
print_success( get_lang("logging_in") ."...");
|
||||
$db->logger( get_lang("logging_in") ."...");
|
||||
$db->query("DELETE FROM `OGP_DB_PREFIXban_list` WHERE client_ip='$client_ip';");
|
||||
$db->query("DELETE FROM `GSP_DB_PREFIXban_list` WHERE client_ip='$client_ip';");
|
||||
//find number of servers user has. if zero, then redirect to the shop page.
|
||||
$result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE user_id='".$_SESSION['user_id']."' AND status < 1 ");
|
||||
$result = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE user_id='".$_SESSION['user_id']."' AND status < 1 ");
|
||||
$servercount = 0;
|
||||
foreach($result as $servers)
|
||||
{
|
||||
|
|
@ -341,26 +341,26 @@ function ogpHome()
|
|||
$banned_until = time() + (array_key_exists("login_ban_time" , $settings) && !empty($settings["login_ban_time"]) && is_numeric($settings["login_ban_time"]) ? $settings["login_ban_time"] : 300); // Five minutes or user defined setting.
|
||||
|
||||
if( !$banlist_info )
|
||||
$db->query("INSERT INTO `OGP_DB_PREFIXban_list` (`client_ip`) VALUES('$client_ip');");
|
||||
$db->query("INSERT INTO `GSP_DB_PREFIXban_list` (`client_ip`) VALUES('$client_ip');");
|
||||
|
||||
$db->logger( get_lang("bad_login") . " ( Banned until " . date("r", $banned_until) . " ) [ " . login . ": $_POST[ulogin], " . password . ": ******** ]" );
|
||||
$db->query("UPDATE `OGP_DB_PREFIXban_list` SET logging_attempts='$login_attempts', banned_until='$banned_until' WHERE client_ip='$client_ip';");
|
||||
$db->query("UPDATE `GSP_DB_PREFIXban_list` SET logging_attempts='$login_attempts', banned_until='$banned_until' WHERE client_ip='$client_ip';");
|
||||
print_failure("Banned until " . date("r",$banned_until));
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !$banlist_info )
|
||||
$db->query("INSERT INTO `OGP_DB_PREFIXban_list` (`client_ip`) VALUES('$client_ip');");
|
||||
$db->query("INSERT INTO `GSP_DB_PREFIXban_list` (`client_ip`) VALUES('$client_ip');");
|
||||
|
||||
$db->logger( get_lang("bad_login") . " ( $login_attempts ) [ " . login . ": $_POST[ulogin], " . password . ": ******** ]" );
|
||||
$db->query("UPDATE `OGP_DB_PREFIXban_list` SET logging_attempts='$login_attempts' WHERE client_ip='$client_ip';");
|
||||
$db->query("UPDATE `GSP_DB_PREFIXban_list` SET logging_attempts='$login_attempts' WHERE client_ip='$client_ip';");
|
||||
$view->refresh("index.php",2);
|
||||
}
|
||||
}
|
||||
//ADD USERS IN BANNED GROUP TO BAN TABLE
|
||||
if($userInfo['users_role'] == "banned")
|
||||
{
|
||||
$db->query("INSERT INTO `OGP_DB_PREFIXban_list` (`client_ip`,`logging_attempts`) VALUES('$client_ip','-1');");
|
||||
$db->query("INSERT INTO `GSP_DB_PREFIXban_list` (`client_ip`,`logging_attempts`) VALUES('$client_ip','-1');");
|
||||
$db->logger("BANNED: Added IP ".$client_ip." to ban table of banned user " . $_POST[ulogin]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,11 +50,11 @@ function exec_ogp_module()
|
|||
$_SESSION['rserver_id'] = $_GET['rserver_id'];
|
||||
if( $isAdmin )
|
||||
{
|
||||
$TS3_list = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXts3_homes WHERE rserver_id='".$_SESSION['rserver_id']."'");
|
||||
$TS3_list = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXts3_homes WHERE rserver_id='".$_SESSION['rserver_id']."'");
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "SELECT * FROM OGP_DB_PREFIXts3_homes WHERE";
|
||||
$sql = "SELECT * FROM GSP_DB_PREFIXts3_homes WHERE";
|
||||
if(!$isAdmin){
|
||||
$sql .= " user_id='".$_SESSION['user_id']."' AND";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ $module_required = TRUE;
|
|||
$module_menus = array( array( 'subpage' => '', 'name'=>'ts3admin', 'group'=>'user' ) );
|
||||
$install_queries = array();
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."ts3_homes`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."ts3_homes`
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."ts3_homes`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."ts3_homes`
|
||||
(`ts3_id` int(50) NOT NULL auto_increment,
|
||||
`rserver_id` int(50) NOT NULL,
|
||||
`ip` varchar(20) NOT NULL,
|
||||
|
|
@ -22,9 +22,9 @@ $install_queries[0] = array(
|
|||
PRIMARY KEY (`ts3_id`),
|
||||
UNIQUE KEY user_id (user_id,vserver_id)) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
||||
$install_queries[1] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."ts3_homes` DROP INDEX `user_id` ,
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."ts3_homes` DROP INDEX `user_id` ,
|
||||
ADD UNIQUE `rserver_id` ( `rserver_id` , `vserver_id` , `user_id` );");
|
||||
$install_queries[2] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."ts3_homes` ADD `port` int(11) DEFAULT '10011'"
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."ts3_homes` ADD `port` int(11) DEFAULT '10011'"
|
||||
);
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ require_once('ts3remote.class.php');
|
|||
function getAssignedServerUsers()
|
||||
{
|
||||
global $db;
|
||||
$ts3vservers = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXts3_homes
|
||||
$ts3vservers = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXts3_homes
|
||||
WHERE vserver_id='".
|
||||
TS3WEBINTERFACE_VSERVER_ID."' AND rserver_id=".
|
||||
$_SESSION['rserver_id'] );
|
||||
|
|
@ -637,7 +637,7 @@ class TS3webinterface
|
|||
$vServerList = $tmp;
|
||||
}
|
||||
|
||||
$getPublicIp = $db->resultQuery("SELECT display_public_ip FROM OGP_DB_PREFIXremote_servers WHERE remote_server_id=".$_SESSION['rserver_id']);
|
||||
$getPublicIp = $db->resultQuery("SELECT display_public_ip FROM GSP_DB_PREFIXremote_servers WHERE remote_server_id=".$_SESSION['rserver_id']);
|
||||
$display_ip = checkDisplayPublicIP($getPublicIp[0]['display_public_ip'],$this->serverIP);
|
||||
|
||||
$this->template->assign('IP', $this->serverIP);
|
||||
|
|
@ -799,7 +799,7 @@ class TS3webinterface
|
|||
if( isset($_POST['assign_subuser']) and
|
||||
in_array($_POST['user_id'],$assigned_info['subusers']) )
|
||||
{
|
||||
$db->query("INSERT INTO OGP_DB_PREFIXts3_homes
|
||||
$db->query("INSERT INTO GSP_DB_PREFIXts3_homes
|
||||
(`rserver_id`, `ip`, `pwd`, `vserver_id`, `user_id`)
|
||||
VALUES ('".$_SESSION['rserver_id']."', '".
|
||||
TS3WEBINTERFACE_IP."', '".
|
||||
|
|
@ -814,7 +814,7 @@ class TS3webinterface
|
|||
in_array($_POST['user_id'],$assigned_info['users_assigned']) and
|
||||
in_array($_POST['user_id'],$assigned_info['subusers']) )
|
||||
{
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXts3_homes WHERE vserver_id='".
|
||||
$db->query( "DELETE FROM GSP_DB_PREFIXts3_homes WHERE vserver_id='".
|
||||
TS3WEBINTERFACE_VSERVER_ID."' AND user_id='".
|
||||
$_POST['user_id']."' AND rserver_id='".
|
||||
$_SESSION['rserver_id'].
|
||||
|
|
@ -831,7 +831,7 @@ class TS3webinterface
|
|||
$this->template->assign('is_parent_user', $is_parent_user);
|
||||
$this->template->assign('subusers_installed', $subusers_installed);
|
||||
|
||||
$getPublicIp = $db->resultQuery("SELECT display_public_ip FROM OGP_DB_PREFIXremote_servers WHERE remote_server_id=".$_SESSION['rserver_id']);
|
||||
$getPublicIp = $db->resultQuery("SELECT display_public_ip FROM GSP_DB_PREFIXremote_servers WHERE remote_server_id=".$_SESSION['rserver_id']);
|
||||
$display_ip = checkDisplayPublicIP($getPublicIp[0]['display_public_ip'],$this->serverIP);
|
||||
|
||||
$this->template->assign('display_public_ip', $display_ip);
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ function exec_ogp_module() {
|
|||
{
|
||||
$addon_id = (int)$_REQUEST['addon_id'];
|
||||
|
||||
$addons_rows = $db->resultQuery("SELECT url, path, post_script FROM OGP_DB_PREFIXaddons WHERE addon_id=".$addon_id.$query_groups);
|
||||
$addons_rows = $db->resultQuery("SELECT url, path, post_script FROM GSP_DB_PREFIXaddons WHERE addon_id=".$addon_id.$query_groups);
|
||||
|
||||
if (!$addons_rows) {
|
||||
print_failure(get_lang('invalid_addon'));
|
||||
|
|
@ -241,7 +241,7 @@ function exec_ogp_module() {
|
|||
<td align='left'>
|
||||
<select name="addon_id">
|
||||
<?php
|
||||
$addons = $db->resultQuery("SELECT addon_id, name FROM OGP_DB_PREFIXaddons WHERE addon_type='".$addon_type."' AND home_cfg_id=" . $home_cfg_id . $query_groups . " ORDER BY name ASC");
|
||||
$addons = $db->resultQuery("SELECT addon_id, name FROM GSP_DB_PREFIXaddons WHERE addon_type='".$addon_type."' AND home_cfg_id=" . $home_cfg_id . $query_groups . " ORDER BY name ASC");
|
||||
foreach($addons as $addon)
|
||||
{
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ function exec_ogp_module() {
|
|||
{
|
||||
print_success(get_lang_f("addon_has_been_created",$_POST['name']));
|
||||
if (isset($_POST['addon_id']) && (int)$_POST['addon_id'] > 0 && isset($_POST['edit']))
|
||||
$db->query("DELETE FROM OGP_DB_PREFIXaddons WHERE addon_id=" . (int)$_POST['addon_id']);
|
||||
$db->query("DELETE FROM GSP_DB_PREFIXaddons WHERE addon_id=" . (int)$_POST['addon_id']);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ function exec_ogp_module() {
|
|||
|
||||
if (isset($_POST['addon_id']) && (int)$_POST['addon_id'] > 0 && isset($_POST['edit']))
|
||||
{
|
||||
$addons_rows = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXaddons WHERE addon_id=".(int)$_POST['addon_id']);
|
||||
$addons_rows = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXaddons WHERE addon_id=".(int)$_POST['addon_id']);
|
||||
$addon_info = $addons_rows[0];
|
||||
$name = isset($addon_info['name']) ? $addon_info['name'] : "";
|
||||
$url = isset($addon_info['url']) ? $addon_info['url'] : "";
|
||||
|
|
@ -291,7 +291,7 @@ function exec_ogp_module() {
|
|||
<?php
|
||||
if (isset($_POST['addon_id']) && (int)$_POST['addon_id'] > 0 && isset($_POST['remove']))
|
||||
{
|
||||
if (!$db->query("DELETE FROM OGP_DB_PREFIXaddons WHERE addon_id=" . (int)$_POST['addon_id']))
|
||||
if (!$db->query("DELETE FROM GSP_DB_PREFIXaddons WHERE addon_id=" . (int)$_POST['addon_id']))
|
||||
print_lang('can_not_remove_addon');
|
||||
}
|
||||
|
||||
|
|
@ -301,24 +301,24 @@ function exec_ogp_module() {
|
|||
|
||||
if ( isset($_GET['show']) )
|
||||
{
|
||||
$result = $db->resultQuery("SELECT DISTINCT addon_id, name, game_name, url, path, group_id FROM OGP_DB_PREFIXaddons NATURAL JOIN OGP_DB_PREFIXconfig_homes WHERE addon_type='".$addon_type."' AND home_cfg_id=".$home_cfg_id);
|
||||
$result = $db->resultQuery("SELECT DISTINCT addon_id, name, game_name, url, path, group_id FROM GSP_DB_PREFIXaddons NATURAL JOIN GSP_DB_PREFIXconfig_homes WHERE addon_type='".$addon_type."' AND home_cfg_id=".$home_cfg_id);
|
||||
}
|
||||
elseif ( isset($_GET['show_all']) )
|
||||
{
|
||||
$result = $db->resultQuery("SELECT DISTINCT addon_id, name, game_name, url, path, group_id FROM OGP_DB_PREFIXaddons NATURAL JOIN OGP_DB_PREFIXconfig_homes");
|
||||
$result = $db->resultQuery("SELECT DISTINCT addon_id, name, game_name, url, path, group_id FROM GSP_DB_PREFIXaddons NATURAL JOIN GSP_DB_PREFIXconfig_homes");
|
||||
}
|
||||
elseif ( isset($_GET['show_type']))
|
||||
{
|
||||
$result = $db->resultQuery("SELECT DISTINCT addon_id, name, game_name, url, path, group_id FROM OGP_DB_PREFIXaddons NATURAL JOIN OGP_DB_PREFIXconfig_homes WHERE addon_type='".$addon_type."'");
|
||||
$result = $db->resultQuery("SELECT DISTINCT addon_id, name, game_name, url, path, group_id FROM GSP_DB_PREFIXaddons NATURAL JOIN GSP_DB_PREFIXconfig_homes WHERE addon_type='".$addon_type."'");
|
||||
}
|
||||
elseif ( isset($_GET['show_game']))
|
||||
{
|
||||
$result = $db->resultQuery("SELECT DISTINCT addon_id, name, game_name, url, path, group_id FROM OGP_DB_PREFIXaddons NATURAL JOIN OGP_DB_PREFIXconfig_homes WHERE home_cfg_id=".$home_cfg_id);
|
||||
$result = $db->resultQuery("SELECT DISTINCT addon_id, name, game_name, url, path, group_id FROM GSP_DB_PREFIXaddons NATURAL JOIN GSP_DB_PREFIXconfig_homes WHERE home_cfg_id=".$home_cfg_id);
|
||||
}
|
||||
elseif ( isset($_GET['show_group']))
|
||||
{
|
||||
$group_id = $group_id == '0' ? $group_id." OR group_id IS NULL" : $group_id;
|
||||
$result = $db->resultQuery("SELECT DISTINCT addon_id, name, game_name, url, path, group_id FROM OGP_DB_PREFIXaddons NATURAL JOIN OGP_DB_PREFIXconfig_homes WHERE group_id=".$group_id);
|
||||
$result = $db->resultQuery("SELECT DISTINCT addon_id, name, game_name, url, path, group_id FROM GSP_DB_PREFIXaddons NATURAL JOIN GSP_DB_PREFIXconfig_homes WHERE group_id=".$group_id);
|
||||
}
|
||||
?>
|
||||
<table class="center">
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ $module_menus = array( array( 'subpage' => 'addons_manager', 'name'=>'Addons Man
|
|||
|
||||
$install_queries = array();
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."addons`;",
|
||||
"CREATE TABLE IF NOT EXISTS ".OGP_DB_PREFIX."addons
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."addons`;",
|
||||
"CREATE TABLE IF NOT EXISTS ".GSP_DB_PREFIX."addons
|
||||
(addon_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(80) NOT NULL,
|
||||
url VARCHAR(200) NOT NULL,
|
||||
|
|
@ -22,8 +22,8 @@ $install_queries[0] = array(
|
|||
home_cfg_id VARCHAR(7) NOT NULL) ENGINE=MyISAM;");
|
||||
|
||||
$install_queries[1] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."addons` ADD `post_script` longtext NOT NULL;");
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."addons` ADD `post_script` longtext NOT NULL;");
|
||||
|
||||
$install_queries[2] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."addons` ADD `group_id` int(11) NULL;");
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."addons` ADD `group_id` int(11) NULL;");
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ if($_SESSION['users_role'] != "admin")
|
|||
$query_groups .= "group_id=".$group['group_id']." OR ";
|
||||
$query_groups .= "group_id=0 OR group_id IS NULL)";
|
||||
}
|
||||
$addons = $db->resultQuery("SELECT addon_id FROM OGP_DB_PREFIXaddons WHERE home_cfg_id=".$server_home['home_cfg_id'].$query_groups);
|
||||
$addons = $db->resultQuery("SELECT addon_id FROM GSP_DB_PREFIXaddons WHERE home_cfg_id=".$server_home['home_cfg_id'].$query_groups);
|
||||
$addons_qty = count($addons);
|
||||
if($addons and $addons_qty >= 1){
|
||||
$module_buttons = array(
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ function exec_ogp_module() {
|
|||
"<table class='center' >\n".
|
||||
"<tr><td>\n";
|
||||
$plugins = $db->resultQuery("SELECT DISTINCT addon_id, name, game_name ".
|
||||
"FROM OGP_DB_PREFIXaddons ".
|
||||
"NATURAL JOIN OGP_DB_PREFIXconfig_homes ".
|
||||
"FROM GSP_DB_PREFIXaddons ".
|
||||
"NATURAL JOIN GSP_DB_PREFIXconfig_homes ".
|
||||
"WHERE addon_type='plugin' ".
|
||||
"AND home_cfg_id=".$home_cfg_id.$query_groups);
|
||||
$plugins_qty = count($plugins);
|
||||
|
|
@ -42,8 +42,8 @@ function exec_ogp_module() {
|
|||
"&port=".$port."'>".get_lang('install_plugin')."(".$plugins_qty.")</a>\n";
|
||||
|
||||
$mappacks = $db->resultQuery("SELECT DISTINCT addon_id, name, game_name ".
|
||||
"FROM OGP_DB_PREFIXaddons ".
|
||||
"NATURAL JOIN OGP_DB_PREFIXconfig_homes ".
|
||||
"FROM GSP_DB_PREFIXaddons ".
|
||||
"NATURAL JOIN GSP_DB_PREFIXconfig_homes ".
|
||||
"WHERE addon_type='mappack' ".
|
||||
"AND home_cfg_id=".$home_cfg_id.$query_groups);
|
||||
$mappacks_qty = count($mappacks);
|
||||
|
|
@ -54,8 +54,8 @@ function exec_ogp_module() {
|
|||
"&port=".$port."'>".get_lang('install_mappack')."(".$mappacks_qty.")</a>\n";
|
||||
}
|
||||
$configs = $db->resultQuery("SELECT DISTINCT addon_id, name, game_name ".
|
||||
"FROM OGP_DB_PREFIXaddons ".
|
||||
"NATURAL JOIN OGP_DB_PREFIXconfig_homes ".
|
||||
"FROM GSP_DB_PREFIXaddons ".
|
||||
"NATURAL JOIN GSP_DB_PREFIXconfig_homes ".
|
||||
"WHERE addon_type='config' ".
|
||||
"AND home_cfg_id=".$home_cfg_id.$query_groups);
|
||||
$configs_qty = count($configs);
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@ function exec_ogp_module()
|
|||
foreach($_POST as $name => $ip)
|
||||
{
|
||||
$ip = $db->real_escape_string($ip);
|
||||
$db->query("DELETE FROM `OGP_DB_PREFIXban_list` WHERE client_ip = '$ip';");
|
||||
$db->query("DELETE FROM `GSP_DB_PREFIXban_list` WHERE client_ip = '$ip';");
|
||||
}
|
||||
}
|
||||
$ban_list = $db->resultQuery("SELECT logging_attempts, banned_until, client_ip FROM `OGP_DB_PREFIXban_list`;");
|
||||
$ban_list = $db->resultQuery("SELECT logging_attempts, banned_until, client_ip FROM `GSP_DB_PREFIXban_list`;");
|
||||
$ban_qty = 0;
|
||||
$ban_table = '';
|
||||
if($ban_list)
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ $module_required = TRUE;
|
|||
$module_menus = array( array( 'subpage' => 'watch_logger', 'name'=>'Watch Logger', 'group'=>'admin' ) );
|
||||
$install_queries = array();
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."adminExternalLinks`;",
|
||||
"CREATE TABLE IF NOT EXISTS ".OGP_DB_PREFIX."adminExternalLinks
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."adminExternalLinks`;",
|
||||
"CREATE TABLE IF NOT EXISTS ".GSP_DB_PREFIX."adminExternalLinks
|
||||
(
|
||||
link_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(80) NOT NULL,
|
||||
|
|
@ -21,8 +21,8 @@ $install_queries[0] = array(
|
|||
) ENGINE=MyISAM;");
|
||||
|
||||
$install_queries[1] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."logger`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."logger`
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."logger`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."logger`
|
||||
(
|
||||
`log_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
`date` varchar(20) NOT NULL,
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ function exec_ogp_module()
|
|||
$service_id = intval($_REQUEST['service_id']);
|
||||
|
||||
// Query for Selected service info.
|
||||
$qry_service = "SELECT DISTINCT service_id, home_cfg_id, mod_cfg_id, service_name, remote_server_id, slot_max_qty, slot_min_qty, price_daily, price_monthly, price_year, description, img_url FROM OGP_DB_PREFIXbilling_services WHERE service_id=".$db->realEscapeSingle($service_id);
|
||||
$qry_service = "SELECT DISTINCT service_id, home_cfg_id, mod_cfg_id, service_name, remote_server_id, slot_max_qty, slot_min_qty, price_daily, price_monthly, price_year, description, img_url FROM GSP_DB_PREFIXbilling_services WHERE service_id=".$db->realEscapeSingle($service_id);
|
||||
$result_service = $db->resultQuery($qry_service);
|
||||
$row_service = $result_service[0];
|
||||
//Compiling info about invoice to create an invoice order.
|
||||
|
|
@ -93,7 +93,7 @@ function exec_ogp_module()
|
|||
Checking if it's higher than 0 because if it's a non-numeric value, after casting it to an int it'll be 0.
|
||||
*/
|
||||
if($service_id !== 0) $where_service_id = " WHERE service_id=".$db->realEscapeSingle($service_id); else $where_service_id = "";
|
||||
$qry_services = "SELECT * FROM OGP_DB_PREFIXbilling_services".$where_service_id;
|
||||
$qry_services = "SELECT * FROM GSP_DB_PREFIXbilling_services".$where_service_id;
|
||||
$services = $db->resultQuery($qry_services);
|
||||
foreach ($services as $key => $row) {
|
||||
if($max_players < $row['slot_min_qty'] || $qty < 1){
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ function exec_ogp_module()
|
|||
$service_id = intval($_REQUEST['service_id']);
|
||||
|
||||
// Query for Selected service info.
|
||||
$qry_service = "SELECT DISTINCT service_id, home_cfg_id, mod_cfg_id, service_name, remote_server_id, slot_max_qty, slot_min_qty, price_daily, price_monthly, price_year, description, img_url FROM OGP_DB_PREFIXbilling_services WHERE service_id=".$db->realEscapeSingle($service_id);
|
||||
$qry_service = "SELECT DISTINCT service_id, home_cfg_id, mod_cfg_id, service_name, remote_server_id, slot_max_qty, slot_min_qty, price_daily, price_monthly, price_year, description, img_url FROM GSP_DB_PREFIXbilling_services WHERE service_id=".$db->realEscapeSingle($service_id);
|
||||
$result_service = $db->resultQuery($qry_service);
|
||||
$row_service = $result_service[0];
|
||||
//Compiling info about invoice to create an invoice order.
|
||||
|
|
@ -93,7 +93,7 @@ function exec_ogp_module()
|
|||
Checking if it's higher than 0 because if it's a non-numeric value, after casting it to an int it'll be 0.
|
||||
*/
|
||||
if($service_id !== 0) $where_service_id = " WHERE service_id=".$db->realEscapeSingle($service_id); else $where_service_id = "";
|
||||
$qry_services = "SELECT * FROM OGP_DB_PREFIXbilling_services".$where_service_id;
|
||||
$qry_services = "SELECT * FROM GSP_DB_PREFIXbilling_services".$where_service_id;
|
||||
$services = $db->resultQuery($qry_services);
|
||||
foreach ($services as $key => $row) {
|
||||
if($max_players < $row['slot_min_qty'] || $qty < 1){
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ function exec_ogp_module()
|
|||
$cart_id = $db->realEscapeSingle($cart_id);
|
||||
$isAdmin = $db->isAdmin( $_SESSION['user_id'] );
|
||||
if ( $isAdmin )
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$orders = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
else
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id)." AND user_id=".$db->realEscapeSingle($user_id) );
|
||||
$orders = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id)." AND user_id=".$db->realEscapeSingle($user_id) );
|
||||
|
||||
$cart = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$cart = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$tempdate = date_create( $cart[0]['date']);
|
||||
$paid_date = date_format($tempdate,"d M Y H:m");
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ function exec_ogp_module()
|
|||
|
||||
$coupon_savings = 0;
|
||||
if($cart[0]['coupon_id']>0) {
|
||||
$result = $db->resultquery("SELECT discount from OGP_DB_PREFIXbilling_coupons WHERE id = '". $cart[0]['coupon_id'] . "'");
|
||||
$result = $db->resultquery("SELECT discount from GSP_DB_PREFIXbilling_coupons WHERE id = '". $cart[0]['coupon_id'] . "'");
|
||||
foreach($result as $coupon){
|
||||
$coupon_savings = $subtotal2 * ($coupon['discount'] / 100);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ function assignOrdersToCart($user_id,$tax_amount,$currency,$coupon_id){
|
|||
//discount coupon
|
||||
if (!isset($coupon_id)) $coupon_id = "0";
|
||||
$fields['coupon_id'] = $coupon_id;
|
||||
$check_expired = $db->resultquery("SELECT id from OGP_DB_PREFIXbilling_coupons WHERE id = $fields[coupon_id] AND count > 0 AND expires >= NOW()");
|
||||
$check_expired = $db->resultquery("SELECT id from GSP_DB_PREFIXbilling_coupons WHERE id = $fields[coupon_id] AND count > 0 AND expires >= NOW()");
|
||||
if ($check_expired <= 0) $fields['coupon_id'] = 0;
|
||||
return $db->resultInsertId( 'billing_carts', $fields );
|
||||
}
|
||||
|
|
@ -52,10 +52,10 @@ function exec_ogp_module()
|
|||
|
||||
if( isset($_POST["update_cart"] )) {
|
||||
//print_r($_POST);
|
||||
$db->query( "UPDATE OGP_DB_PREFIXbilling_orders SET max_players= ".$_POST['slots']." WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
$db->query( "UPDATE OGP_DB_PREFIXbilling_orders SET qty= ".$_POST['qty']." WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
$db->query( "UPDATE OGP_DB_PREFIXbilling_orders SET invoice_duration = 'month' WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
$db->query( "UPDATE OGP_DB_PREFIXgame_mods SET max_players= ".$_POST['slots']." WHERE home_id=".$db->realEscapeSingle($_POST['homeid']));
|
||||
$db->query( "UPDATE GSP_DB_PREFIXbilling_orders SET max_players= ".$_POST['slots']." WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
$db->query( "UPDATE GSP_DB_PREFIXbilling_orders SET qty= ".$_POST['qty']." WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
$db->query( "UPDATE GSP_DB_PREFIXbilling_orders SET invoice_duration = 'month' WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
$db->query( "UPDATE GSP_DB_PREFIXgame_mods SET max_players= ".$_POST['slots']." WHERE home_id=".$db->realEscapeSingle($_POST['homeid']));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ function exec_ogp_module()
|
|||
if( isset($_POST["coupon_code"] ) && $_POST["coupon_code"] != "") {
|
||||
$coupon_id = 0;
|
||||
$coupon_code = "";
|
||||
$result = $db->resultquery("SELECT * from OGP_DB_PREFIXbilling_coupons WHERE code= '". $_POST['coupon_code'] . "'");
|
||||
$result = $db->resultquery("SELECT * from GSP_DB_PREFIXbilling_coupons WHERE code= '". $_POST['coupon_code'] . "'");
|
||||
$coupon_name = "<b style='color:red'>NON-EXISTING COUPON</b>";
|
||||
$coupon_discount = 0;
|
||||
foreach($result as $couponDB){
|
||||
|
|
@ -150,7 +150,7 @@ function exec_ogp_module()
|
|||
if( isset( $_POST["extend"] ) or isset( $_POST["extend_and_pay_paypal"] ))
|
||||
{
|
||||
|
||||
$orders = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
$orders = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
|
||||
// *****************************************
|
||||
//FIGURE OUT IF THIS IS ALREADY BEEN UPDATED
|
||||
|
|
@ -175,7 +175,7 @@ function exec_ogp_module()
|
|||
$status = 0;
|
||||
$finish_date = $order['finish_date'];
|
||||
$services = $db->resultQuery( "SELECT *
|
||||
FROM OGP_DB_PREFIXbilling_services
|
||||
FROM GSP_DB_PREFIXbilling_services
|
||||
WHERE service_id=".$db->realEscapeSingle($service_id) );
|
||||
$service = $services[0];
|
||||
//Calculating Price
|
||||
|
|
@ -196,7 +196,7 @@ function exec_ogp_module()
|
|||
//save the EXPIRED finish date into NEW finish date. Then check if FINISH DATE !=0 and move that + 1 month into status
|
||||
$order_id = saveOrderToDb($user_id,$service_id,$home_name,$ip,$max_players,$qty,$invoice_duration,$price,$remote_control_password,$ftp_password,$cart_id,$home_id,$status,$finish_date,"1");
|
||||
//Change the old order expiration to -3 so it can not be extended, since there is a new order managing the same game home.
|
||||
$db->query( "UPDATE OGP_DB_PREFIXbilling_orders
|
||||
$db->query( "UPDATE GSP_DB_PREFIXbilling_orders
|
||||
SET status=-3
|
||||
WHERE order_id=".$db->realEscapeSingle($_POST['order_id']));
|
||||
|
||||
|
|
@ -221,11 +221,11 @@ function exec_ogp_module()
|
|||
unset($_SESSION['coupon_id']);
|
||||
}
|
||||
$order_id = $_POST['order_id'];
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXbilling_orders WHERE order_id=".$db->realEscapeSingle($order_id) );
|
||||
$orders_in_cart = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$db->query( "DELETE FROM GSP_DB_PREFIXbilling_orders WHERE order_id=".$db->realEscapeSingle($order_id) );
|
||||
$orders_in_cart = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
if( !$orders_in_cart )
|
||||
{
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$db->query( "DELETE FROM GSP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -262,7 +262,7 @@ function exec_ogp_module()
|
|||
$carts[0] = $_SESSION['CART'];
|
||||
}
|
||||
|
||||
$user_carts = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE user_id=".$db->realEscapeSingle($user_id) ." order by cart_id desc" );
|
||||
$user_carts = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_carts WHERE user_id=".$db->realEscapeSingle($user_id) ." order by cart_id desc" );
|
||||
|
||||
|
||||
if( $user_carts >=1 )
|
||||
|
|
@ -273,8 +273,8 @@ function exec_ogp_module()
|
|||
{
|
||||
$cart_id = $user_cart['cart_id'];
|
||||
|
||||
$carts[$cart_id] = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts AS cart JOIN
|
||||
OGP_DB_PREFIXbilling_orders AS orders
|
||||
$carts[$cart_id] = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_carts AS cart JOIN
|
||||
GSP_DB_PREFIXbilling_orders AS orders
|
||||
ON orders.cart_id=cart.cart_id
|
||||
WHERE orders.status IN (0, -1 , -2) AND (cart.cart_id=".$db->realEscapeSingle($cart_id). ") order by order_id asc");
|
||||
}
|
||||
|
|
@ -465,7 +465,7 @@ function exec_ogp_module()
|
|||
//get max_slots and min_slots from the billing_services for this game.
|
||||
|
||||
$services = $db->resultQuery( "SELECT *
|
||||
FROM OGP_DB_PREFIXbilling_services
|
||||
FROM GSP_DB_PREFIXbilling_services
|
||||
WHERE service_id=".$db->realEscapeSingle($order['service_id']) );
|
||||
$service = $services[0];
|
||||
$min = $service['slot_min_qty'];
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ function exec_ogp_module()
|
|||
$id = $db->realEscapeSingle($_POST['id']);
|
||||
|
||||
//Create INSERT query
|
||||
$qry_change_url = "UPDATE OGP_DB_PREFIXbilling_coupons
|
||||
$qry_change_url = "UPDATE GSP_DB_PREFIXbilling_coupons
|
||||
SET code ='".$new_code."',
|
||||
name = '".$new_name."',
|
||||
discount ='".$new_discount."',
|
||||
|
|
@ -35,14 +35,14 @@ function exec_ogp_module()
|
|||
$expires = $_POST['expires'];
|
||||
|
||||
|
||||
$query = "INSERT INTO OGP_DB_PREFIXbilling_coupons(code, name, discount, count, expires) VALUES('".$code."', '".$name."', '".$discount."', '".$count."', '".$expires."')";
|
||||
$query = "INSERT INTO GSP_DB_PREFIXbilling_coupons(code, name, discount, count, expires) VALUES('".$code."', '".$name."', '".$discount."', '".$count."', '".$expires."')";
|
||||
$db->query($query);
|
||||
}
|
||||
|
||||
//Querying REMOVE coupon FROM DB
|
||||
if (isset($_POST['del_coupon']))
|
||||
{
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXbilling_coupons WHERE id=" . $db->realEscapeSingle($_POST['id']) );
|
||||
$db->query( "DELETE FROM GSP_DB_PREFIXbilling_coupons WHERE id=" . $db->realEscapeSingle($_POST['id']) );
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ function exec_ogp_module()
|
|||
</table>
|
||||
<br>
|
||||
<?php
|
||||
$result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_coupons");
|
||||
$result = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_coupons");
|
||||
if ($result > 0)
|
||||
{
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ function exec_ogp_module()
|
|||
$id = $db->realEscapeSingle($_POST['id']);
|
||||
|
||||
//Create INSERT query
|
||||
$qry_change_url = "UPDATE OGP_DB_PREFIXbilling_coupons
|
||||
$qry_change_url = "UPDATE GSP_DB_PREFIXbilling_coupons
|
||||
SET code ='".$new_code."',
|
||||
name = '".$new_name."',
|
||||
discount ='".$new_discount."',
|
||||
|
|
@ -35,14 +35,14 @@ function exec_ogp_module()
|
|||
$expires = $_POST['expires'];
|
||||
|
||||
|
||||
$query = "INSERT INTO OGP_DB_PREFIXbilling_coupons(code, name, discount, count, expires) VALUES('".$code."', '".$name."', '".$discount."', '".$count."', '".$expires."')";
|
||||
$query = "INSERT INTO GSP_DB_PREFIXbilling_coupons(code, name, discount, count, expires) VALUES('".$code."', '".$name."', '".$discount."', '".$count."', '".$expires."')";
|
||||
$db->query($query);
|
||||
}
|
||||
|
||||
//Querying REMOVE coupon FROM DB
|
||||
if (isset($_POST['del_coupon']))
|
||||
{
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXbilling_coupons WHERE id=" . $db->realEscapeSingle($_POST['id']) );
|
||||
$db->query( "DELETE FROM GSP_DB_PREFIXbilling_coupons WHERE id=" . $db->realEscapeSingle($_POST['id']) );
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ function exec_ogp_module()
|
|||
</table>
|
||||
<br>
|
||||
<?php
|
||||
$result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_coupons");
|
||||
$result = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_coupons");
|
||||
if ($result > 0)
|
||||
{
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@ function exec_ogp_module()
|
|||
if(isset($_GET['cart_id'])){
|
||||
$cart_id = $_GET['cart_id'];
|
||||
}
|
||||
$cart_paid = $db->resultQuery( "SELECT paid FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$cart_paid = $db->resultQuery( "SELECT paid FROM GSP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$isAdmin = $db->isAdmin( $_SESSION['user_id'] );
|
||||
if ( $isAdmin ){
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$orders = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
} else {
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id)." AND user_id=".$db->realEscapeSingle($user_id) );
|
||||
$orders = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id)." AND user_id=".$db->realEscapeSingle($user_id) );
|
||||
}
|
||||
if( !empty($orders) and !empty($cart_paid) )
|
||||
{
|
||||
|
|
@ -35,7 +35,7 @@ function exec_ogp_module()
|
|||
$extended = $order['extended'] == "1" ? TRUE : FALSE;
|
||||
//Query service info
|
||||
$service = $db->resultQuery( "SELECT *
|
||||
FROM OGP_DB_PREFIXbilling_services
|
||||
FROM GSP_DB_PREFIXbilling_services
|
||||
WHERE service_id=".$db->realEscapeSingle($service_id) );
|
||||
|
||||
if( !empty( $service[0] ) )
|
||||
|
|
@ -131,7 +131,7 @@ function exec_ogp_module()
|
|||
|
||||
//Add IP:Port Pair to the Game Home
|
||||
//need to get the IP_ID for this remote server.
|
||||
$result = $db->resultQuery("SELECT ip_id FROM OGP_DB_PREFIXremote_server_ips WHERE remote_server_id=".$ip);
|
||||
$result = $db->resultQuery("SELECT ip_id FROM GSP_DB_PREFIXremote_server_ips WHERE remote_server_id=".$ip);
|
||||
foreach ($result as $rs)
|
||||
{
|
||||
$ip_id = $rs['ip_id'];
|
||||
|
|
@ -336,33 +336,33 @@ function exec_ogp_module()
|
|||
|
||||
}
|
||||
// set order status
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_orders
|
||||
$db->query("UPDATE GSP_DB_PREFIXbilling_orders
|
||||
SET status='" . $db->realEscapeSingle($status) . "'
|
||||
WHERE order_id=".$db->realEscapeSingle($order_id));
|
||||
|
||||
// set the order expiration
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_orders
|
||||
$db->query("UPDATE GSP_DB_PREFIXbilling_orders
|
||||
SET finish_date='" . $db->realEscapeSingle($finish_date) . "'
|
||||
WHERE order_id=".$db->realEscapeSingle($order_id));
|
||||
|
||||
// Save home id created by this order
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_orders
|
||||
$db->query("UPDATE GSP_DB_PREFIXbilling_orders
|
||||
SET home_id='" . $db->realEscapeSingle($home_id) . "' WHERE order_id=".$db->realEscapeSingle($order_id));
|
||||
|
||||
}
|
||||
|
||||
//Update Cart Payment Status as 3(paid and installed)
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
$db->query("UPDATE GSP_DB_PREFIXbilling_carts
|
||||
SET paid=3
|
||||
WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
|
||||
// Set payment/creation date
|
||||
$date = date('d M Y');
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
$db->query("UPDATE GSP_DB_PREFIXbilling_carts
|
||||
SET date='" . $db->realEscapeSingle($date) . "'
|
||||
WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
|
||||
$db->query( "UPDATE OGP_DB_PREFIXgame_mods SET max_players= ".$order['max_players']." WHERE home_id=".$db->realEscapeSingle($home_id));
|
||||
$db->query( "UPDATE GSP_DB_PREFIXgame_mods SET max_players= ".$order['max_players']." WHERE home_id=".$db->realEscapeSingle($home_id));
|
||||
|
||||
|
||||
//Refresh to Game Monitor.
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ if (strcmp ($res, "VERIFIED") == 0) {
|
|||
$receiver_email = $_POST['receiver_email'];
|
||||
$payer_email = $_POST['payer_email'];
|
||||
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
$db->query("UPDATE GSP_DB_PREFIXbilling_carts
|
||||
SET paid=1
|
||||
WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
fwrite($fpx, "IPN Processed\n");
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ $module_menus = array(
|
|||
|
||||
$install_queries = array();
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."billing_services`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_services` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."billing_services`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."billing_services` (
|
||||
`service_id` int(11) NOT NULL auto_increment,
|
||||
`home_cfg_id` int(11) NOT NULL,
|
||||
`mod_cfg_id` int(11) NOT NULL,
|
||||
|
|
@ -58,8 +58,8 @@ $install_queries[0] = array(
|
|||
PRIMARY KEY (`service_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=UTF8;",
|
||||
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."billing_orders`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_orders` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."billing_orders`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."billing_orders` (
|
||||
`order_id` int(11) NOT NULL auto_increment,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`service_id` int(11) NOT NULL,
|
||||
|
|
@ -81,16 +81,16 @@ $install_queries[0] = array(
|
|||
);
|
||||
|
||||
$install_queries[1] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."billing_carts`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_carts` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."billing_carts`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."billing_carts` (
|
||||
`cart_id` int(11) NOT NULL auto_increment,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`paid` int(11) NULL,
|
||||
PRIMARY KEY (`cart_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=UTF8;",
|
||||
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."billing_orders`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_orders` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."billing_orders`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."billing_orders` (
|
||||
`order_id` int(11) NOT NULL auto_increment,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`service_id` int(11) NOT NULL,
|
||||
|
|
@ -111,25 +111,25 @@ $install_queries[1] = array(
|
|||
);
|
||||
|
||||
$install_queries[2] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` DROP `date`;",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` DROP `home_path`;",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` DROP `paid`;",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `home_id` varchar(255) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `status` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_carts` ADD `date` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_carts` ADD `tax_amount` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_carts` ADD `currency` varchar(3) NOT NULL DEFAULT '0';"
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` DROP `date`;",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` DROP `home_path`;",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` DROP `paid`;",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` ADD `home_id` varchar(255) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` ADD `status` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_carts` ADD `date` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_carts` ADD `tax_amount` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_carts` ADD `currency` varchar(3) NOT NULL DEFAULT '0';"
|
||||
);
|
||||
|
||||
$install_queries[3] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `finish_date` varchar(16) NOT NULL DEFAULT '0';"
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` ADD `finish_date` varchar(16) NOT NULL DEFAULT '0';"
|
||||
);
|
||||
|
||||
$install_queries[4] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `extended` tinyint(1) NOT NULL;",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_services` ADD `enabled` int(11) NOT NULL;"
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_carts` ADD `coupon_id` varchar(3) NOT NULL DEFAULT '0';"
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `coupon_id` varchar(3) NOT NULL DEFAULT '0';"
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` ADD `extended` tinyint(1) NOT NULL;",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_services` ADD `enabled` int(11) NOT NULL;"
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_carts` ADD `coupon_id` varchar(3) NOT NULL DEFAULT '0';"
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` ADD `coupon_id` varchar(3) NOT NULL DEFAULT '0';"
|
||||
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@ function exec_ogp_module()
|
|||
|
||||
if(isset($_POST['remove']))
|
||||
{
|
||||
$query_delete_order = $db->query("DELETE FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($_POST['cart_id']));
|
||||
$query_delete_order = $db->query("DELETE FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($_POST['cart_id']));
|
||||
$query_delete_order = $db->query("DELETE FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($_POST['cart_id']));
|
||||
$query_delete_order = $db->query("DELETE FROM GSP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($_POST['cart_id']));
|
||||
}
|
||||
if(isset($_POST['paid']))
|
||||
{
|
||||
$query_set_as_paid = $db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
$query_set_as_paid = $db->query("UPDATE GSP_DB_PREFIXbilling_carts
|
||||
SET paid=1
|
||||
WHERE cart_id=".$db->realEscapeSingle($_POST['cart_id']));
|
||||
}
|
||||
|
|
@ -54,7 +54,7 @@ function exec_ogp_module()
|
|||
echo "<h1>Accounting</h1>";
|
||||
$servercount = 0;
|
||||
$income = 0;
|
||||
$paidOrders = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE status > 0");
|
||||
$paidOrders = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE status > 0");
|
||||
foreach($paidOrders as $inc)
|
||||
{
|
||||
$servercount = $servercount +1;
|
||||
|
|
@ -70,9 +70,9 @@ function exec_ogp_module()
|
|||
{
|
||||
{
|
||||
if ($isAdmin){
|
||||
$carts = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE paid =" . $db->realEscapeSingle($paid_value) ." order by cart_id DESC");
|
||||
$carts = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_carts WHERE paid =" . $db->realEscapeSingle($paid_value) ." order by cart_id DESC");
|
||||
}else{
|
||||
$carts = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE paid=3 AND user_id = " . $user_id ." order by cart_id DESC");
|
||||
$carts = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_carts WHERE paid=3 AND user_id = " . $user_id ." order by cart_id DESC");
|
||||
}
|
||||
if( $carts > 0 )
|
||||
{
|
||||
|
|
@ -97,7 +97,7 @@ function exec_ogp_module()
|
|||
}?>
|
||||
</tr>
|
||||
<?php
|
||||
$orders = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart['cart_id'])." order by order_id DESC" );
|
||||
$orders = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart['cart_id'])." order by order_id DESC" );
|
||||
$subtotal = 0;
|
||||
foreach($orders as $order)
|
||||
{
|
||||
|
|
@ -212,7 +212,7 @@ function exec_ogp_module()
|
|||
//obter as informações de cupom usadas neste pedido
|
||||
$coupon_savings = 0;
|
||||
if($cart['coupon_id']>0) {
|
||||
$result = $db->resultquery("SELECT * from OGP_DB_PREFIXbilling_coupons WHERE id = '". $cart['coupon_id'] . "'");
|
||||
$result = $db->resultquery("SELECT * from GSP_DB_PREFIXbilling_coupons WHERE id = '". $cart['coupon_id'] . "'");
|
||||
foreach($result as $coupon){
|
||||
$coupon_savings = $subtotal * ($coupon['discount']/ 100);
|
||||
echo "Sub-total c/discount <b>$" .number_format( ($subtotal - $coupon_savings) , 2 ).$cart['currency']."</b></br><td>";
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ global $db,$view,$settings;
|
|||
$loadpage = "?m=billing&p=paid";
|
||||
$count = $_POST['count'] + 1;
|
||||
|
||||
$result = $db->resultquery("SELECT * from OGP_DB_PREFIXbilling_carts WHERE cart_id= '". $_POST['cart_id'] . "'");
|
||||
$result = $db->resultquery("SELECT * from GSP_DB_PREFIXbilling_carts WHERE cart_id= '". $_POST['cart_id'] . "'");
|
||||
foreach($result as $cartID){
|
||||
$paid = $cartID['paid'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ $debug = $settings['debug'];
|
|||
|
||||
if(!empty($cart_id))
|
||||
{
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
$orders = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
//get couponID then discount for this cart
|
||||
$result= $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
$result= $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
foreach ($result as $cartDB){
|
||||
$coupon_id = $cartDB['id'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ function exec_ogp_module()
|
|||
$service = $db->realEscapeSingle($_POST['service']);
|
||||
|
||||
//Create UPDATE query
|
||||
$qry_change_url = "UPDATE OGP_DB_PREFIXbilling_services
|
||||
$qry_change_url = "UPDATE GSP_DB_PREFIXbilling_services
|
||||
SET remote_server_id = '".$new_remote_server_id."',
|
||||
price_monthly ='".$new_price_monthly."',
|
||||
remote_server_id = '".$new_remote_server_id."',
|
||||
|
|
@ -28,7 +28,7 @@ function exec_ogp_module()
|
|||
//Querying UPDATE enabled/disabled remote servers DB
|
||||
if (isset($_POST['update_remote_servers']))
|
||||
{
|
||||
$result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXremote_servers");
|
||||
$result = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXremote_servers");
|
||||
foreach($result as $rs)
|
||||
{
|
||||
$server_enabled = 0;
|
||||
|
|
@ -40,7 +40,7 @@ function exec_ogp_module()
|
|||
}
|
||||
|
||||
//update the table with current value
|
||||
$query = "UPDATE OGP_DB_PREFIXremote_servers SET enabled = '".$server_enabled."' WHERE remote_server_id=".$rs['remote_server_id'];
|
||||
$query = "UPDATE GSP_DB_PREFIXremote_servers SET enabled = '".$server_enabled."' WHERE remote_server_id=".$rs['remote_server_id'];
|
||||
$db->query($query);
|
||||
|
||||
}
|
||||
|
|
@ -83,14 +83,14 @@ function exec_ogp_module()
|
|||
if(isset($_POST['allow_ftp_usage']))$access_rights .= $db->realEscapeSingle($_POST['allow_ftp_usage']);
|
||||
if(isset($_POST['allow_custom_fields']))$access_rights .= $db->realEscapeSingle($_POST['allow_custom_fields']);
|
||||
|
||||
$qry_add_service = "INSERT INTO OGP_DB_PREFIXbilling_services(service_id, home_cfg_id, mod_cfg_id, service_name, remote_server_id, out_of_stock, slot_max_qty , slot_min_qty, price_daily, price_monthly, price_year, description, img_url, ftp, install_method, manual_url, access_rights,enabled) VALUES(NULL, '".$home_cfg_id."', '".$mod_cfg_id."', '".$service_name."', '".$remote_server_id."', 0,'".$slot_max_qty."', '".$slot_min_qty."', '".$price_daily."', '".$price_monthly."', '".$price_year."', '".$description."', '".$img_url."', '".$ftp."', '".$install_method."', '".$manual_url."', '".$access_rights."', '" . $enabled . "')";
|
||||
$qry_add_service = "INSERT INTO GSP_DB_PREFIXbilling_services(service_id, home_cfg_id, mod_cfg_id, service_name, remote_server_id, out_of_stock, slot_max_qty , slot_min_qty, price_daily, price_monthly, price_year, description, img_url, ftp, install_method, manual_url, access_rights,enabled) VALUES(NULL, '".$home_cfg_id."', '".$mod_cfg_id."', '".$service_name."', '".$remote_server_id."', 0,'".$slot_max_qty."', '".$slot_min_qty."', '".$price_daily."', '".$price_monthly."', '".$price_year."', '".$description."', '".$img_url."', '".$ftp."', '".$install_method."', '".$manual_url."', '".$access_rights."', '" . $enabled . "')";
|
||||
$db->query($qry_add_service);
|
||||
}
|
||||
|
||||
//Querying REMOVE service FROM DB
|
||||
if (isset($_POST['service_id']))
|
||||
{
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXbilling_services WHERE service_id=" . $db->realEscapeSingle($_POST['service_id']) );
|
||||
$db->query( "DELETE FROM GSP_DB_PREFIXbilling_services WHERE service_id=" . $db->realEscapeSingle($_POST['service_id']) );
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -106,7 +106,7 @@ function exec_ogp_module()
|
|||
<td>
|
||||
<select name="modcfgid">
|
||||
<?php
|
||||
$mod_qry = $db->resultQuery("SELECT DISTINCT mod_cfg_id, mod_name, game_name FROM OGP_DB_PREFIXconfig_mods NATURAL JOIN OGP_DB_PREFIXconfig_homes WHERE home_cfg_id=" . $db->realEscapeSingle($_POST['home_cfg_id']));
|
||||
$mod_qry = $db->resultQuery("SELECT DISTINCT mod_cfg_id, mod_name, game_name FROM GSP_DB_PREFIXconfig_mods NATURAL JOIN GSP_DB_PREFIXconfig_homes WHERE home_cfg_id=" . $db->realEscapeSingle($_POST['home_cfg_id']));
|
||||
foreach($mod_qry as $array_mods)
|
||||
{
|
||||
if($array_mods['mod_name'] == "none")$array_mods['mod_name']=$array_mods['game_name'];
|
||||
|
|
@ -128,7 +128,7 @@ function exec_ogp_module()
|
|||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$result3 = $db->resultQuery("SELECT DISTINCT remote_server_id, remote_server_name, agent_ip, ogp_user FROM OGP_DB_PREFIXremote_servers");
|
||||
$result3 = $db->resultQuery("SELECT DISTINCT remote_server_id, remote_server_name, agent_ip, ogp_user FROM GSP_DB_PREFIXremote_servers");
|
||||
?>
|
||||
<td><?php print_lang('remote_server');?></td>
|
||||
<td>
|
||||
|
|
@ -146,7 +146,7 @@ function exec_ogp_module()
|
|||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$mods = $db->resultQuery("SELECT DISTINCT mod_cfg_id, mod_name, game_name FROM OGP_DB_PREFIXconfig_mods NATURAL JOIN OGP_DB_PREFIXconfig_homes WHERE mod_cfg_id=" . $db->realEscapeSingle($_POST['modcfgid']));
|
||||
$mods = $db->resultQuery("SELECT DISTINCT mod_cfg_id, mod_name, game_name FROM GSP_DB_PREFIXconfig_mods NATURAL JOIN GSP_DB_PREFIXconfig_homes WHERE mod_cfg_id=" . $db->realEscapeSingle($_POST['modcfgid']));
|
||||
foreach($mods as $mod)
|
||||
{
|
||||
?>
|
||||
|
|
@ -257,7 +257,7 @@ function exec_ogp_module()
|
|||
<h2>Enable/Disable Server Locations</h2>
|
||||
<?php
|
||||
//ENABLE OR DISABLE REMOTE SERVERS FOR GAMES
|
||||
$result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXremote_servers");
|
||||
$result = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXremote_servers");
|
||||
echo "<form method='post' action=''>";
|
||||
echo "<input type='hidden' name='update_remote_servers' value='update' />";
|
||||
foreach($result as $rs)
|
||||
|
|
@ -278,7 +278,7 @@ function exec_ogp_module()
|
|||
<br><br>";
|
||||
//end ENABLE REMOTE SERVERS
|
||||
|
||||
$services = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_services ORDER BY service_name");
|
||||
$services = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_services ORDER BY service_name");
|
||||
if ($services > 0)
|
||||
{
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ function exec_ogp_module()
|
|||
$new_description = str_replace("\\r\\n", "<br>", $_POST['description']);
|
||||
$service = $_POST['service_id'];
|
||||
|
||||
$change_description = "UPDATE OGP_DB_PREFIXbilling_services
|
||||
$change_description = "UPDATE GSP_DB_PREFIXbilling_services
|
||||
SET description ='".$db->realEscapeSingle($new_description)."'
|
||||
WHERE service_id=".$db->realEscapeSingle($service);
|
||||
$save = $db->query($change_description);
|
||||
|
|
@ -63,7 +63,7 @@ THIS IS WHAT WE DISPLAY ON THE SHOP PAGE AT THE TOP
|
|||
|
||||
// Shop Form
|
||||
if(intval($_REQUEST['service_id']) !==0) $where_service_id = " WHERE enabled = 1 and service_id=".intval($_REQUEST['service_id']); else $where_service_id = " where enabled = 1";
|
||||
$qry_services = "SELECT * FROM OGP_DB_PREFIXbilling_services".$where_service_id;
|
||||
$qry_services = "SELECT * FROM GSP_DB_PREFIXbilling_services".$where_service_id;
|
||||
$services = $db->resultQuery($qry_services);
|
||||
|
||||
if (isset($_REQUEST['service_id']) && $services === false) {
|
||||
|
|
@ -208,7 +208,7 @@ if ($row['price_monthly'] == 0.0) {
|
|||
//loop through each of the assigned servers and see if its disabled
|
||||
foreach($rsiArray as $rsi)
|
||||
{
|
||||
$query = "SELECT * FROM OGP_DB_PREFIXremote_servers WHERE remote_server_id = ".$rsi;
|
||||
$query = "SELECT * FROM GSP_DB_PREFIXremote_servers WHERE remote_server_id = ".$rsi;
|
||||
$result = $db->resultQuery($query);
|
||||
foreach($result as $rs)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ function exec_ogp_module()
|
|||
$cart_id = $db->realEscapeSingle($cart_id);
|
||||
$isAdmin = $db->isAdmin( $_SESSION['user_id'] );
|
||||
if ( $isAdmin )
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$orders = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
else
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id)." AND user_id=".$db->realEscapeSingle($user_id) );
|
||||
$orders = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id)." AND user_id=".$db->realEscapeSingle($user_id) );
|
||||
|
||||
$cart = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$cart = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$tempdate = date_create( $cart[0]['date']);
|
||||
$paid_date = date_format($tempdate,"d M Y H:m");
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ function exec_ogp_module()
|
|||
|
||||
$coupon_savings = 0;
|
||||
if($cart[0]['coupon_id']>0) {
|
||||
$result = $db->resultquery("SELECT discount from OGP_DB_PREFIXbilling_coupons WHERE id = '". $cart[0]['coupon_id'] . "'");
|
||||
$result = $db->resultquery("SELECT discount from GSP_DB_PREFIXbilling_coupons WHERE id = '". $cart[0]['coupon_id'] . "'");
|
||||
foreach($result as $coupon){
|
||||
$coupon_savings = $subtotal2 * ($coupon['discount'] / 100);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ function assignOrdersToCart($user_id,$tax_amount,$currency,$coupon_id){
|
|||
//discount coupon
|
||||
if (!isset($coupon_id)) $coupon_id = "0";
|
||||
$fields['coupon_id'] = $coupon_id;
|
||||
$check_expired = $db->resultquery("SELECT id from OGP_DB_PREFIXbilling_coupons WHERE id = $fields[coupon_id] AND count > 0 AND expires >= NOW()");
|
||||
$check_expired = $db->resultquery("SELECT id from GSP_DB_PREFIXbilling_coupons WHERE id = $fields[coupon_id] AND count > 0 AND expires >= NOW()");
|
||||
if ($check_expired <= 0) $fields['coupon_id'] = 0;
|
||||
return $db->resultInsertId( 'billing_carts', $fields );
|
||||
}
|
||||
|
|
@ -101,7 +101,7 @@ function exec_ogp_module()
|
|||
$carts[0] = $_SESSION['CART'];
|
||||
}
|
||||
|
||||
$user_carts = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE user_id=".$db->realEscapeSingle($user_id) ." order by cart_id desc" );
|
||||
$user_carts = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_carts WHERE user_id=".$db->realEscapeSingle($user_id) ." order by cart_id desc" );
|
||||
|
||||
|
||||
if( $user_carts >=1 )
|
||||
|
|
@ -112,8 +112,8 @@ function exec_ogp_module()
|
|||
{
|
||||
$cart_id = $user_cart['cart_id'];
|
||||
|
||||
$carts[$cart_id] = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts AS cart JOIN
|
||||
OGP_DB_PREFIXbilling_orders AS orders
|
||||
$carts[$cart_id] = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_carts AS cart JOIN
|
||||
GSP_DB_PREFIXbilling_orders AS orders
|
||||
ON orders.cart_id=cart.cart_id
|
||||
WHERE orders.status IN (0, -1 , -2) AND (cart.cart_id=".$db->realEscapeSingle($cart_id). ") order by order_id asc");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ function exec_ogp_module()
|
|||
$id = $db->realEscapeSingle($_POST['id']);
|
||||
|
||||
//Create INSERT query
|
||||
$qry_change_url = "UPDATE OGP_DB_PREFIXbilling_coupons
|
||||
$qry_change_url = "UPDATE GSP_DB_PREFIXbilling_coupons
|
||||
SET code ='".$new_code."',
|
||||
name = '".$new_name."',
|
||||
discount ='".$new_discount."',
|
||||
|
|
@ -35,14 +35,14 @@ function exec_ogp_module()
|
|||
$expires = $_POST['expires'];
|
||||
|
||||
|
||||
$query = "INSERT INTO OGP_DB_PREFIXbilling_coupons(code, name, discount, count, expires) VALUES('".$code."', '".$name."', '".$discount."', '".$count."', '".$expires."')";
|
||||
$query = "INSERT INTO GSP_DB_PREFIXbilling_coupons(code, name, discount, count, expires) VALUES('".$code."', '".$name."', '".$discount."', '".$count."', '".$expires."')";
|
||||
$db->query($query);
|
||||
}
|
||||
|
||||
//Querying REMOVE coupon FROM DB
|
||||
if (isset($_POST['del_coupon']))
|
||||
{
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXbilling_coupons WHERE id=" . $db->realEscapeSingle($_POST['id']) );
|
||||
$db->query( "DELETE FROM GSP_DB_PREFIXbilling_coupons WHERE id=" . $db->realEscapeSingle($_POST['id']) );
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ function exec_ogp_module()
|
|||
</table>
|
||||
<br>
|
||||
<?php
|
||||
$result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_coupons");
|
||||
$result = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_coupons");
|
||||
if ($result > 0)
|
||||
{
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ function exec_ogp_module()
|
|||
$id = $db->realEscapeSingle($_POST['id']);
|
||||
|
||||
//Create INSERT query
|
||||
$qry_change_url = "UPDATE OGP_DB_PREFIXbilling_coupons
|
||||
$qry_change_url = "UPDATE GSP_DB_PREFIXbilling_coupons
|
||||
SET code ='".$new_code."',
|
||||
name = '".$new_name."',
|
||||
discount ='".$new_discount."',
|
||||
|
|
@ -35,14 +35,14 @@ function exec_ogp_module()
|
|||
$expires = $_POST['expires'];
|
||||
|
||||
|
||||
$query = "INSERT INTO OGP_DB_PREFIXbilling_coupons(code, name, discount, count, expires) VALUES('".$code."', '".$name."', '".$discount."', '".$count."', '".$expires."')";
|
||||
$query = "INSERT INTO GSP_DB_PREFIXbilling_coupons(code, name, discount, count, expires) VALUES('".$code."', '".$name."', '".$discount."', '".$count."', '".$expires."')";
|
||||
$db->query($query);
|
||||
}
|
||||
|
||||
//Querying REMOVE coupon FROM DB
|
||||
if (isset($_POST['del_coupon']))
|
||||
{
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXbilling_coupons WHERE id=" . $db->realEscapeSingle($_POST['id']) );
|
||||
$db->query( "DELETE FROM GSP_DB_PREFIXbilling_coupons WHERE id=" . $db->realEscapeSingle($_POST['id']) );
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ function exec_ogp_module()
|
|||
</table>
|
||||
<br>
|
||||
<?php
|
||||
$result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_coupons");
|
||||
$result = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_coupons");
|
||||
if ($result > 0)
|
||||
{
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@ function exec_ogp_module()
|
|||
if(isset($_GET['cart_id'])){
|
||||
$cart_id = $_GET['cart_id'];
|
||||
}
|
||||
$cart_paid = $db->resultQuery( "SELECT paid FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$cart_paid = $db->resultQuery( "SELECT paid FROM GSP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$isAdmin = $db->isAdmin( $_SESSION['user_id'] );
|
||||
if ( $isAdmin ){
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
$orders = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id) );
|
||||
} else {
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id)." AND user_id=".$db->realEscapeSingle($user_id) );
|
||||
$orders = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id)." AND user_id=".$db->realEscapeSingle($user_id) );
|
||||
}
|
||||
if( !empty($orders) and !empty($cart_paid) )
|
||||
{
|
||||
|
|
@ -35,7 +35,7 @@ function exec_ogp_module()
|
|||
$extended = $order['extended'] == "1" ? TRUE : FALSE;
|
||||
//Query service info
|
||||
$service = $db->resultQuery( "SELECT *
|
||||
FROM OGP_DB_PREFIXbilling_services
|
||||
FROM GSP_DB_PREFIXbilling_services
|
||||
WHERE service_id=".$db->realEscapeSingle($service_id) );
|
||||
|
||||
if( !empty( $service[0] ) )
|
||||
|
|
@ -131,7 +131,7 @@ function exec_ogp_module()
|
|||
|
||||
//Add IP:Port Pair to the Game Home
|
||||
//need to get the IP_ID for this remote server.
|
||||
$result = $db->resultQuery("SELECT ip_id FROM OGP_DB_PREFIXremote_server_ips WHERE remote_server_id=".$ip);
|
||||
$result = $db->resultQuery("SELECT ip_id FROM GSP_DB_PREFIXremote_server_ips WHERE remote_server_id=".$ip);
|
||||
foreach ($result as $rs)
|
||||
{
|
||||
$ip_id = $rs['ip_id'];
|
||||
|
|
@ -336,33 +336,33 @@ function exec_ogp_module()
|
|||
|
||||
}
|
||||
// set order status
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_orders
|
||||
$db->query("UPDATE GSP_DB_PREFIXbilling_orders
|
||||
SET status='" . $db->realEscapeSingle($status) . "'
|
||||
WHERE order_id=".$db->realEscapeSingle($order_id));
|
||||
|
||||
// set the order expiration
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_orders
|
||||
$db->query("UPDATE GSP_DB_PREFIXbilling_orders
|
||||
SET finish_date='" . $db->realEscapeSingle($finish_date) . "'
|
||||
WHERE order_id=".$db->realEscapeSingle($order_id));
|
||||
|
||||
// Save home id created by this order
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_orders
|
||||
$db->query("UPDATE GSP_DB_PREFIXbilling_orders
|
||||
SET home_id='" . $db->realEscapeSingle($home_id) . "' WHERE order_id=".$db->realEscapeSingle($order_id));
|
||||
|
||||
}
|
||||
|
||||
//Update Cart Payment Status as 3(paid and installed)
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
$db->query("UPDATE GSP_DB_PREFIXbilling_carts
|
||||
SET paid=3
|
||||
WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
|
||||
// Set payment/creation date
|
||||
$date = date('d M Y');
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
$db->query("UPDATE GSP_DB_PREFIXbilling_carts
|
||||
SET date='" . $db->realEscapeSingle($date) . "'
|
||||
WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
|
||||
$db->query( "UPDATE OGP_DB_PREFIXgame_mods SET max_players= ".$order['max_players']." WHERE home_id=".$db->realEscapeSingle($home_id));
|
||||
$db->query( "UPDATE GSP_DB_PREFIXgame_mods SET max_players= ".$order['max_players']." WHERE home_id=".$db->realEscapeSingle($home_id));
|
||||
|
||||
|
||||
//Refresh to Game Monitor.
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ if (strcmp ($res, "VERIFIED") == 0) {
|
|||
$receiver_email = $_POST['receiver_email'];
|
||||
$payer_email = $_POST['payer_email'];
|
||||
|
||||
$db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
$db->query("UPDATE GSP_DB_PREFIXbilling_carts
|
||||
SET paid=1
|
||||
WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
fwrite($fpx, "IPN Processed\n");
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ $module_menus = array(
|
|||
|
||||
$install_queries = array();
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."billing_services`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_services` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."billing_services`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."billing_services` (
|
||||
`service_id` int(11) NOT NULL auto_increment,
|
||||
`home_cfg_id` int(11) NOT NULL,
|
||||
`mod_cfg_id` int(11) NOT NULL,
|
||||
|
|
@ -57,8 +57,8 @@ $install_queries[0] = array(
|
|||
PRIMARY KEY (`service_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=UTF8;",
|
||||
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."billing_orders`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_orders` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."billing_orders`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."billing_orders` (
|
||||
`order_id` int(11) NOT NULL auto_increment,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`service_id` int(11) NOT NULL,
|
||||
|
|
@ -80,16 +80,16 @@ $install_queries[0] = array(
|
|||
);
|
||||
|
||||
$install_queries[1] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."billing_carts`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_carts` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."billing_carts`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."billing_carts` (
|
||||
`cart_id` int(11) NOT NULL auto_increment,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`paid` int(11) NULL,
|
||||
PRIMARY KEY (`cart_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=UTF8;",
|
||||
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."billing_orders`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_orders` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."billing_orders`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."billing_orders` (
|
||||
`order_id` int(11) NOT NULL auto_increment,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`service_id` int(11) NOT NULL,
|
||||
|
|
@ -110,25 +110,25 @@ $install_queries[1] = array(
|
|||
);
|
||||
|
||||
$install_queries[2] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` DROP `date`;",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` DROP `home_path`;",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` DROP `paid`;",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `home_id` varchar(255) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `status` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_carts` ADD `date` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_carts` ADD `tax_amount` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_carts` ADD `currency` varchar(3) NOT NULL DEFAULT '0';"
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` DROP `date`;",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` DROP `home_path`;",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` DROP `paid`;",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` ADD `home_id` varchar(255) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` ADD `status` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_carts` ADD `date` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_carts` ADD `tax_amount` varchar(16) NOT NULL DEFAULT '0';",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_carts` ADD `currency` varchar(3) NOT NULL DEFAULT '0';"
|
||||
);
|
||||
|
||||
$install_queries[3] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `finish_date` varchar(16) NOT NULL DEFAULT '0';"
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` ADD `finish_date` varchar(16) NOT NULL DEFAULT '0';"
|
||||
);
|
||||
|
||||
$install_queries[4] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `extended` tinyint(1) NOT NULL;",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_services` ADD `enabled` int(11) NOT NULL;"
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_carts` ADD `coupon_id` varchar(3) NOT NULL DEFAULT '0';"
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders` ADD `coupon_id` varchar(3) NOT NULL DEFAULT '0';"
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` ADD `extended` tinyint(1) NOT NULL;",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_services` ADD `enabled` int(11) NOT NULL;"
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_carts` ADD `coupon_id` varchar(3) NOT NULL DEFAULT '0';"
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."billing_orders` ADD `coupon_id` varchar(3) NOT NULL DEFAULT '0';"
|
||||
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@ function exec_ogp_module()
|
|||
|
||||
if(isset($_POST['remove']))
|
||||
{
|
||||
$query_delete_order = $db->query("DELETE FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($_POST['cart_id']));
|
||||
$query_delete_order = $db->query("DELETE FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($_POST['cart_id']));
|
||||
$query_delete_order = $db->query("DELETE FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($_POST['cart_id']));
|
||||
$query_delete_order = $db->query("DELETE FROM GSP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($_POST['cart_id']));
|
||||
}
|
||||
if(isset($_POST['paid']))
|
||||
{
|
||||
$query_set_as_paid = $db->query("UPDATE OGP_DB_PREFIXbilling_carts
|
||||
$query_set_as_paid = $db->query("UPDATE GSP_DB_PREFIXbilling_carts
|
||||
SET paid=1
|
||||
WHERE cart_id=".$db->realEscapeSingle($_POST['cart_id']));
|
||||
}
|
||||
|
|
@ -49,7 +49,7 @@ function exec_ogp_module()
|
|||
echo "<h1>Accounting</h1>";
|
||||
$servercount = 0;
|
||||
$income = 0;
|
||||
$paidOrders = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE status > 0");
|
||||
$paidOrders = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE status > 0");
|
||||
foreach($paidOrders as $inc)
|
||||
{
|
||||
$servercount = $servercount +1;
|
||||
|
|
@ -65,9 +65,9 @@ function exec_ogp_module()
|
|||
if($isAdmin or $status > "not_paid")
|
||||
{
|
||||
if ($isAdmin){
|
||||
$carts = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE paid =" . $db->realEscapeSingle($paid_value) ." order by cart_id DESC");
|
||||
$carts = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_carts WHERE paid =" . $db->realEscapeSingle($paid_value) ." order by cart_id DESC");
|
||||
}else{
|
||||
$carts = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE paid =" . $db->realEscapeSingle($paid_value) ." AND user_id = " . $user_id ." order by cart_id DESC");
|
||||
$carts = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_carts WHERE paid =" . $db->realEscapeSingle($paid_value) ." AND user_id = " . $user_id ." order by cart_id DESC");
|
||||
}
|
||||
if( $carts > 0 )
|
||||
{
|
||||
|
|
@ -103,7 +103,7 @@ function exec_ogp_module()
|
|||
}?>
|
||||
</tr>
|
||||
<?php
|
||||
$orders = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart['cart_id'])." order by order_id DESC" );
|
||||
$orders = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart['cart_id'])." order by order_id DESC" );
|
||||
$subtotal = 0;
|
||||
foreach($orders as $order)
|
||||
{
|
||||
|
|
@ -221,7 +221,7 @@ function exec_ogp_module()
|
|||
//obter as informações de cupom usadas neste pedido
|
||||
$coupon_savings = 0;
|
||||
if($cart['coupon_id']>0) {
|
||||
$result = $db->resultquery("SELECT * from OGP_DB_PREFIXbilling_coupons WHERE id = '". $cart['coupon_id'] . "'");
|
||||
$result = $db->resultquery("SELECT * from GSP_DB_PREFIXbilling_coupons WHERE id = '". $cart['coupon_id'] . "'");
|
||||
foreach($result as $coupon){
|
||||
$coupon_savings = $subtotal * ($coupon['discount']/ 100);
|
||||
echo "Sub-total c/discount <b>$" .number_format( ($subtotal - $coupon_savings) , 2 ).$cart['currency']."</b></br><td>";
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ global $db,$view,$settings;
|
|||
$loadpage = "?m=billing&p=paid";
|
||||
$count = $_POST['count'] + 1;
|
||||
|
||||
$result = $db->resultquery("SELECT * from OGP_DB_PREFIXbilling_carts WHERE cart_id= '". $_POST['cart_id'] . "'");
|
||||
$result = $db->resultquery("SELECT * from GSP_DB_PREFIXbilling_carts WHERE cart_id= '". $_POST['cart_id'] . "'");
|
||||
foreach($result as $cartID){
|
||||
$paid = $cartID['paid'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ $debug = $settings['debug'];
|
|||
|
||||
if(!empty($cart_id))
|
||||
{
|
||||
$orders = $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
$orders = $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
//get couponID then discount for this cart
|
||||
$result= $db->resultQuery( "SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
$result= $db->resultQuery( "SELECT * FROM GSP_DB_PREFIXbilling_carts WHERE cart_id=".$db->realEscapeSingle($cart_id));
|
||||
foreach ($result as $cartDB){
|
||||
$coupon_id = $cartDB['id'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ function exec_ogp_module()
|
|||
$service = $db->realEscapeSingle($_POST['service']);
|
||||
|
||||
//Create UPDATE query
|
||||
$qry_change_url = "UPDATE OGP_DB_PREFIXbilling_services
|
||||
$qry_change_url = "UPDATE GSP_DB_PREFIXbilling_services
|
||||
SET remote_server_id = '".$new_remote_server_id."',
|
||||
price_monthly ='".$new_price_monthly."',
|
||||
remote_server_id = '".$new_remote_server_id."',
|
||||
|
|
@ -28,7 +28,7 @@ function exec_ogp_module()
|
|||
//Querying UPDATE enabled/disabled remote servers DB
|
||||
if (isset($_POST['update_remote_servers']))
|
||||
{
|
||||
$result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXremote_servers");
|
||||
$result = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXremote_servers");
|
||||
foreach($result as $rs)
|
||||
{
|
||||
$server_enabled = 0;
|
||||
|
|
@ -40,7 +40,7 @@ function exec_ogp_module()
|
|||
}
|
||||
|
||||
//update the table with current value
|
||||
$query = "UPDATE OGP_DB_PREFIXremote_servers SET enabled = '".$server_enabled."' WHERE remote_server_id=".$rs['remote_server_id'];
|
||||
$query = "UPDATE GSP_DB_PREFIXremote_servers SET enabled = '".$server_enabled."' WHERE remote_server_id=".$rs['remote_server_id'];
|
||||
$db->query($query);
|
||||
|
||||
}
|
||||
|
|
@ -83,14 +83,14 @@ function exec_ogp_module()
|
|||
if(isset($_POST['allow_ftp_usage']))$access_rights .= $db->realEscapeSingle($_POST['allow_ftp_usage']);
|
||||
if(isset($_POST['allow_custom_fields']))$access_rights .= $db->realEscapeSingle($_POST['allow_custom_fields']);
|
||||
|
||||
$qry_add_service = "INSERT INTO OGP_DB_PREFIXbilling_services(service_id, home_cfg_id, mod_cfg_id, service_name, remote_server_id, out_of_stock, slot_max_qty , slot_min_qty, price_daily, price_monthly, price_year, description, img_url, ftp, install_method, manual_url, access_rights,enabled) VALUES(NULL, '".$home_cfg_id."', '".$mod_cfg_id."', '".$service_name."', '".$remote_server_id."', 0,'".$slot_max_qty."', '".$slot_min_qty."', '".$price_daily."', '".$price_monthly."', '".$price_year."', '".$description."', '".$img_url."', '".$ftp."', '".$install_method."', '".$manual_url."', '".$access_rights."', '" . $enabled . "')";
|
||||
$qry_add_service = "INSERT INTO GSP_DB_PREFIXbilling_services(service_id, home_cfg_id, mod_cfg_id, service_name, remote_server_id, out_of_stock, slot_max_qty , slot_min_qty, price_daily, price_monthly, price_year, description, img_url, ftp, install_method, manual_url, access_rights,enabled) VALUES(NULL, '".$home_cfg_id."', '".$mod_cfg_id."', '".$service_name."', '".$remote_server_id."', 0,'".$slot_max_qty."', '".$slot_min_qty."', '".$price_daily."', '".$price_monthly."', '".$price_year."', '".$description."', '".$img_url."', '".$ftp."', '".$install_method."', '".$manual_url."', '".$access_rights."', '" . $enabled . "')";
|
||||
$db->query($qry_add_service);
|
||||
}
|
||||
|
||||
//Querying REMOVE service FROM DB
|
||||
if (isset($_POST['service_id']))
|
||||
{
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXbilling_services WHERE service_id=" . $db->realEscapeSingle($_POST['service_id']) );
|
||||
$db->query( "DELETE FROM GSP_DB_PREFIXbilling_services WHERE service_id=" . $db->realEscapeSingle($_POST['service_id']) );
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -106,7 +106,7 @@ function exec_ogp_module()
|
|||
<td>
|
||||
<select name="modcfgid">
|
||||
<?php
|
||||
$mod_qry = $db->resultQuery("SELECT DISTINCT mod_cfg_id, mod_name, game_name FROM OGP_DB_PREFIXconfig_mods NATURAL JOIN OGP_DB_PREFIXconfig_homes WHERE home_cfg_id=" . $db->realEscapeSingle($_POST['home_cfg_id']));
|
||||
$mod_qry = $db->resultQuery("SELECT DISTINCT mod_cfg_id, mod_name, game_name FROM GSP_DB_PREFIXconfig_mods NATURAL JOIN GSP_DB_PREFIXconfig_homes WHERE home_cfg_id=" . $db->realEscapeSingle($_POST['home_cfg_id']));
|
||||
foreach($mod_qry as $array_mods)
|
||||
{
|
||||
if($array_mods['mod_name'] == "none")$array_mods['mod_name']=$array_mods['game_name'];
|
||||
|
|
@ -128,7 +128,7 @@ function exec_ogp_module()
|
|||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$result3 = $db->resultQuery("SELECT DISTINCT remote_server_id, remote_server_name, agent_ip, ogp_user FROM OGP_DB_PREFIXremote_servers");
|
||||
$result3 = $db->resultQuery("SELECT DISTINCT remote_server_id, remote_server_name, agent_ip, ogp_user FROM GSP_DB_PREFIXremote_servers");
|
||||
?>
|
||||
<td><?php print_lang('remote_server');?></td>
|
||||
<td>
|
||||
|
|
@ -146,7 +146,7 @@ function exec_ogp_module()
|
|||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$mods = $db->resultQuery("SELECT DISTINCT mod_cfg_id, mod_name, game_name FROM OGP_DB_PREFIXconfig_mods NATURAL JOIN OGP_DB_PREFIXconfig_homes WHERE mod_cfg_id=" . $db->realEscapeSingle($_POST['modcfgid']));
|
||||
$mods = $db->resultQuery("SELECT DISTINCT mod_cfg_id, mod_name, game_name FROM GSP_DB_PREFIXconfig_mods NATURAL JOIN GSP_DB_PREFIXconfig_homes WHERE mod_cfg_id=" . $db->realEscapeSingle($_POST['modcfgid']));
|
||||
foreach($mods as $mod)
|
||||
{
|
||||
?>
|
||||
|
|
@ -257,7 +257,7 @@ function exec_ogp_module()
|
|||
<h2>Enable/Disable Server Locations</h2>
|
||||
<?php
|
||||
//ENABLE OR DISABLE REMOTE SERVERS FOR GAMES
|
||||
$result = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXremote_servers");
|
||||
$result = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXremote_servers");
|
||||
echo "<form method='post' action=''>";
|
||||
echo "<input type='hidden' name='update_remote_servers' value='update' />";
|
||||
foreach($result as $rs)
|
||||
|
|
@ -278,7 +278,7 @@ function exec_ogp_module()
|
|||
<br><br>";
|
||||
//end ENABLE REMOTE SERVERS
|
||||
|
||||
$services = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_services ORDER BY service_name");
|
||||
$services = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_services ORDER BY service_name");
|
||||
if ($services > 0)
|
||||
{
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ function exec_ogp_module()
|
|||
$new_description = str_replace("\\r\\n", "<br>", $_POST['description']);
|
||||
$service = $_POST['service_id'];
|
||||
|
||||
$change_description = "UPDATE OGP_DB_PREFIXbilling_services
|
||||
$change_description = "UPDATE GSP_DB_PREFIXbilling_services
|
||||
SET description ='".$db->realEscapeSingle($new_description)."'
|
||||
WHERE service_id=".$db->realEscapeSingle($service);
|
||||
$save = $db->query($change_description);
|
||||
|
|
@ -63,7 +63,7 @@ THIS IS WHAT WE DISPLAY ON THE SHOP PAGE AT THE TOP
|
|||
|
||||
// Shop Form
|
||||
if(intval($_REQUEST['service_id']) !==0) $where_service_id = " WHERE enabled = 1 and service_id=".intval($_REQUEST['service_id']); else $where_service_id = " where enabled = 1";
|
||||
$qry_services = "SELECT * FROM OGP_DB_PREFIXbilling_services".$where_service_id;
|
||||
$qry_services = "SELECT * FROM GSP_DB_PREFIXbilling_services".$where_service_id;
|
||||
$services = $db->resultQuery($qry_services);
|
||||
|
||||
if (isset($_REQUEST['service_id']) && $services === false) {
|
||||
|
|
@ -208,7 +208,7 @@ if ($row['price_monthly'] == 0.0) {
|
|||
//loop through each of the assigned servers and see if its disabled
|
||||
foreach($rsiArray as $rsi)
|
||||
{
|
||||
$query = "SELECT * FROM OGP_DB_PREFIXremote_servers WHERE remote_server_id = ".$rsi;
|
||||
$query = "SELECT * FROM GSP_DB_PREFIXremote_servers WHERE remote_server_id = ".$rsi;
|
||||
$result = $db->resultQuery($query);
|
||||
foreach($result as $rs)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ function get_usernames_not_read_circular($circular_id)
|
|||
global $db;
|
||||
$circular_id = $db->real_escape_string($circular_id);
|
||||
$query = "SELECT user_id ".
|
||||
"FROM `OGP_DB_PREFIXcircular_recipients` ".
|
||||
"FROM `GSP_DB_PREFIXcircular_recipients` ".
|
||||
"WHERE `circular_id` = '$circular_id' ".
|
||||
"AND `status` = '0'";
|
||||
$users = $db->resultQuery($query);
|
||||
|
|
@ -31,14 +31,14 @@ function remove_circular($circular_id, $admin = false)
|
|||
|
||||
if($admin)
|
||||
{
|
||||
$db->query("DELETE FROM `OGP_DB_PREFIXcircular_recipients` ".
|
||||
$db->query("DELETE FROM `GSP_DB_PREFIXcircular_recipients` ".
|
||||
"WHERE `circular_id` = '$circular_id'");
|
||||
$db->query("DELETE FROM `OGP_DB_PREFIXcircular` ".
|
||||
$db->query("DELETE FROM `GSP_DB_PREFIXcircular` ".
|
||||
"WHERE `circular_id` = '$circular_id'");
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->query("DELETE FROM `OGP_DB_PREFIXcircular_recipients` ".
|
||||
$db->query("DELETE FROM `GSP_DB_PREFIXcircular_recipients` ".
|
||||
"WHERE `circular_id` = '$circular_id' ".
|
||||
"AND `user_id` = '$_SESSION[user_id]'");
|
||||
}
|
||||
|
|
@ -48,7 +48,7 @@ function set_circular_readed($circular_id)
|
|||
{
|
||||
global $db;
|
||||
$circular_id = $db->real_escape_string($circular_id);
|
||||
$db->query("UPDATE `OGP_DB_PREFIXcircular_recipients` ".
|
||||
$db->query("UPDATE `GSP_DB_PREFIXcircular_recipients` ".
|
||||
"SET `status` = '1' ".
|
||||
"WHERE `circular_id` = '$circular_id' ".
|
||||
"AND `user_id` = '$_SESSION[user_id]'");
|
||||
|
|
@ -58,11 +58,11 @@ function get_circulars($all = false)
|
|||
{
|
||||
global $db;
|
||||
if($all)
|
||||
$query = "SELECT * FROM `OGP_DB_PREFIXcircular`";
|
||||
$query = "SELECT * FROM `GSP_DB_PREFIXcircular`";
|
||||
else
|
||||
$query = "SELECT * ".
|
||||
"FROM `OGP_DB_PREFIXcircular_recipients` ".
|
||||
"NATURAL JOIN `OGP_DB_PREFIXcircular` ".
|
||||
"FROM `GSP_DB_PREFIXcircular_recipients` ".
|
||||
"NATURAL JOIN `GSP_DB_PREFIXcircular` ".
|
||||
"WHERE user_id = $_SESSION[user_id]";
|
||||
|
||||
return $db->resultQuery($query);
|
||||
|
|
@ -73,7 +73,7 @@ function send_to_user($user_id, $circular_id)
|
|||
global $db;
|
||||
$user_id = $db->real_escape_string($user_id);
|
||||
$circular_id = $db->real_escape_string($circular_id);
|
||||
return $db->query("INSERT INTO `OGP_DB_PREFIXcircular_recipients` VALUES('$user_id','$circular_id','0');");
|
||||
return $db->query("INSERT INTO `GSP_DB_PREFIXcircular_recipients` VALUES('$user_id','$circular_id','0');");
|
||||
}
|
||||
|
||||
function get_user_ids($type, $ids, &$user_ids)
|
||||
|
|
|
|||
|
|
@ -35,16 +35,16 @@ $module_menus = array(
|
|||
);
|
||||
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."circular`",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."circular` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."circular`",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."circular` (
|
||||
`circular_id` int NOT NULL AUTO_INCREMENT,
|
||||
`subject` TEXT NOT NULL,
|
||||
`message` TEXT NOT NULL,
|
||||
`timestamp` TIMESTAMP,
|
||||
PRIMARY KEY (`circular_id`)
|
||||
);",
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."circular_recipients`",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."circular_recipients` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."circular_recipients`",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."circular_recipients` (
|
||||
`user_id` int NOT NULL,
|
||||
`circular_id` int NOT NULL,
|
||||
`status` tinyint NOT NULL,
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ $module_menus = array(
|
|||
$install_queries = array();
|
||||
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."config_homes;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."config_homes` (
|
||||
"DROP TABLE IF EXISTS ".GSP_DB_PREFIX."config_homes;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."config_homes` (
|
||||
`home_cfg_id` int(20) NOT NULL auto_increment,
|
||||
`game_key` varchar(64) NOT NULL,
|
||||
`game_name` varchar(255) NOT NULL,
|
||||
|
|
@ -28,8 +28,8 @@ $install_queries[0] = array(
|
|||
UNIQUE KEY `game_key` (`game_key`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||
|
||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."config_mods;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."config_mods` (
|
||||
"DROP TABLE IF EXISTS ".GSP_DB_PREFIX."config_mods;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."config_mods` (
|
||||
`mod_cfg_id` int(50) NOT NULL auto_increment,
|
||||
`home_cfg_id` varchar(50) NOT NULL,
|
||||
`mod_key` varchar(100) NOT NULL COMMENT 'mod short name - used by the game server for startup commands - ex cstrike',
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ function exec_ogp_module()
|
|||
|
||||
|
||||
//show if new server created
|
||||
$cartresult = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_carts WHERE user_id='".$_SESSION['user_id']."' AND paid='1' ");
|
||||
$cartresult = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_carts WHERE user_id='".$_SESSION['user_id']."' AND paid='1' ");
|
||||
$newServices=0;
|
||||
foreach($cartresult as $res){
|
||||
$newServices=$newServices + 1;
|
||||
|
|
@ -50,7 +50,7 @@ function exec_ogp_module()
|
|||
</div>';
|
||||
}
|
||||
//Invoice is due.
|
||||
$orderresult = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE user_id='".$_SESSION['user_id']."' AND status = -1");
|
||||
$orderresult = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE user_id='".$_SESSION['user_id']."' AND status = -1");
|
||||
$invoicesDue=0;
|
||||
foreach($orderresult as $res){
|
||||
$invoicesDue=$invoicesDue + 1;
|
||||
|
|
@ -69,7 +69,7 @@ function exec_ogp_module()
|
|||
</div>';
|
||||
}
|
||||
//Server is suspended DANGER
|
||||
$orderresult = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXbilling_orders WHERE user_id='".$_SESSION['user_id']."' AND status = -2");
|
||||
$orderresult = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXbilling_orders WHERE user_id='".$_SESSION['user_id']."' AND status = -2");
|
||||
$invoicesDue=0;
|
||||
foreach($orderresult as $res){
|
||||
$invoicesDue=$invoicesDue + 1;
|
||||
|
|
@ -138,12 +138,12 @@ function exec_ogp_module()
|
|||
|
||||
|
||||
|
||||
$widgets = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXwidgets_users WHERE user_id='".$_SESSION['user_id']."' ORDER BY sort_no");
|
||||
$widgets = $db->resultQuery("SELECT * FROM GSP_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");
|
||||
$widgets = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXwidgets_users WHERE user_id='".$_SESSION['user_id']."' ORDER BY sort_no");
|
||||
}
|
||||
|
||||
if($widgets)
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ $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` (
|
||||
"DROP TABLE IF EXISTS ".GSP_DB_PREFIX."widgets;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."widgets` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`column_id` int(11) NOT NULL,
|
||||
`sort_no` int(11) NOT NULL,
|
||||
|
|
@ -21,8 +21,8 @@ $install_queries[0] = array(
|
|||
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` (
|
||||
"DROP TABLE IF EXISTS ".GSP_DB_PREFIX."widgets_users",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."widgets_users` (
|
||||
`user_id` int(11) NOT NULL,
|
||||
`widget_id` int(11) NOT NULL,
|
||||
`column_id` int(11) NOT NULL,
|
||||
|
|
@ -31,7 +31,7 @@ $install_queries[0] = array(
|
|||
`title` varchar(100) NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||
|
||||
"INSERT INTO `".OGP_DB_PREFIX."widgets` (`id`, `column_id`, `sort_no`, `collapsed`, `title`) VALUES
|
||||
"INSERT INTO `".GSP_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'),
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ function exec_ogp_module()
|
|||
$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']."'");
|
||||
$db->query("UPDATE ".GSP_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']."'");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ function exec_ogp_module()
|
|||
|
||||
// Get blacklisted files
|
||||
$current_blacklist = array();
|
||||
$blacklisted_files = $db->resultQuery('SELECT file_path FROM `OGP_DB_PREFIXupdate_blacklist`;');
|
||||
$blacklisted_files = $db->resultQuery('SELECT file_path FROM `GSP_DB_PREFIXupdate_blacklist`;');
|
||||
if($blacklisted_files !== FALSE)
|
||||
{
|
||||
$current_blacklist = array();
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ function exec_ogp_module()
|
|||
// Check if user is admin
|
||||
global $db;
|
||||
$isAdmin = false;
|
||||
if(isset($_SESSION['user_id']) && $db && $db instanceof OGPDatabase) {
|
||||
if(isset($_SESSION['user_id']) && $db && $db instanceof GSPDatabase) {
|
||||
$isAdmin = $db->isAdmin($_SESSION['user_id']);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,15 +52,15 @@ function get_access_rules($home_cfg_id = "")
|
|||
global $db;
|
||||
if($home_cfg_id == "")
|
||||
{
|
||||
return $db->resultQuery("SELECT * FROM `".OGP_DB_PREFIX."fastdl_access_rules`;");
|
||||
return $db->resultQuery("SELECT * FROM `".GSP_DB_PREFIX."fastdl_access_rules`;");
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $db->resultQuery("SELECT * FROM `".OGP_DB_PREFIX."fastdl_access_rules`
|
||||
$result = $db->resultQuery("SELECT * FROM `".GSP_DB_PREFIX."fastdl_access_rules`
|
||||
WHERE `home_cfg_id`='".$db->realEscapeSingle($home_cfg_id)."'");
|
||||
if($result === FALSE)
|
||||
{
|
||||
$result = $db->resultQuery("SELECT * FROM `".OGP_DB_PREFIX."fastdl_access_rules`
|
||||
$result = $db->resultQuery("SELECT * FROM `".GSP_DB_PREFIX."fastdl_access_rules`
|
||||
WHERE `home_cfg_id`='0'");
|
||||
if($result === FALSE)
|
||||
return array('match_file_extension' => NULL,'match_client_ip', NULL);
|
||||
|
|
@ -72,12 +72,12 @@ function get_access_rules($home_cfg_id = "")
|
|||
function set_access_rule($home_cfg_id, $match_file_extension, $match_client_ip)
|
||||
{
|
||||
global $db;
|
||||
if (!$db->resultQuery("SELECT * FROM `".OGP_DB_PREFIX."fastdl_access_rules`
|
||||
if (!$db->resultQuery("SELECT * FROM `".GSP_DB_PREFIX."fastdl_access_rules`
|
||||
WHERE `home_cfg_id`='".$db->realEscapeSingle($home_cfg_id)."'"))
|
||||
{
|
||||
if($match_file_extension == "" and $match_client_ip == "")
|
||||
return TRUE;
|
||||
return $db->query("INSERT INTO `".OGP_DB_PREFIX."fastdl_access_rules`
|
||||
return $db->query("INSERT INTO `".GSP_DB_PREFIX."fastdl_access_rules`
|
||||
(`home_cfg_id`,`match_file_extension`,`match_client_ip`)
|
||||
VALUES('" . $db->realEscapeSingle($home_cfg_id) . "','" . $db->realEscapeSingle($match_file_extension) . "','" . $db->realEscapeSingle($match_client_ip) . "');");
|
||||
}
|
||||
|
|
@ -85,11 +85,11 @@ function set_access_rule($home_cfg_id, $match_file_extension, $match_client_ip)
|
|||
{
|
||||
if($match_file_extension == "" and $match_client_ip == "")
|
||||
{
|
||||
return $db->query("DELETE FROM `".OGP_DB_PREFIX."fastdl_access_rules` WHERE `home_cfg_id`='" . $db->realEscapeSingle($home_cfg_id) . "';");
|
||||
return $db->query("DELETE FROM `".GSP_DB_PREFIX."fastdl_access_rules` WHERE `home_cfg_id`='" . $db->realEscapeSingle($home_cfg_id) . "';");
|
||||
}
|
||||
else
|
||||
{
|
||||
return $db->query("UPDATE `".OGP_DB_PREFIX."fastdl_access_rules`
|
||||
return $db->query("UPDATE `".GSP_DB_PREFIX."fastdl_access_rules`
|
||||
SET `match_file_extension`='" . $db->realEscapeSingle($match_file_extension) . "',
|
||||
`match_client_ip`='" . $db->realEscapeSingle($match_client_ip) . "'
|
||||
WHERE `home_cfg_id`='" . $db->realEscapeSingle($home_cfg_id) . "';");
|
||||
|
|
@ -100,7 +100,7 @@ function set_access_rule($home_cfg_id, $match_file_extension, $match_client_ip)
|
|||
function del_access_rule($home_cfg_id)
|
||||
{
|
||||
global $db;
|
||||
return $db->query("DELETE FROM `".OGP_DB_PREFIX."fastdl_access_rules` WHERE `home_cfg_id`='" . $db->realEscapeSingle($home_cfg_id) . "';");
|
||||
return $db->query("DELETE FROM `".GSP_DB_PREFIX."fastdl_access_rules` WHERE `home_cfg_id`='" . $db->realEscapeSingle($home_cfg_id) . "';");
|
||||
}
|
||||
|
||||
function check_access_rules_entries()
|
||||
|
|
@ -165,7 +165,7 @@ function get_fastdl_settings($remote_server_id)
|
|||
{
|
||||
global $db;
|
||||
if( !is_numeric($remote_server_id) ) return FALSE;
|
||||
$result = $db->resultQuery("SELECT `setting`,`value` FROM `".OGP_DB_PREFIX."fastdl_settings`
|
||||
$result = $db->resultQuery("SELECT `setting`,`value` FROM `".GSP_DB_PREFIX."fastdl_settings`
|
||||
WHERE `remote_server_id`='".$db->realEscapeSingle($remote_server_id)."'");
|
||||
if(!$result) return FALSE;
|
||||
$results = array();
|
||||
|
|
@ -184,7 +184,7 @@ function set_fastdl_settings($remote_server_id, $settings)
|
|||
if( !is_array($settings) ) return FALSE;
|
||||
foreach ( $settings as $s_key => $s_value )
|
||||
{
|
||||
$query = 'INSERT INTO `'.OGP_DB_PREFIX.'fastdl_settings` (`remote_server_id`,`setting`,`value`)
|
||||
$query = 'INSERT INTO `'.GSP_DB_PREFIX.'fastdl_settings` (`remote_server_id`,`setting`,`value`)
|
||||
VALUES(\''.$db->realEscapeSingle($remote_server_id).'\', \''.$db->realEscapeSingle($s_key).'\', \''.$db->realEscapeSingle($s_value).'\') ON DUPLICATE KEY
|
||||
UPDATE value=\''.$db->realEscapeSingle($s_value).'\'';
|
||||
$db->query($query);
|
||||
|
|
|
|||
|
|
@ -12,22 +12,22 @@ $module_menus = array( array( 'subpage' => '', 'name'=>'Fast Download', 'group'=
|
|||
$module_access_rights = array('d' => 'allow_fast_download');
|
||||
|
||||
$install_queries[0] = array("SELECT NOW();");
|
||||
$install_queries[1] = array("DROP TABLE IF EXISTS `".OGP_DB_PREFIX."fastdl`;");
|
||||
$install_queries[1] = array("DROP TABLE IF EXISTS `".GSP_DB_PREFIX."fastdl`;");
|
||||
$install_queries[2] = array("SELECT NOW();");
|
||||
$install_queries[3] = array(
|
||||
"CREATE TABLE ".OGP_DB_PREFIX."fastdl_access_rules (
|
||||
"CREATE TABLE ".GSP_DB_PREFIX."fastdl_access_rules (
|
||||
`home_cfg_id` varchar(32) NOT NULL,
|
||||
`match_file_extension` TEXT,
|
||||
`match_client_ip` TEXT,
|
||||
UNIQUE KEY (`home_cfg_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
||||
$install_queries[4] = array(
|
||||
"CREATE TABLE ".OGP_DB_PREFIX."fastdl_settings (
|
||||
"CREATE TABLE ".GSP_DB_PREFIX."fastdl_settings (
|
||||
`remote_server_id` int(11) NOT NULL,
|
||||
`setting` varchar(63) NOT NULL,
|
||||
`value` varchar(255) NOT NULL,
|
||||
UNIQUE KEY remote_server_id (remote_server_id,setting)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
||||
$uninstall_queries = array("DROP TABLE IF EXISTS `".OGP_DB_PREFIX."fastdl_access_rules`;",
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."fastdl_settings`;");
|
||||
$uninstall_queries = array("DROP TABLE IF EXISTS `".GSP_DB_PREFIX."fastdl_access_rules`;",
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."fastdl_settings`;");
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -12,16 +12,16 @@ $module_menus = array( array( 'subpage' => 'game_monitor', 'name'=>'Game Monitor
|
|||
$module_access_rights = array('u' => 'allow_updates', 'p' => 'allow_parameter_usage', 'e' => 'allow_extra_params', 'c' => 'allow_custom_fields');
|
||||
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."home_ip_ports`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."home_ip_ports` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."home_ip_ports`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."home_ip_ports` (
|
||||
`ip_id` int(11) NOT NULL,
|
||||
`port` int(11) NOT NULL,
|
||||
`home_id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`ip_id`,`port`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||
|
||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."server_homes",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."server_homes` (
|
||||
"DROP TABLE IF EXISTS ".GSP_DB_PREFIX."server_homes",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."server_homes` (
|
||||
`home_id` int(50) NOT NULL auto_increment,
|
||||
`remote_server_id` int(11) NOT NULL,
|
||||
`user_id_main` int(11) NOT NULL,
|
||||
|
|
@ -35,8 +35,8 @@ $install_queries[0] = array(
|
|||
UNIQUE KEY remote_server_id (remote_server_id,home_path)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||
|
||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."rcon_presets;",
|
||||
"CREATE TABLE ".OGP_DB_PREFIX."rcon_presets (
|
||||
"DROP TABLE IF EXISTS ".GSP_DB_PREFIX."rcon_presets;",
|
||||
"CREATE TABLE ".GSP_DB_PREFIX."rcon_presets (
|
||||
`preset_id` int(50) NOT NULL auto_increment,
|
||||
`name` varchar(20) NOT NULL,
|
||||
`command` varchar(100) NOT NULL,
|
||||
|
|
@ -45,8 +45,8 @@ UNIQUE KEY remote_server_id (remote_server_id,home_path)
|
|||
PRIMARY KEY (`preset_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||
|
||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."game_mods",
|
||||
"CREATE TABLE IF NOT EXISTS ".OGP_DB_PREFIX."game_mods (
|
||||
"DROP TABLE IF EXISTS ".GSP_DB_PREFIX."game_mods",
|
||||
"CREATE TABLE IF NOT EXISTS ".GSP_DB_PREFIX."game_mods (
|
||||
`mod_id` int(50) NOT NULL auto_increment,
|
||||
`home_id` int(255) NOT NULL,
|
||||
`mod_cfg_id` int(11) NOT NULL,
|
||||
|
|
@ -61,12 +61,12 @@ UNIQUE KEY home_id (home_id,mod_cfg_id)
|
|||
) ENGINE=MyISAM;");
|
||||
|
||||
$install_queries[1] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."server_homes` ADD `ftp_login` varchar(32) NULL;",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."server_homes` ADD `ftp_status` int(11) NOT NULL DEFAULT '0';");
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."server_homes` ADD `ftp_login` varchar(32) NULL;",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."server_homes` ADD `ftp_status` int(11) NOT NULL DEFAULT '0';");
|
||||
|
||||
$install_queries[2] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."status_cache`",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."status_cache` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."status_cache`",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."status_cache` (
|
||||
`date_timestamp` char(16) NOT NULL,
|
||||
`ip_id` char(3) NOT NULL,
|
||||
`port` char(6) NOT NULL,
|
||||
|
|
@ -74,28 +74,28 @@ $install_queries[2] = array(
|
|||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
||||
|
||||
$install_queries[3] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."server_homes` ADD `custom_fields` LONGTEXT NULL;");
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."server_homes` ADD `custom_fields` LONGTEXT NULL;");
|
||||
|
||||
$install_queries[4] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."home_ip_ports` ADD `force_mod_id` int(11) NOT NULL DEFAULT '0';");
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."home_ip_ports` ADD `force_mod_id` int(11) NOT NULL DEFAULT '0';");
|
||||
|
||||
$install_queries[5] = array(
|
||||
"TRUNCATE `".OGP_DB_PREFIX."status_cache`;");
|
||||
"TRUNCATE `".GSP_DB_PREFIX."status_cache`;");
|
||||
|
||||
$install_queries[6] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."server_homes` ADD `server_expiration_date` VARCHAR(21) NOT NULL default 'X';");
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."server_homes` ADD `server_expiration_date` VARCHAR(21) NOT NULL default 'X';");
|
||||
|
||||
$install_queries[7] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."server_homes` drop index `remote_server_id`;"
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."server_homes` drop index `remote_server_id`;"
|
||||
);
|
||||
|
||||
$install_queries[8] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."server_homes` ADD `home_user_order` INT NOT NULL default 99999;");
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."server_homes` ADD `home_user_order` INT NOT NULL default 99999;");
|
||||
|
||||
// Increase default column sizes
|
||||
$install_queries[9] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."server_homes` MODIFY COLUMN `home_path` VARCHAR(500);",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."server_homes` MODIFY COLUMN `home_name` VARCHAR(500);",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."server_homes` MODIFY COLUMN `control_password` VARCHAR(128);",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."server_homes` MODIFY COLUMN `ftp_password` VARCHAR(128);");
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."server_homes` MODIFY COLUMN `home_path` VARCHAR(500);",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."server_homes` MODIFY COLUMN `home_name` VARCHAR(500);",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."server_homes` MODIFY COLUMN `control_password` VARCHAR(128);",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."server_homes` MODIFY COLUMN `ftp_password` VARCHAR(128);");
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ function lgsl_lookup_ip($ip, $port)
|
|||
$ip = $db->realEscapeSingle($ip);
|
||||
$port = $db->realEscapeSingle($port);
|
||||
|
||||
$result = $db->resultQuery("SELECT `id` FROM `OGP_DB_PREFIXlgsl` WHERE `ip`='{$ip}' AND c_port='{$port}' LIMIT 1");
|
||||
$result = $db->resultQuery("SELECT `id` FROM `GSP_DB_PREFIXlgsl` WHERE `ip`='{$ip}' AND c_port='{$port}' LIMIT 1");
|
||||
return $result[0];
|
||||
}
|
||||
|
||||
|
|
@ -149,7 +149,7 @@ function lgsl_cache_info($id)
|
|||
{
|
||||
global $db;
|
||||
$id = $db->realEscapeSingle($id);
|
||||
$result = $db->resultQuery("SELECT `cache_time` FROM `OGP_DB_PREFIXlgsl` WHERE `id`='{$id}' LIMIT 1");
|
||||
$result = $db->resultQuery("SELECT `cache_time` FROM `GSP_DB_PREFIXlgsl` WHERE `id`='{$id}' LIMIT 1");
|
||||
return empty($result[0]['cache_time']) ? array(0,0,0) : explode("_", $result[0]['cache_time']);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@
|
|||
if (!empty($_POST['lgsl_save_1']))
|
||||
{
|
||||
// LOAD SERVER CACHE INTO MEMORY
|
||||
$results = $db->resultQuery("SELECT * FROM `OGP_DB_PREFIXlgsl`");
|
||||
$results = $db->resultQuery("SELECT * FROM `GSP_DB_PREFIXlgsl`");
|
||||
foreach($results as $row)
|
||||
{
|
||||
$servers["{$row['type']}:{$row['ip']}:{$row['q_port']}"] = array($row['status'], $row['cache'], $row['cache_time']);
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
}
|
||||
|
||||
// EMPTY SQL TABLE
|
||||
$db->query("TRUNCATE `OGP_DB_PREFIXlgsl`");
|
||||
$db->query("TRUNCATE `GSP_DB_PREFIXlgsl`");
|
||||
|
||||
// CONVERT ADVANCED TO NORMAL DATA FORMAT
|
||||
if (!empty($_POST['lgsl_management']))
|
||||
|
|
@ -109,7 +109,7 @@
|
|||
elseif ($q_port < 1 || $q_port > 99999) { $disabled = 1; $q_port = 0; }
|
||||
elseif (!isset($lgsl_protocol_list[$type])) { $disabled = 1; }
|
||||
|
||||
$db->query("INSERT INTO `OGP_DB_PREFIXlgsl` (`type`,`ip`,`c_port`,`q_port`,`s_port`,`zone`,`disabled`,`comment`,`status`,`cache`,`cache_time`) VALUES ('{$type}','{$ip}','{$c_port}','{$q_port}','{$s_port}','{$zone}','{$disabled}','{$comment}','{$status}','{$cache}','{$cache_time}')");
|
||||
$db->query("INSERT INTO `GSP_DB_PREFIXlgsl` (`type`,`ip`,`c_port`,`q_port`,`s_port`,`zone`,`disabled`,`comment`,`status`,`cache`,`cache_time`) VALUES ('{$type}','{$ip}','{$c_port}','{$q_port}','{$s_port}','{$zone}','{$disabled}','{$comment}','{$status}','{$cache}','{$cache_time}')");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -161,7 +161,7 @@
|
|||
<textarea name='form_list' cols='90' rows='30' wrap='off' spellcheck='false' style='width:95%; height:500px; font-size:1.2em; font-family:courier new, monospace'>\r\n";
|
||||
|
||||
//---------------------------------------------------------+
|
||||
$result = $db->resultQuery("SELECT * FROM `OGP_DB_PREFIXlgsl` ORDER BY `id` ASC");
|
||||
$result = $db->resultQuery("SELECT * FROM `GSP_DB_PREFIXlgsl` ORDER BY `id` ASC");
|
||||
|
||||
foreach($result as $row)
|
||||
{
|
||||
|
|
@ -217,7 +217,7 @@
|
|||
|
||||
//---------------------------------------------------------+
|
||||
|
||||
$result = $db->resultQuery("SELECT * FROM `OGP_DB_PREFIXlgsl` ORDER BY `id` ASC");
|
||||
$result = $db->resultQuery("SELECT * FROM `GSP_DB_PREFIXlgsl` ORDER BY `id` ASC");
|
||||
|
||||
foreach($result as $row)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@
|
|||
if ($id != NULL)
|
||||
{
|
||||
$id = intval($id);
|
||||
$result = $db->resultQuery("SELECT * FROM `OGP_DB_PREFIXlgsl` WHERE `id`='{$id}' LIMIT 1");
|
||||
$result = $db->resultQuery("SELECT * FROM `GSP_DB_PREFIXlgsl` WHERE `id`='{$id}' LIMIT 1");
|
||||
if (!is_array($result)) { return FALSE; }
|
||||
$row = $result[0];
|
||||
list($type, $ip, $c_port, $q_port, $s_port) = array($row['type'], $row['ip'], $row['c_port'], $row['q_port'], $row['s_port']);
|
||||
|
|
@ -94,14 +94,14 @@
|
|||
list($type, $ip, $c_port, $q_port, $s_port) = array($db->real_escape_string($type), $db->real_escape_string($ip), intval($c_port), intval($q_port), intval($s_port));
|
||||
|
||||
if (!$type || !$ip || !$c_port || !$q_port) { exit("LGSL PROBLEM: INVALID SERVER '{$type} : {$ip} : {$c_port} : {$q_port} : {$s_port}'"); }
|
||||
$result = $db->resultQuery("SELECT * FROM `OGP_DB_PREFIXlgsl` WHERE `type`='{$type}' AND `ip`='{$ip}' AND `q_port`='{$q_port}' LIMIT 1");
|
||||
$result = $db->resultQuery("SELECT * FROM `GSP_DB_PREFIXlgsl` WHERE `type`='{$type}' AND `ip`='{$ip}' AND `q_port`='{$q_port}' LIMIT 1");
|
||||
$row = $result[0];
|
||||
|
||||
if (!is_array($result))
|
||||
{
|
||||
if (strpos($request, "a") === FALSE) { exit("LGSL PROBLEM: SERVER NOT IN DATABASE '{$type} : {$ip} : {$c_port} : {$q_port} : {$s_port}'"); }
|
||||
$db->query("INSERT INTO `OGP_DB_PREFIXlgsl` (`type`,`ip`,`c_port`,`q_port`,`s_port`,`cache`,`cache_time`) VALUES ('{$type}','{$ip}','{$c_port}','{$q_port}','{$s_port}','','')");
|
||||
$result = $db->resultQuery("SELECT * FROM `OGP_DB_PREFIXlgsl` WHERE `type`='{$type}' AND `ip`='{$ip}' AND `q_port`='{$q_port}' LIMIT 1");
|
||||
$db->query("INSERT INTO `GSP_DB_PREFIXlgsl` (`type`,`ip`,`c_port`,`q_port`,`s_port`,`cache`,`cache_time`) VALUES ('{$type}','{$ip}','{$c_port}','{$q_port}','{$s_port}','','')");
|
||||
$result = $db->resultQuery("SELECT * FROM `GSP_DB_PREFIXlgsl` WHERE `type`='{$type}' AND `ip`='{$ip}' AND `q_port`='{$q_port}' LIMIT 1");
|
||||
$row = $result[0];
|
||||
}
|
||||
}
|
||||
|
|
@ -180,7 +180,7 @@
|
|||
|
||||
$packed_times = time() + $lgsl_config['cache_time'] + 10;
|
||||
$packed_times = "{$packed_times}_{$packed_times}_{$packed_times}";
|
||||
$reuslt = $db->query("UPDATE `OGP_DB_PREFIXlgsl` SET `cache_time`='{$packed_times}' WHERE `id`='{$row['id']}' LIMIT 1");
|
||||
$reuslt = $db->query("UPDATE `GSP_DB_PREFIXlgsl` SET `cache_time`='{$packed_times}' WHERE `id`='{$row['id']}' LIMIT 1");
|
||||
if(!$result) return;
|
||||
|
||||
// GET WHAT IS NEEDED
|
||||
|
|
@ -221,7 +221,7 @@
|
|||
|
||||
$packed_cache = $db->real_escape_string(base64_encode(serialize($cache)));
|
||||
$packed_times = $db->real_escape_string(implode("_", $cache_time));
|
||||
$result = $db->query("UPDATE `OGP_DB_PREFIXlgsl` SET `status`='{$cache['b']['status']}',`cache`='{$packed_cache}',`cache_time`='{$packed_times}' WHERE `id`='{$row['id']}' LIMIT 1");
|
||||
$result = $db->query("UPDATE `GSP_DB_PREFIXlgsl` SET `status`='{$cache['b']['status']}',`cache`='{$packed_cache}',`cache_time`='{$packed_times}' WHERE `id`='{$row['id']}' LIMIT 1");
|
||||
if(!$result) return;
|
||||
}
|
||||
|
||||
|
|
@ -256,7 +256,7 @@
|
|||
if ($zone != 0) { $where[] = "FIND_IN_SET('{$zone}',`zone`)"; }
|
||||
if ($type != "") { $where[] = "`type`='{$type}'"; }
|
||||
|
||||
$result = $db->resultQuery("SELECT `id` FROM `OGP_DB_PREFIXlgsl` WHERE ".implode(" AND ", $where)." ORDER BY {$order}");
|
||||
$result = $db->resultQuery("SELECT `id` FROM `GSP_DB_PREFIXlgsl` WHERE ".implode(" AND ", $where)." ORDER BY {$order}");
|
||||
$server_list = array();
|
||||
|
||||
foreach($result as $row)
|
||||
|
|
@ -324,7 +324,7 @@
|
|||
{
|
||||
global $db;
|
||||
$id = intval($id);
|
||||
$query = $db->resultQuery("SELECT `type`,`ip`,`c_port`,`q_port`,`s_port` FROM `OGP_DB_PREFIXlgsl` WHERE `id`='{$id}' LIMIT 1");
|
||||
$query = $db->resultQuery("SELECT `type`,`ip`,`c_port`,`q_port`,`s_port` FROM `GSP_DB_PREFIXlgsl` WHERE `id`='{$id}' LIMIT 1");
|
||||
if (!$query) { return FALSE; }
|
||||
return $query[0];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ $module_menus = array( array( 'subpage' => 'lgsl', 'name'=>'LGSL', 'group'=>'use
|
|||
|
||||
$install_queries = array();
|
||||
$install_queries[0] = array(
|
||||
"CREATE TABLE IF NOT EXISTS ".OGP_DB_PREFIX."lgsl
|
||||
"CREATE TABLE IF NOT EXISTS ".GSP_DB_PREFIX."lgsl
|
||||
(
|
||||
|
||||
`id` INT (11) NOT NULL auto_increment,
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ $module_menus = array(
|
|||
## of the next array if you are updating from a version previous or equal to 2429:
|
||||
$install_queries[0] = array();
|
||||
$install_queries[1] = array();
|
||||
$install_queries[2] = array("DROP TABLE IF EXISTS ".OGP_DB_PREFIX."module_access_rights",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."module_access_rights` (".
|
||||
$install_queries[2] = array("DROP TABLE IF EXISTS ".GSP_DB_PREFIX."module_access_rights",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."module_access_rights` (".
|
||||
"`module_id` int(11) NOT NULL COMMENT 'This references to modules.id',".
|
||||
"`flag` char(1) NOT NULL,".
|
||||
"`description` varchar(64) NOT NULL,".
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ $module_required = TRUE;
|
|||
$module_menus = array( array( 'subpage' => 'mysql_admin', 'name'=>'MySQL Admin', 'group'=>'admin' ) );
|
||||
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."mysql_servers`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."mysql_servers` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."mysql_servers`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."mysql_servers` (
|
||||
`mysql_server_id` int(11) NOT NULL auto_increment,
|
||||
`remote_server_id` int(11) NOT NULL,
|
||||
`mysql_name` varchar(100) NOT NULL,
|
||||
|
|
@ -23,8 +23,8 @@ $install_queries[0] = array(
|
|||
PRIMARY KEY (`mysql_server_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||
|
||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."mysql_databases",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."mysql_databases` (
|
||||
"DROP TABLE IF EXISTS ".GSP_DB_PREFIX."mysql_databases",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."mysql_databases` (
|
||||
`db_id` int(11) NOT NULL auto_increment,
|
||||
`mysql_server_id` int(11) NOT NULL,
|
||||
`home_id` int(11) NOT NULL,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
|
||||
|
||||
$mysql_dbs = $db->resultQuery("SELECT db_id FROM OGP_DB_PREFIXmysql_databases WHERE enabled=1 AND home_id=".$server_home['home_id']);
|
||||
$mysql_dbs = $db->resultQuery("SELECT db_id FROM GSP_DB_PREFIXmysql_databases WHERE enabled=1 AND home_id=".$server_home['home_id']);
|
||||
if(!empty($mysql_dbs))
|
||||
{
|
||||
$module_buttons = array(
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Component of the mysql module
|
||||
*/
|
||||
|
||||
class MySQLModuleDatabase extends OGPDatabaseMySQL
|
||||
class MySQLModuleDatabase extends GSPDatabaseMySQL
|
||||
{
|
||||
protected $link;
|
||||
protected $table_prefix;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Component of the mysql module
|
||||
*/
|
||||
|
||||
class MySQLModuleDatabase extends OGPDatabaseMySQL
|
||||
class MySQLModuleDatabase extends GSPDatabaseMySQL
|
||||
{
|
||||
protected $link;
|
||||
protected $table_prefix;
|
||||
|
|
|
|||
|
|
@ -14,15 +14,15 @@ $module_menus = array(
|
|||
|
||||
$install_queries = array();
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."remote_server_ips`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."remote_server_ips` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."remote_server_ips`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."remote_server_ips` (
|
||||
`ip_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`remote_server_id` int(11) NOT NULL,
|
||||
`ip` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`ip_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."remote_servers`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."remote_servers` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."remote_servers`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."remote_servers` (
|
||||
`remote_server_id` int(11) NOT NULL auto_increment,
|
||||
`remote_server_name` varchar(100) NOT NULL,
|
||||
`ogp_user` varchar(100) NOT NULL,
|
||||
|
|
@ -36,18 +36,18 @@ $install_queries[0] = array(
|
|||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Remote servers and IPs';");
|
||||
|
||||
$install_queries[1] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."remote_servers`
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."remote_servers`
|
||||
ADD `use_nat` int(11) NOT NULL;");
|
||||
$install_queries[2] = array(
|
||||
"ALTER TABLE `OGP_DB_PREFIXremote_servers`
|
||||
"ALTER TABLE `GSP_DB_PREFIXremote_servers`
|
||||
ADD `ufw_status` CHAR(8);");
|
||||
$install_queries[3] = array(
|
||||
"ALTER TABLE `OGP_DB_PREFIXremote_servers`
|
||||
"ALTER TABLE `GSP_DB_PREFIXremote_servers`
|
||||
ADD `ftp_ip` varchar(255) NOT NULL;");
|
||||
|
||||
$install_queries[4] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."arrange_ports`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."arrange_ports` (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."arrange_ports`;",
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."arrange_ports` (
|
||||
`range_id` int(11) NOT NULL auto_increment,
|
||||
`ip_id` int(11) NOT NULL,
|
||||
`home_cfg_id` int(11) NOT NULL,
|
||||
|
|
@ -59,17 +59,17 @@ $install_queries[4] = array(
|
|||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Remote servers and IPs';");
|
||||
|
||||
$install_queries[5] = array(
|
||||
"ALTER TABLE `OGP_DB_PREFIXremote_servers`
|
||||
"ALTER TABLE `GSP_DB_PREFIXremote_servers`
|
||||
DROP COLUMN `ufw_status`;",
|
||||
"ALTER TABLE `OGP_DB_PREFIXremote_servers`
|
||||
"ALTER TABLE `GSP_DB_PREFIXremote_servers`
|
||||
ADD `firewall_settings` LONGTEXT NULL;");
|
||||
|
||||
$install_queries[6] = array(
|
||||
"ALTER TABLE `OGP_DB_PREFIXremote_servers`
|
||||
"ALTER TABLE `GSP_DB_PREFIXremote_servers`
|
||||
ADD `display_public_ip` varchar(15) NOT NULL;");
|
||||
|
||||
$install_queries[7] = array(
|
||||
"ALTER TABLE `OGP_DB_PREFIXremote_servers`
|
||||
"ALTER TABLE `GSP_DB_PREFIXremote_servers`
|
||||
MODIFY `display_public_ip` varchar(255) NOT NULL;");
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -15,13 +15,13 @@ $module_menus = array(
|
|||
|
||||
$install_queries = array();
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."settings;",
|
||||
"CREATE TABLE ".OGP_DB_PREFIX."settings (
|
||||
"DROP TABLE IF EXISTS ".GSP_DB_PREFIX."settings;",
|
||||
"CREATE TABLE ".GSP_DB_PREFIX."settings (
|
||||
`setting` varchar(63) NOT NULL,
|
||||
`value` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`setting`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
||||
|
||||
$install_queries[1] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."settings` CHANGE `value` `value` VARCHAR( 1024 ) NOT NULL;");
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."settings` CHANGE `value` `value` VARCHAR( 1024 ) NOT NULL;");
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class Attachments
|
|||
|
||||
private $errors = array();
|
||||
|
||||
public function __construct(OGPDatabase $db, $attachments, $path, $maxAttachments, $maxSize, $permittedExtensions)
|
||||
public function __construct(GSPDatabase $db, $attachments, $path, $maxAttachments, $maxSize, $permittedExtensions)
|
||||
{
|
||||
$this->db = $db;
|
||||
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@ class TicketSettings
|
|||
{
|
||||
private $db;
|
||||
|
||||
public function __construct(OGPDatabase $db)
|
||||
public function __construct(GSPDatabase $db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
public function get($setting = '*')
|
||||
{
|
||||
$query = "SELECT setting_name, setting_value FROM OGP_DB_PREFIXticket_settings";
|
||||
$query = "SELECT setting_name, setting_value FROM GSP_DB_PREFIXticket_settings";
|
||||
|
||||
if (is_array($setting) && !empty($setting)) {
|
||||
$in = '';
|
||||
|
|
@ -44,7 +44,7 @@ class TicketSettings
|
|||
$setting_name = $this->db->real_escape_string($setting_name);
|
||||
$setting_value = $this->db->real_escape_string($setting_value);
|
||||
|
||||
$queryString = "INSERT INTO OGP_DB_PREFIXticket_settings (setting_name, setting_value)
|
||||
$queryString = "INSERT INTO GSP_DB_PREFIXticket_settings (setting_name, setting_value)
|
||||
VALUES (
|
||||
'". $setting_name ."', '". $setting_value ."'
|
||||
)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ class Ticket
|
|||
{
|
||||
private $db;
|
||||
|
||||
public function __construct(OGPDatabase $db)
|
||||
public function __construct(GSPDatabase $db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
|
@ -14,13 +14,13 @@ class Ticket
|
|||
$limitStart = ((int)($page - 1) * $limit);
|
||||
|
||||
$query = "SELECT a.tid, a.uid, a.user_id, a.parent_id, a.subject, a.created_at, a.last_updated, a.status, a.assigned_to
|
||||
FROM OGP_DB_PREFIXtickets a ";
|
||||
FROM GSP_DB_PREFIXtickets a ";
|
||||
|
||||
if ($ticketsFor !== null) {
|
||||
$query .= "WHERE a.user_id = ".(int)$ticketsFor." OR a.parent_id = ".(int)$ticketsFor." ";
|
||||
|
||||
if ($this->db->isSubUser($ticketsFor)) {
|
||||
$result = $this->db->resultQuery("SELECT users_parent FROM OGP_DB_PREFIXusers WHERE user_id = ".(int)$ticketsFor);
|
||||
$result = $this->db->resultQuery("SELECT users_parent FROM GSP_DB_PREFIXusers WHERE user_id = ".(int)$ticketsFor);
|
||||
$query .= "OR a.parent_id = ".(int)$result[0]['users_parent']." ";
|
||||
}
|
||||
}
|
||||
|
|
@ -33,13 +33,13 @@ class Ticket
|
|||
|
||||
public function count($ticketsFor = null)
|
||||
{
|
||||
$query = "SELECT COUNT(1) as ticketCount FROM OGP_DB_PREFIXtickets a ";
|
||||
$query = "SELECT COUNT(1) as ticketCount FROM GSP_DB_PREFIXtickets a ";
|
||||
|
||||
if ($ticketsFor !== null) {
|
||||
$query .= "WHERE a.user_id = ".(int)$ticketsFor." OR a.parent_id = ".(int)$ticketsFor." ";
|
||||
|
||||
if ($this->db->isSubUser($ticketsFor)) {
|
||||
$result = $this->db->resultQuery("SELECT users_parent FROM OGP_DB_PREFIXusers WHERE user_id = ".(int)$ticketsFor);
|
||||
$result = $this->db->resultQuery("SELECT users_parent FROM GSP_DB_PREFIXusers WHERE user_id = ".(int)$ticketsFor);
|
||||
$query .= "OR a.parent_id = ".(int)$result[0]['users_parent']." ";
|
||||
}
|
||||
}
|
||||
|
|
@ -50,13 +50,13 @@ class Ticket
|
|||
|
||||
public function notificationCount($ticketsFor = null, $status = 0)
|
||||
{
|
||||
$query = "SELECT COUNT(1) as ticketCount FROM OGP_DB_PREFIXtickets a WHERE a.status = ".(int)$status." ";
|
||||
$query = "SELECT COUNT(1) as ticketCount FROM GSP_DB_PREFIXtickets a WHERE a.status = ".(int)$status." ";
|
||||
|
||||
if ($ticketsFor !== null) {
|
||||
$query .= "AND (a.user_id = ".(int)$ticketsFor." OR a.parent_id = ".(int)$ticketsFor." ";
|
||||
|
||||
if ($this->db->isSubUser($ticketsFor)) {
|
||||
$result = $this->db->resultQuery("SELECT users_parent FROM OGP_DB_PREFIXusers WHERE user_id = ".(int)$ticketsFor);
|
||||
$result = $this->db->resultQuery("SELECT users_parent FROM GSP_DB_PREFIXusers WHERE user_id = ".(int)$ticketsFor);
|
||||
$query .= "OR a.parent_id = ".(int)$result[0]['users_parent'].")";
|
||||
} else {
|
||||
$query .= ")";
|
||||
|
|
@ -71,8 +71,8 @@ class Ticket
|
|||
{
|
||||
$query = "SELECT a.tid, a.uid, a.user_id, a.user_ip, a.subject, a.status, a.service_id, a.created_at, a.last_updated,
|
||||
b.users_login, b.users_fname, b.users_lname, b.users_role, b.users_email
|
||||
FROM OGP_DB_PREFIXtickets a
|
||||
JOIN OGP_DB_PREFIXusers b
|
||||
FROM GSP_DB_PREFIXtickets a
|
||||
JOIN GSP_DB_PREFIXusers b
|
||||
ON (a.user_id = b.user_id)
|
||||
WHERE tid = $tid
|
||||
AND uid = '".$this->db->real_escape_string($uid)."'";
|
||||
|
|
@ -96,8 +96,8 @@ class Ticket
|
|||
{
|
||||
$query = "SELECT a.reply_id, a.ticket_id, a.user_id, a.user_ip, a.message, a.date, a.rating, a.is_admin,
|
||||
b.user_id, b.users_login, b.users_role, b.users_fname, b.users_lname, b.users_email, b.users_parent
|
||||
FROM OGP_DB_PREFIXticket_messages a
|
||||
JOIN OGP_DB_PREFIXusers b
|
||||
FROM GSP_DB_PREFIXticket_messages a
|
||||
JOIN GSP_DB_PREFIXusers b
|
||||
ON (a.user_id = b.user_id)
|
||||
WHERE a.ticket_id = $tid
|
||||
ORDER BY a.reply_id DESC";
|
||||
|
|
@ -108,7 +108,7 @@ class Ticket
|
|||
private function getAttachments($tid)
|
||||
{
|
||||
$query = "SELECT attachment_id, reply_id, original_name, unique_name
|
||||
FROM OGP_DB_PREFIXticket_attachments
|
||||
FROM GSP_DB_PREFIXticket_attachments
|
||||
WHERE ticket_id = $tid
|
||||
ORDER BY reply_id DESC";
|
||||
|
||||
|
|
@ -144,7 +144,7 @@ class Ticket
|
|||
{
|
||||
$parent_id = $user_id;
|
||||
if ($this->db->isSubUser($user_id)) {
|
||||
$result = $this->db->resultQuery("SELECT users_parent FROM OGP_DB_PREFIXusers WHERE user_id = ".(int)$user_id);
|
||||
$result = $this->db->resultQuery("SELECT users_parent FROM GSP_DB_PREFIXusers WHERE user_id = ".(int)$user_id);
|
||||
$parent_id = (int)$result[0]['users_parent'];
|
||||
}
|
||||
|
||||
|
|
@ -199,17 +199,17 @@ class Ticket
|
|||
public function updateStatus($tid, $uid, $status)
|
||||
{
|
||||
$status = (int)$status;
|
||||
return $this->db->query("UPDATE OGP_DB_PREFIXtickets SET status = $status WHERE tid = $tid AND uid = '$uid'");
|
||||
return $this->db->query("UPDATE GSP_DB_PREFIXtickets SET status = $status WHERE tid = $tid AND uid = '$uid'");
|
||||
}
|
||||
|
||||
public function updateTimestamp($tid, $uid)
|
||||
{
|
||||
return $this->db->query("UPDATE OGP_DB_PREFIXtickets SET last_updated = NOW() WHERE tid = $tid AND uid = '$uid'");
|
||||
return $this->db->query("UPDATE GSP_DB_PREFIXtickets SET last_updated = NOW() WHERE tid = $tid AND uid = '$uid'");
|
||||
}
|
||||
|
||||
public function exists($tid, $uid)
|
||||
{
|
||||
$query = "SELECT COUNT(1) AS ticketCount FROM OGP_DB_PREFIXtickets
|
||||
$query = "SELECT COUNT(1) AS ticketCount FROM GSP_DB_PREFIXtickets
|
||||
WHERE `tid` = $tid AND
|
||||
`uid` = '".$this->db->real_escape_string($uid)."'";
|
||||
|
||||
|
|
@ -220,8 +220,8 @@ class Ticket
|
|||
public function authorized($user_id, $tid, $uid)
|
||||
{
|
||||
$query = "SELECT a.user_id as utid, a.parent_id, b.user_id, b.users_parent
|
||||
FROM OGP_DB_PREFIXtickets a
|
||||
JOIN OGP_DB_PREFIXusers b
|
||||
FROM GSP_DB_PREFIXtickets a
|
||||
JOIN GSP_DB_PREFIXusers b
|
||||
ON (
|
||||
a.user_id = b.user_id
|
||||
OR a.user_id = b.users_parent
|
||||
|
|
@ -263,7 +263,7 @@ class Ticket
|
|||
|
||||
public function setRating($tid, $reply_id, $rating)
|
||||
{
|
||||
$query = "UPDATE OGP_DB_PREFIXticket_messages
|
||||
$query = "UPDATE GSP_DB_PREFIXticket_messages
|
||||
SET rating = ".(int)$rating."
|
||||
WHERE ticket_id = ".(int)$tid." AND reply_id = ".(int)$reply_id;
|
||||
|
||||
|
|
@ -273,7 +273,7 @@ class Ticket
|
|||
// Move this to the attachment class...?
|
||||
public function getAttachmentById($attachment_id, $tid)
|
||||
{
|
||||
$query = "SELECT original_name, unique_name FROM OGP_DB_PREFIXticket_attachments
|
||||
$query = "SELECT original_name, unique_name FROM GSP_DB_PREFIXticket_attachments
|
||||
WHERE attachment_id = ".(int)$attachment_id." AND ticket_id = ".(int)$tid;
|
||||
|
||||
$result = $this->db->resultQuery($query);
|
||||
|
|
|
|||
|
|
@ -40,14 +40,14 @@ $module_menus = array(
|
|||
);
|
||||
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."ticket_replies`",
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."ticket_replies`",
|
||||
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."ticket_messages`",
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."ticket_attachments`",
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."ticket_settings`",
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."tickets`",
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."ticket_messages`",
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."ticket_attachments`",
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."ticket_settings`",
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."tickets`",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."tickets` (
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."tickets` (
|
||||
`tid` int NOT NULL AUTO_INCREMENT,
|
||||
`uid` varchar(32) NOT NULL UNIQUE,
|
||||
`user_id` int NOT NULL,
|
||||
|
|
@ -62,7 +62,7 @@ $install_queries[0] = array(
|
|||
PRIMARY KEY (`tid`)
|
||||
);",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."ticket_messages` (
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."ticket_messages` (
|
||||
`reply_id` int NOT NULL AUTO_INCREMENT,
|
||||
`ticket_id` int NOT NULL,
|
||||
`user_id` int NOT NULL,
|
||||
|
|
@ -74,11 +74,11 @@ $install_queries[0] = array(
|
|||
PRIMARY KEY (`reply_id`)
|
||||
);",
|
||||
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."ticket_messages` ADD CONSTRAINT `".OGP_DB_PREFIX."ticket_messages_fk0` FOREIGN KEY (`ticket_id`) REFERENCES `".OGP_DB_PREFIX."tickets`(`tid`);",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."ticket_messages` ADD CONSTRAINT `".GSP_DB_PREFIX."ticket_messages_fk0` FOREIGN KEY (`ticket_id`) REFERENCES `".GSP_DB_PREFIX."tickets`(`tid`);",
|
||||
);
|
||||
|
||||
$install_queries[1] = array(
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."ticket_attachments` (
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."ticket_attachments` (
|
||||
`attachment_id` int NOT NULL AUTO_INCREMENT,
|
||||
`ticket_id` int NOT NULL,
|
||||
`reply_id` int,
|
||||
|
|
@ -89,21 +89,21 @@ $install_queries[1] = array(
|
|||
);
|
||||
|
||||
$install_queries[2] = array(
|
||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."ticket_settings` (
|
||||
"CREATE TABLE IF NOT EXISTS `".GSP_DB_PREFIX."ticket_settings` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`setting_name` varchar(32) NOT NULL UNIQUE,
|
||||
`setting_value` TEXT NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
);",
|
||||
|
||||
"INSERT INTO `".OGP_DB_PREFIX."ticket_settings` (setting_name, setting_value) VALUES ('ratings_enabled', true) ON DUPLICATE KEY UPDATE `setting_name` = 'ratings_enabled', `setting_value` = true",
|
||||
"INSERT INTO `".OGP_DB_PREFIX."ticket_settings` (setting_name, setting_value) VALUES ('attachments_enabled', true) ON DUPLICATE KEY UPDATE `setting_name` = 'attachments_enabled', `setting_value` = true",
|
||||
"INSERT INTO `".OGP_DB_PREFIX."ticket_settings` (setting_name, setting_value) VALUES ('attachment_max_size', '52428800') ON DUPLICATE KEY UPDATE `setting_name` = 'attachment_max_size', `setting_value` = '52428800'",
|
||||
"INSERT INTO `".OGP_DB_PREFIX."ticket_settings` (setting_name, setting_value) VALUES ('attachment_limit', '5') ON DUPLICATE KEY UPDATE `setting_name` = 'attachment_limit', `setting_value` = '5'",
|
||||
"INSERT INTO `".OGP_DB_PREFIX."ticket_settings` (setting_name, setting_value) VALUES ('attachment_save_dir', '".__DIR__ . '/uploads' ."') ON DUPLICATE KEY UPDATE `setting_name` = 'attachment_save_dir', `setting_value` = '".__DIR__ . '/uploads' ."'",
|
||||
"INSERT INTO `".OGP_DB_PREFIX."ticket_settings` (setting_name, setting_value) VALUES ('attachment_extensions', 'jpg, gif, jpeg, jpg, png, pdf, txt, sql, zip') ON DUPLICATE KEY UPDATE `setting_name` = 'attachment_extensions', `setting_value` = 'jpg, gif, jpeg, jpg, png, pdf, txt, sql, zip'",
|
||||
"INSERT INTO `".GSP_DB_PREFIX."ticket_settings` (setting_name, setting_value) VALUES ('ratings_enabled', true) ON DUPLICATE KEY UPDATE `setting_name` = 'ratings_enabled', `setting_value` = true",
|
||||
"INSERT INTO `".GSP_DB_PREFIX."ticket_settings` (setting_name, setting_value) VALUES ('attachments_enabled', true) ON DUPLICATE KEY UPDATE `setting_name` = 'attachments_enabled', `setting_value` = true",
|
||||
"INSERT INTO `".GSP_DB_PREFIX."ticket_settings` (setting_name, setting_value) VALUES ('attachment_max_size', '52428800') ON DUPLICATE KEY UPDATE `setting_name` = 'attachment_max_size', `setting_value` = '52428800'",
|
||||
"INSERT INTO `".GSP_DB_PREFIX."ticket_settings` (setting_name, setting_value) VALUES ('attachment_limit', '5') ON DUPLICATE KEY UPDATE `setting_name` = 'attachment_limit', `setting_value` = '5'",
|
||||
"INSERT INTO `".GSP_DB_PREFIX."ticket_settings` (setting_name, setting_value) VALUES ('attachment_save_dir', '".__DIR__ . '/uploads' ."') ON DUPLICATE KEY UPDATE `setting_name` = 'attachment_save_dir', `setting_value` = '".__DIR__ . '/uploads' ."'",
|
||||
"INSERT INTO `".GSP_DB_PREFIX."ticket_settings` (setting_name, setting_value) VALUES ('attachment_extensions', 'jpg, gif, jpeg, jpg, png, pdf, txt, sql, zip') ON DUPLICATE KEY UPDATE `setting_name` = 'attachment_extensions', `setting_value` = 'jpg, gif, jpeg, jpg, png, pdf, txt, sql, zip'",
|
||||
);
|
||||
|
||||
$install_queries[3] = array(
|
||||
"INSERT INTO `".OGP_DB_PREFIX."ticket_settings` (setting_name, setting_value) VALUES ('notifications_enabled', true) ON DUPLICATE KEY UPDATE `setting_name` = 'notifications_enabled', `setting_value` = true",
|
||||
"INSERT INTO `".GSP_DB_PREFIX."ticket_settings` (setting_name, setting_value) VALUES ('notifications_enabled', true) ON DUPLICATE KEY UPDATE `setting_name` = 'notifications_enabled', `setting_value` = true",
|
||||
);
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ $module_menus = array( array( 'subpage' => '', 'name'=>'tshock', 'group'=>'user'
|
|||
|
||||
$install_queries = array();
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."tshock;",
|
||||
"CREATE TABLE ".OGP_DB_PREFIX."tshock (
|
||||
"DROP TABLE IF EXISTS ".GSP_DB_PREFIX."tshock;",
|
||||
"CREATE TABLE ".GSP_DB_PREFIX."tshock (
|
||||
`token_id` int(11) NOT NULL auto_increment,
|
||||
`ip` varchar(255) NOT NULL,
|
||||
`port` int(11) NOT NULL,
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ function exec_ogp_module()
|
|||
|
||||
$current_blacklist = array();
|
||||
|
||||
$blacklisted_files = $db->resultQuery('SELECT file_path FROM `OGP_DB_PREFIXupdate_blacklist`;');
|
||||
$blacklisted_files = $db->resultQuery('SELECT file_path FROM `GSP_DB_PREFIXupdate_blacklist`;');
|
||||
if($blacklisted_files !== FALSE)
|
||||
{
|
||||
$current_blacklist = array();
|
||||
|
|
@ -64,7 +64,7 @@ function exec_ogp_module()
|
|||
foreach($_POST['blacklist'] as $file)
|
||||
{
|
||||
$file = $db->real_escape_string($file);
|
||||
$db->query("INSERT INTO `OGP_DB_PREFIXupdate_blacklist` SET file_path='$file';");
|
||||
$db->query("INSERT INTO `GSP_DB_PREFIXupdate_blacklist` SET file_path='$file';");
|
||||
}
|
||||
|
||||
foreach($_POST['folder_files'] as $file)
|
||||
|
|
@ -74,12 +74,12 @@ function exec_ogp_module()
|
|||
if(!in_array($file,$_POST['blacklist']))
|
||||
{
|
||||
$file = $db->real_escape_string($file);
|
||||
$db->query("DELETE FROM `OGP_DB_PREFIXupdate_blacklist` WHERE file_path='$file';");
|
||||
$db->query("DELETE FROM `GSP_DB_PREFIXupdate_blacklist` WHERE file_path='$file';");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$blacklisted_files = $db->resultQuery('SELECT file_path FROM `OGP_DB_PREFIXupdate_blacklist`;');
|
||||
$blacklisted_files = $db->resultQuery('SELECT file_path FROM `GSP_DB_PREFIXupdate_blacklist`;');
|
||||
if($blacklisted_files !== FALSE)
|
||||
{
|
||||
$current_blacklist = array();
|
||||
|
|
|
|||
|
|
@ -15,17 +15,17 @@ $module_menus = array(
|
|||
$install_queries = array();
|
||||
$install_queries[0] = array();
|
||||
$install_queries[1] = array(
|
||||
"CREATE TABLE IF NOT EXISTS ".OGP_DB_PREFIX."update_blacklist (
|
||||
"CREATE TABLE IF NOT EXISTS ".GSP_DB_PREFIX."update_blacklist (
|
||||
`file_path` VARCHAR(1000) UNIQUE NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
||||
$install_queries[2] = array(
|
||||
"DELETE FROM ".OGP_DB_PREFIX."update_blacklist
|
||||
"DELETE FROM ".GSP_DB_PREFIX."update_blacklist
|
||||
WHERE file_path IN (SELECT *
|
||||
FROM (SELECT file_path FROM ".OGP_DB_PREFIX."update_blacklist
|
||||
FROM (SELECT file_path FROM ".GSP_DB_PREFIX."update_blacklist
|
||||
GROUP BY file_path HAVING (COUNT(*) > 1)
|
||||
) AS A
|
||||
);",
|
||||
"ALTER TABLE ".OGP_DB_PREFIX."update_blacklist MODIFY file_path VARCHAR(1000);",
|
||||
"ALTER TABLE ".OGP_DB_PREFIX."update_blacklist ADD UNIQUE (file_path);"
|
||||
"ALTER TABLE ".GSP_DB_PREFIX."update_blacklist MODIFY file_path VARCHAR(1000);",
|
||||
"ALTER TABLE ".GSP_DB_PREFIX."update_blacklist ADD UNIQUE (file_path);"
|
||||
);
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ function exec_ogp_module()
|
|||
$blacklist = array ('/install.php',
|
||||
'/modules/gamemanager/rsync_sites_local.list');
|
||||
|
||||
$blacklisted_files = $db->resultQuery('SELECT file_path FROM `OGP_DB_PREFIXupdate_blacklist`;');
|
||||
$blacklisted_files = $db->resultQuery('SELECT file_path FROM `GSP_DB_PREFIXupdate_blacklist`;');
|
||||
if($blacklisted_files !== FALSE)
|
||||
{
|
||||
$current_blacklist = array();
|
||||
|
|
@ -227,8 +227,8 @@ function exec_ogp_module()
|
|||
// update version info in db
|
||||
|
||||
$version = $db->real_escape_string($_GET['version']);
|
||||
$db->query("UPDATE OGP_DB_PREFIXsettings SET value = '$version' WHERE setting = 'ogp_version'");
|
||||
$db->query("UPDATE OGP_DB_PREFIXsettings SET value = '$vtype' WHERE setting = 'version_type'");
|
||||
$db->query("UPDATE GSP_DB_PREFIXsettings SET value = '$version' WHERE setting = 'ogp_version'");
|
||||
$db->query("UPDATE GSP_DB_PREFIXsettings SET value = '$vtype' WHERE setting = 'version_type'");
|
||||
|
||||
// Remove the downloaded package
|
||||
if( file_exists( $temp_dwl ) )
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ $module_menus = array(
|
|||
|
||||
$install_queries = array();
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."users;",
|
||||
"CREATE TABLE ".OGP_DB_PREFIX."users (
|
||||
"DROP TABLE IF EXISTS ".GSP_DB_PREFIX."users;",
|
||||
"CREATE TABLE ".GSP_DB_PREFIX."users (
|
||||
`user_id` int(11) NOT NULL auto_increment,
|
||||
`users_login` varchar(255) NOT NULL,
|
||||
`users_passwd` varchar(255) NOT NULL,
|
||||
|
|
@ -36,41 +36,41 @@ $install_queries[0] = array(
|
|||
PRIMARY KEY (`users_login`),
|
||||
UNIQUE KEY `id` (`user_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."user_groups;",
|
||||
"CREATE TABLE ".OGP_DB_PREFIX."user_groups (
|
||||
"DROP TABLE IF EXISTS ".GSP_DB_PREFIX."user_groups;",
|
||||
"CREATE TABLE ".GSP_DB_PREFIX."user_groups (
|
||||
`user_id` int(11) NOT NULL,
|
||||
`role_id` int(11) NULL,
|
||||
`group_id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`user_id`,`group_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."user_role_info;",
|
||||
"CREATE TABLE ".OGP_DB_PREFIX."user_role_info (
|
||||
"DROP TABLE IF EXISTS ".GSP_DB_PREFIX."user_role_info;",
|
||||
"CREATE TABLE ".GSP_DB_PREFIX."user_role_info (
|
||||
`role_id` int(11) NOT NULL auto_increment,
|
||||
`role_name` varchar(100) NULL,
|
||||
PRIMARY KEY (`role_id`), UNIQUE KEY (`role_name`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."user_group_info;",
|
||||
"CREATE TABLE ".OGP_DB_PREFIX."user_group_info (
|
||||
"DROP TABLE IF EXISTS ".GSP_DB_PREFIX."user_group_info;",
|
||||
"CREATE TABLE ".GSP_DB_PREFIX."user_group_info (
|
||||
`group_id` int(11) NOT NULL auto_increment,
|
||||
`group_name` varchar(255), PRIMARY KEY (`group_id`),
|
||||
UNIQUE KEY (`group_name`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
||||
|
||||
$install_queries[1] = array("ALTER TABLE `".OGP_DB_PREFIX."user_group_info` ADD `main_user_id` int(11) NULL;");
|
||||
$install_queries[2] = array("ALTER TABLE `".OGP_DB_PREFIX."users` ADD `users_parent` int(11) NULL;");
|
||||
$install_queries[1] = array("ALTER TABLE `".GSP_DB_PREFIX."user_group_info` ADD `main_user_id` int(11) NULL;");
|
||||
$install_queries[2] = array("ALTER TABLE `".GSP_DB_PREFIX."users` ADD `users_parent` int(11) NULL;");
|
||||
$install_queries[3] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."users` CHANGE `users_email` `users_email` VARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL",
|
||||
"UPDATE ".OGP_DB_PREFIX."users
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."users` CHANGE `users_email` `users_email` VARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL",
|
||||
"UPDATE ".GSP_DB_PREFIX."users
|
||||
JOIN (
|
||||
SELECT users_email, MIN(user_id) minID
|
||||
FROM ".OGP_DB_PREFIX."users
|
||||
FROM ".GSP_DB_PREFIX."users
|
||||
GROUP BY users_email
|
||||
HAVING COUNT(*) > 1
|
||||
) t2 ON ".OGP_DB_PREFIX."users.users_email = t2.users_email AND ".OGP_DB_PREFIX."users.user_id != t2.minID
|
||||
SET ".OGP_DB_PREFIX."users.users_email = DEFAULT;",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."users` ADD UNIQUE `email` (`users_email`);");
|
||||
$install_queries[4] = array("UPDATE ".OGP_DB_PREFIX."users SET users_email = DEFAULT WHERE users_email = '';");
|
||||
$install_queries[5] = array("ALTER TABLE `".OGP_DB_PREFIX."user_groups` MODIFY group_id int(11) NOT NULL;");
|
||||
$install_queries[6] = array("ALTER TABLE `".OGP_DB_PREFIX."users` ADD `users_page_limit` int(11) NULL DEFAULT 25;");
|
||||
$install_queries[7] = array("ALTER TABLE `".OGP_DB_PREFIX."users` ADD `user_receives_emails` tinyint(1) NOT NULL DEFAULT 1;");
|
||||
) t2 ON ".GSP_DB_PREFIX."users.users_email = t2.users_email AND ".GSP_DB_PREFIX."users.user_id != t2.minID
|
||||
SET ".GSP_DB_PREFIX."users.users_email = DEFAULT;",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."users` ADD UNIQUE `email` (`users_email`);");
|
||||
$install_queries[4] = array("UPDATE ".GSP_DB_PREFIX."users SET users_email = DEFAULT WHERE users_email = '';");
|
||||
$install_queries[5] = array("ALTER TABLE `".GSP_DB_PREFIX."user_groups` MODIFY group_id int(11) NOT NULL;");
|
||||
$install_queries[6] = array("ALTER TABLE `".GSP_DB_PREFIX."users` ADD `users_page_limit` int(11) NULL DEFAULT 25;");
|
||||
$install_queries[7] = array("ALTER TABLE `".GSP_DB_PREFIX."users` ADD `user_receives_emails` tinyint(1) NOT NULL DEFAULT 1;");
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
function exec_ogp_module()
|
||||
{
|
||||
global $db;
|
||||
$expired_servers = $db->resultQuery("SELECT home_name, home_id, server_expiration_date FROM OGP_DB_PREFIXserver_homes WHERE server_expiration_date NOT LIKE 'X' AND server_expiration_date <= ".time().";");
|
||||
$expired_servers = $db->resultQuery("SELECT home_name, home_id, server_expiration_date FROM GSP_DB_PREFIXserver_homes WHERE server_expiration_date NOT LIKE 'X' AND server_expiration_date <= ".time().";");
|
||||
if($expired_servers)
|
||||
{
|
||||
foreach($expired_servers as $expired_server)
|
||||
|
|
@ -16,7 +16,7 @@ function exec_ogp_module()
|
|||
}
|
||||
}
|
||||
|
||||
$expired_users = $db->resultQuery("SELECT user_id, home_id, user_expiration_date FROM OGP_DB_PREFIXuser_homes WHERE user_expiration_date NOT LIKE 'X' AND user_expiration_date <= ".time().";");
|
||||
$expired_users = $db->resultQuery("SELECT user_id, home_id, user_expiration_date FROM GSP_DB_PREFIXuser_homes WHERE user_expiration_date NOT LIKE 'X' AND user_expiration_date <= ".time().";");
|
||||
if($expired_users)
|
||||
{
|
||||
foreach($expired_users as $expired_user)
|
||||
|
|
@ -27,9 +27,9 @@ function exec_ogp_module()
|
|||
}
|
||||
|
||||
$expired_groups = $db->resultQuery("SELECT g.group_id, g.home_id, g.user_group_expiration_date, ug.user_id
|
||||
FROM OGP_DB_PREFIXuser_group_homes g
|
||||
FROM GSP_DB_PREFIXuser_group_homes g
|
||||
INNER JOIN
|
||||
OGP_DB_PREFIXuser_groups ug
|
||||
GSP_DB_PREFIXuser_groups ug
|
||||
ON ug.group_id=g.group_id
|
||||
WHERE g.user_group_expiration_date NOT LIKE 'X' AND g.user_group_expiration_date <= ".time()." GROUP BY g.home_id;");
|
||||
if($expired_groups)
|
||||
|
|
|
|||
|
|
@ -787,7 +787,7 @@ function exec_ogp_module()
|
|||
if( isset($_REQUEST['set_ip']) )
|
||||
{
|
||||
$ip_id = $db->real_escape_string($_POST['ip']);
|
||||
$ip_row = $db->resultQuery( "SELECT ip FROM OGP_DB_PREFIXremote_server_ips WHERE ip_id=".$ip_id );
|
||||
$ip_row = $db->resultQuery( "SELECT ip FROM GSP_DB_PREFIXremote_server_ips WHERE ip_id=".$ip_id );
|
||||
$ip = $ip_row['0']['ip'];
|
||||
$port = $_POST['port'];
|
||||
$port = (int)(trim($port));
|
||||
|
|
|
|||
|
|
@ -23,12 +23,12 @@ function exec_ogp_module()
|
|||
$precmd = $db->real_escape_string($_POST['edit_preinstall_cmds']);
|
||||
if( isset( $_POST['save_as_default'] ) )
|
||||
{
|
||||
$game_mod_query = "UPDATE OGP_DB_PREFIXconfig_mods SET def_precmd='$precmd' WHERE mod_cfg_id='$mod_cfg_id'";
|
||||
$game_mod_query = "UPDATE GSP_DB_PREFIXconfig_mods SET def_precmd='$precmd' WHERE mod_cfg_id='$mod_cfg_id'";
|
||||
$db->query($game_mod_query);
|
||||
}
|
||||
else
|
||||
{
|
||||
$game_mod_query = "UPDATE OGP_DB_PREFIXgame_mods SET precmd='$precmd' WHERE mod_id='$mod_id'";
|
||||
$game_mod_query = "UPDATE GSP_DB_PREFIXgame_mods SET precmd='$precmd' WHERE mod_id='$mod_id'";
|
||||
$db->query($game_mod_query);
|
||||
}
|
||||
$home_info = $db->getGameHome($home_id);
|
||||
|
|
@ -39,12 +39,12 @@ function exec_ogp_module()
|
|||
$postcmd = $db->real_escape_string($_POST['edit_postinstall_cmds']);
|
||||
if( isset( $_POST['save_as_default'] ) )
|
||||
{
|
||||
$game_mod_query = "UPDATE OGP_DB_PREFIXconfig_mods SET def_postcmd='$postcmd' WHERE mod_cfg_id='$mod_cfg_id'";
|
||||
$game_mod_query = "UPDATE GSP_DB_PREFIXconfig_mods SET def_postcmd='$postcmd' WHERE mod_cfg_id='$mod_cfg_id'";
|
||||
$db->query($game_mod_query);
|
||||
}
|
||||
else
|
||||
{
|
||||
$game_mod_query = "UPDATE OGP_DB_PREFIXgame_mods SET postcmd='$postcmd' WHERE mod_id='$mod_id'";
|
||||
$game_mod_query = "UPDATE GSP_DB_PREFIXgame_mods SET postcmd='$postcmd' WHERE mod_id='$mod_id'";
|
||||
$db->query($game_mod_query);
|
||||
}
|
||||
$home_info = $db->getGameHome($home_id);
|
||||
|
|
|
|||
|
|
@ -13,22 +13,22 @@ $module_menus = array(
|
|||
);
|
||||
$install_queries = array();
|
||||
$install_queries[0] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."user_homes`;",
|
||||
"CREATE TABLE IF NOT EXISTS ".OGP_DB_PREFIX."user_homes (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."user_homes`;",
|
||||
"CREATE TABLE IF NOT EXISTS ".GSP_DB_PREFIX."user_homes (
|
||||
`home_id` int(11) NOT NULL,
|
||||
`user_id` int(11) NOT NULL,
|
||||
`access_rights` varchar(63) default NULL,
|
||||
PRIMARY KEY (`user_id`,`home_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."user_group_remote_servers;",
|
||||
"CREATE TABLE ".OGP_DB_PREFIX."user_group_remote_servers (
|
||||
"DROP TABLE IF EXISTS ".GSP_DB_PREFIX."user_group_remote_servers;",
|
||||
"CREATE TABLE ".GSP_DB_PREFIX."user_group_remote_servers (
|
||||
`remote_server_id` int(11) NOT NULL,
|
||||
`group_id` int(11) NOT NULL,
|
||||
`access_rights` varchar(63) default NULL,
|
||||
PRIMARY KEY (`remote_server_id`, `group_id`)
|
||||
)ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."user_group_homes;",
|
||||
"CREATE TABLE ".OGP_DB_PREFIX."user_group_homes (
|
||||
"DROP TABLE IF EXISTS ".GSP_DB_PREFIX."user_group_homes;",
|
||||
"CREATE TABLE ".GSP_DB_PREFIX."user_group_homes (
|
||||
`home_id` int(11) NOT NULL,
|
||||
`group_id` int(11) NOT NULL,
|
||||
`access_rights` varchar(63) default NULL,
|
||||
|
|
@ -36,8 +36,8 @@ $install_queries[0] = array(
|
|||
)ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
||||
|
||||
$install_queries[1] = array(
|
||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."master_server_homes`;",
|
||||
"CREATE TABLE IF NOT EXISTS ".OGP_DB_PREFIX."master_server_homes (
|
||||
"DROP TABLE IF EXISTS `".GSP_DB_PREFIX."master_server_homes`;",
|
||||
"CREATE TABLE IF NOT EXISTS ".GSP_DB_PREFIX."master_server_homes (
|
||||
`home_id` int(11) NOT NULL,
|
||||
`home_cfg_id` int(11) NOT NULL,
|
||||
`remote_server_id` int(11) NOT NULL,
|
||||
|
|
@ -45,9 +45,9 @@ $install_queries[1] = array(
|
|||
)ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
||||
|
||||
$install_queries[2] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."user_homes` ADD `user_expiration_date` VARCHAR(21) NOT NULL default 'X';",
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."user_group_homes` ADD `user_group_expiration_date` VARCHAR(21) NOT NULL default 'X';");
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."user_homes` ADD `user_expiration_date` VARCHAR(21) NOT NULL default 'X';",
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."user_group_homes` ADD `user_group_expiration_date` VARCHAR(21) NOT NULL default 'X';");
|
||||
|
||||
$install_queries[3] = array(
|
||||
"ALTER TABLE `".OGP_DB_PREFIX."game_mods` modify column `cpu_affinity` varchar(64) null AFTER `extra_params`, comment = 'utf8mb4_general_ci';");
|
||||
"ALTER TABLE `".GSP_DB_PREFIX."game_mods` modify column `cpu_affinity` varchar(64) null AFTER `extra_params`, comment = 'utf8mb4_general_ci';");
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -480,7 +480,7 @@ function api_user_games()
|
|||
if($mod_key === FALSE)
|
||||
return array("status" => '307', "message" => "The mod_cfg_id #" . $mod_cfg_id . " does not belong to the game configuration for home_cfg_id #" . $home_cfg_id . ".");
|
||||
|
||||
$ip_info = $db->resultQuery( "SELECT ip,ip_id FROM OGP_DB_PREFIXremote_server_ips WHERE ip='".$db->real_escape_string($ip)."' AND remote_server_id=".$db->real_escape_string($remote_server_id));
|
||||
$ip_info = $db->resultQuery( "SELECT ip,ip_id FROM GSP_DB_PREFIXremote_server_ips WHERE ip='".$db->real_escape_string($ip)."' AND remote_server_id=".$db->real_escape_string($remote_server_id));
|
||||
if($ip_info === FALSE)
|
||||
return array("status" => '308', "message" => "The given IP address does not belongs to the given remote server.");
|
||||
|
||||
|
|
@ -586,7 +586,7 @@ function api_user_games()
|
|||
if($host_stat !== 1)
|
||||
return array("status" => '310', "message" => "The remote server is offline.");
|
||||
|
||||
$ip_info = $db->resultQuery("SELECT ip,ip_id FROM OGP_DB_PREFIXremote_server_ips WHERE ip='".$db->real_escape_string($ip)."' AND remote_server_id=".$db->real_escape_string($game_home['remote_server_id']));
|
||||
$ip_info = $db->resultQuery("SELECT ip,ip_id FROM GSP_DB_PREFIXremote_server_ips WHERE ip='".$db->real_escape_string($ip)."' AND remote_server_id=".$db->real_escape_string($game_home['remote_server_id']));
|
||||
if($ip_info === FALSE)
|
||||
return array("status" => '308', "message" => "The given IP address does not belongs to the given remote server.");
|
||||
|
||||
|
|
@ -1488,7 +1488,7 @@ function api_addonsmanager()
|
|||
|
||||
if($request[0] == "list")
|
||||
{
|
||||
$addons_rows = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXaddons");
|
||||
$addons_rows = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXaddons");
|
||||
$status = "200";
|
||||
$message = $addons_rows;
|
||||
}
|
||||
|
|
@ -1545,7 +1545,7 @@ function api_addonsmanager()
|
|||
$query_groups .= "group_id=0 OR group_id IS NULL)";
|
||||
}
|
||||
|
||||
$addons_rows = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXaddons WHERE home_cfg_id=".$home_info['home_cfg_id']." AND addon_id=".$addon_id.$query_groups);
|
||||
$addons_rows = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXaddons WHERE home_cfg_id=".$home_info['home_cfg_id']." AND addon_id=".$addon_id.$query_groups);
|
||||
|
||||
if($addons_rows === FALSE)
|
||||
return array("status" => '341', "message" => "Invalid addon id #" . $addon_id . ".");
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ try
|
|||
if ($sid !== 0) {
|
||||
$ts3_ServerInstance->serverStop($sid);
|
||||
$ts3_ServerInstance->serverDelete($sid);
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXts3_homes WHERE vserver_id=" . $db->real_escape_string($sid));
|
||||
$db->query( "DELETE FROM GSP_DB_PREFIXts3_homes WHERE vserver_id=" . $db->real_escape_string($sid));
|
||||
}
|
||||
|
||||
/* refresh */
|
||||
|
|
@ -134,11 +134,11 @@ try
|
|||
if(isset($_POST['assign_to_user']) && (int)$_POST['vserver_id'] == $ts3_ServerInstance->getId() AND $server_home['remote_server_id'] == $_POST['remote_server_id'] )
|
||||
{
|
||||
$query_ip = $server_home['use_nat'] == 1 ? $server_home['agent_ip'] : $server_home['ip'];
|
||||
$db->query("INSERT INTO OGP_DB_PREFIXts3_homes (`rserver_id`, `ip`, `pwd`, `vserver_id`, `user_id`, `port`) VALUES ('".$server_home['remote_server_id']."', '".$query_ip."', '".$cfg["pass"]."', '".(int)$_POST['vserver_id']."', '".$db->real_escape_string($_POST['assign_to_user'])."', '".$cfg['query']."');");
|
||||
$db->query("INSERT INTO GSP_DB_PREFIXts3_homes (`rserver_id`, `ip`, `pwd`, `vserver_id`, `user_id`, `port`) VALUES ('".$server_home['remote_server_id']."', '".$query_ip."', '".$cfg["pass"]."', '".(int)$_POST['vserver_id']."', '".$db->real_escape_string($_POST['assign_to_user'])."', '".$cfg['query']."');");
|
||||
}
|
||||
if(isset($_POST['remove_vuser_id']) && (int)$_POST['vserver_id'] == $ts3_ServerInstance->getId() AND $server_home['remote_server_id'] == (int)$_POST['remote_server_id'] )
|
||||
{
|
||||
$db->query( "DELETE FROM OGP_DB_PREFIXts3_homes WHERE vserver_id='" . (int)$_POST['vserver_id'] . "' AND user_id='".(int)$_POST['remove_vuser_id']."' AND rserver_id='".(int)$_POST['remote_server_id']."';" );
|
||||
$db->query( "DELETE FROM GSP_DB_PREFIXts3_homes WHERE vserver_id='" . (int)$_POST['vserver_id'] . "' AND user_id='".(int)$_POST['remove_vuser_id']."' AND rserver_id='".(int)$_POST['remote_server_id']."';" );
|
||||
}
|
||||
$add_remove_virtual .= "<tr><td>Assign This Virtual<br>Server To User</td><td>
|
||||
<form action='' method='POST'>
|
||||
|
|
@ -155,7 +155,7 @@ try
|
|||
<input type='hidden' name='vserver_id' value='".$ts3_ServerInstance->getId()."' />
|
||||
</form></td></tr>";
|
||||
|
||||
$ts3vservers = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXts3_homes WHERE vserver_id='".$ts3_ServerInstance->getId()."' AND rserver_id=".$server_home['remote_server_id'] );
|
||||
$ts3vservers = $db->resultQuery("SELECT * FROM GSP_DB_PREFIXts3_homes WHERE vserver_id='".$ts3_ServerInstance->getId()."' AND rserver_id=".$server_home['remote_server_id'] );
|
||||
if($ts3vservers != 0)
|
||||
{
|
||||
$ts3vuserlist = "<b>TeamSpeak 3</b><br>";
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ $db = createDatabaseConnection($db_type, $db_host, $db_user, $db_pass, $db_name,
|
|||
// Load languages.
|
||||
include_once("includes/lang.php");
|
||||
|
||||
if (!$db instanceof OGPDatabase) {
|
||||
if (!$db instanceof GSPDatabase) {
|
||||
ogpLang();
|
||||
die(get_lang('no_db_connection'));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue