fix: consolidate module schemas to db_version=1, fix billing admin undefined vars and prefix
Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/35af6b7c-2518-4105-b4d2-ba1f3fe754cd Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
parent
95e3f40021
commit
d8972fee16
10 changed files with 284 additions and 344 deletions
|
|
@ -25,25 +25,21 @@
|
||||||
// Module general information
|
// Module general information
|
||||||
$module_title = "TS3Admin";
|
$module_title = "TS3Admin";
|
||||||
$module_version = "0.2";
|
$module_version = "0.2";
|
||||||
$db_version = 2;
|
$db_version = 1;
|
||||||
$module_required = TRUE;
|
$module_required = TRUE;
|
||||||
$module_menus = array( array( 'subpage' => '', 'name'=>'ts3admin', 'group'=>'user' ) );
|
$module_menus = array( array( 'subpage' => '', 'name'=>'ts3admin', 'group'=>'user' ) );
|
||||||
$install_queries = array();
|
$install_queries = array();
|
||||||
$install_queries[0] = array(
|
$install_queries[0] = array(
|
||||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."ts3_homes`;",
|
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."ts3_homes` (
|
||||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."ts3_homes`
|
`ts3_id` int(50) NOT NULL auto_increment,
|
||||||
(`ts3_id` int(50) NOT NULL auto_increment,
|
|
||||||
`rserver_id` int(50) NOT NULL,
|
`rserver_id` int(50) NOT NULL,
|
||||||
`ip` varchar(20) NOT NULL,
|
`ip` varchar(20) NOT NULL,
|
||||||
`pwd` varchar(40) NOT NULL,
|
`pwd` varchar(40) NOT NULL,
|
||||||
`vserver_id` int(50) NOT NULL,
|
`vserver_id` int(50) NOT NULL,
|
||||||
`user_id` int(50) NOT NULL,
|
`user_id` int(50) NOT NULL,
|
||||||
|
`port` int(11) DEFAULT '10011',
|
||||||
PRIMARY KEY (`ts3_id`),
|
PRIMARY KEY (`ts3_id`),
|
||||||
UNIQUE KEY user_id (user_id,vserver_id)) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
UNIQUE KEY `rserver_id` (`rserver_id`,`vserver_id`,`user_id`)
|
||||||
$install_queries[1] = array(
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;"
|
||||||
"ALTER TABLE `".OGP_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'"
|
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
|
|
@ -25,24 +25,21 @@
|
||||||
// Module general information
|
// Module general information
|
||||||
$module_title = "Addons Manager";
|
$module_title = "Addons Manager";
|
||||||
$module_version = "1.2";
|
$module_version = "1.2";
|
||||||
$db_version = 2;
|
$db_version = 1;
|
||||||
$module_required = TRUE;
|
$module_required = TRUE;
|
||||||
$module_menus = array( array( 'subpage' => 'addons_manager', 'name'=>'Addons Manager', 'group'=>'admin' ) );
|
$module_menus = array( array( 'subpage' => 'addons_manager', 'name'=>'Addons Manager', 'group'=>'admin' ) );
|
||||||
|
|
||||||
$install_queries = array();
|
$install_queries = array();
|
||||||
$install_queries[0] = array(
|
$install_queries[0] = array(
|
||||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."addons`;",
|
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."addons` (
|
||||||
"CREATE TABLE IF NOT EXISTS ".OGP_DB_PREFIX."addons
|
`addon_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
(addon_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
`name` VARCHAR(80) NOT NULL,
|
||||||
name VARCHAR(80) NOT NULL,
|
`url` VARCHAR(200) NOT NULL,
|
||||||
url VARCHAR(200) NOT NULL,
|
`path` VARCHAR(80) NOT NULL,
|
||||||
path VARCHAR(80) NOT NULL,
|
`addon_type` VARCHAR(7) NOT NULL,
|
||||||
addon_type VARCHAR(7) NOT NULL,
|
`home_cfg_id` VARCHAR(7) NOT NULL,
|
||||||
home_cfg_id VARCHAR(7) NOT NULL) ENGINE=MyISAM;");
|
`post_script` longtext NOT NULL,
|
||||||
|
`group_id` int(11) NULL
|
||||||
$install_queries[1] = array(
|
) ENGINE=MyISAM;"
|
||||||
"ALTER TABLE `".OGP_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;");
|
|
||||||
?>
|
?>
|
||||||
|
|
@ -2,6 +2,17 @@
|
||||||
// Admin landing page
|
// Admin landing page
|
||||||
require_once(__DIR__ . '/includes/admin_auth.php');
|
require_once(__DIR__ . '/includes/admin_auth.php');
|
||||||
require_once(__DIR__ . '/includes/config_loader.php');
|
require_once(__DIR__ . '/includes/config_loader.php');
|
||||||
|
|
||||||
|
// Ensure site variables are defined regardless of which config was loaded.
|
||||||
|
// The panel config (loaded first by config_loader) does not define these, so
|
||||||
|
// we fall back to safe defaults when they are absent.
|
||||||
|
if (!isset($SITE_BASE_URL)) {
|
||||||
|
$SITE_BASE_URL = '';
|
||||||
|
}
|
||||||
|
if (!isset($SITE_DATA_DIR)) {
|
||||||
|
$SITE_DATA_DIR = realpath(__DIR__ . '/data') ?: (__DIR__ . '/data');
|
||||||
|
}
|
||||||
|
|
||||||
include(__DIR__ . '/includes/top.php');
|
include(__DIR__ . '/includes/top.php');
|
||||||
include(__DIR__ . '/includes/menu.php');
|
include(__DIR__ . '/includes/menu.php');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,21 +57,39 @@ function sync_billing_services(mysqli $db, string $prefix): array
|
||||||
{
|
{
|
||||||
$messages = [];
|
$messages = [];
|
||||||
|
|
||||||
// Schema guard: verify billing_services has the expected columns before touching it.
|
// Schema auto-repair: add any missing columns to billing_services before syncing.
|
||||||
// col_exists() is provided by bootstrap.php.
|
// col_exists() is provided by bootstrap.php.
|
||||||
$requiredCols = ['home_cfg_id', 'mod_cfg_id', 'service_name', 'description',
|
|
||||||
'remote_server_id', 'enabled', 'out_of_stock',
|
|
||||||
'price_daily', 'price_monthly', 'price_year',
|
|
||||||
'slot_min_qty', 'slot_max_qty', 'install_method'];
|
|
||||||
$tableName = $prefix . 'billing_services';
|
$tableName = $prefix . 'billing_services';
|
||||||
foreach ($requiredCols as $col) {
|
|
||||||
|
// Map of column => ALTER TABLE fragment to add it if missing.
|
||||||
|
$autoRepairCols = [
|
||||||
|
'description' => "ADD COLUMN `description` VARCHAR(1000) NOT NULL DEFAULT ''",
|
||||||
|
'img_url' => "ADD COLUMN `img_url` VARCHAR(255) NOT NULL DEFAULT ''",
|
||||||
|
'out_of_stock' => "ADD COLUMN `out_of_stock` VARCHAR(255) NOT NULL DEFAULT ''",
|
||||||
|
'slot_min_qty' => "ADD COLUMN `slot_min_qty` INT(11) NOT NULL DEFAULT 0",
|
||||||
|
'slot_max_qty' => "ADD COLUMN `slot_max_qty` INT(11) NOT NULL DEFAULT 0",
|
||||||
|
'price_daily' => "ADD COLUMN `price_daily` FLOAT(15,4) NOT NULL DEFAULT 0",
|
||||||
|
'price_monthly' => "ADD COLUMN `price_monthly` FLOAT(15,4) NOT NULL DEFAULT 0",
|
||||||
|
'price_year' => "ADD COLUMN `price_year` FLOAT(15,4) NOT NULL DEFAULT 0",
|
||||||
|
'remote_server_id' => "ADD COLUMN `remote_server_id` VARCHAR(255) NOT NULL DEFAULT ''",
|
||||||
|
'install_method' => "ADD COLUMN `install_method` VARCHAR(255) NOT NULL DEFAULT 'steamcmd'",
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($autoRepairCols as $col => $alterFragment) {
|
||||||
if (!col_exists($db, $tableName, $col)) {
|
if (!col_exists($db, $tableName, $col)) {
|
||||||
$messages[] = "⚠ Schema issue: column '{$col}' missing from {$tableName}. Run the billing module migration.";
|
$t = $db->real_escape_string($tableName);
|
||||||
|
if ($db->query("ALTER TABLE `{$t}` {$alterFragment}")) {
|
||||||
|
$messages[] = "✔ Auto-repaired: added column '{$col}' to {$tableName}.";
|
||||||
|
} else {
|
||||||
|
$messages[] = "✖ Could not add column '{$col}' to {$tableName}: " . $db->error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If critical columns are missing, skip the sync to avoid SQL errors.
|
}
|
||||||
|
|
||||||
|
// If critical columns are still missing after repair, skip the sync to avoid SQL errors.
|
||||||
foreach (['service_name', 'mod_cfg_id', 'enabled'] as $critical) {
|
foreach (['service_name', 'mod_cfg_id', 'enabled'] as $critical) {
|
||||||
if (!col_exists($db, $tableName, $critical)) {
|
if (!col_exists($db, $tableName, $critical)) {
|
||||||
|
$messages[] = "⚠ Critical column '{$critical}' missing from {$tableName}; skipping sync.";
|
||||||
return $messages;
|
return $messages;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
// Module general information
|
// Module general information
|
||||||
$module_title = "billing";
|
$module_title = "billing";
|
||||||
$module_version = "3.2";
|
$module_version = "3.2";
|
||||||
$db_version = 4;
|
$db_version = 1;
|
||||||
$module_required = FALSE;
|
$module_required = FALSE;
|
||||||
// Module description
|
// Module description
|
||||||
$module_description = "Billing storefront / provisioning integration. Public ordering runs as a standalone site; panel pages provide provisioning and admin order management.";
|
$module_description = "Billing storefront / provisioning integration. Public ordering runs as a standalone site; panel pages provide provisioning and admin order management.";
|
||||||
|
|
@ -39,14 +39,20 @@ $module_menus = array(
|
||||||
|
|
||||||
$install_queries = array();
|
$install_queries = array();
|
||||||
|
|
||||||
// Version 1: Current schema - clean install with all tables and required columns
|
// Baseline schema — all billing tables with their final column set.
|
||||||
|
// This is the single source of truth for fresh installs.
|
||||||
|
// All CREATE TABLE statements use IF NOT EXISTS so they are safe to re-run.
|
||||||
|
// Existing installs at any previous db_version already have these tables and columns,
|
||||||
|
// so no incremental ALTER chains are needed here.
|
||||||
$install_queries[0] = array(
|
$install_queries[0] = array(
|
||||||
// Billing Services - Available game server packages
|
// Billing Services — available game server packages
|
||||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_services` (
|
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_services` (
|
||||||
`service_id` INT(11) NOT NULL AUTO_INCREMENT,
|
`service_id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||||
`home_cfg_id` INT(11) NOT NULL DEFAULT 0,
|
`home_cfg_id` INT(11) NOT NULL DEFAULT 0,
|
||||||
`mod_cfg_id` INT(11) NOT NULL DEFAULT 0,
|
`mod_cfg_id` INT(11) NOT NULL DEFAULT 0,
|
||||||
`service_name` VARCHAR(255) NOT NULL,
|
`service_name` VARCHAR(255) NOT NULL,
|
||||||
|
`description` VARCHAR(1000) NOT NULL DEFAULT '',
|
||||||
|
`img_url` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
`remote_server_id` VARCHAR(255) NOT NULL DEFAULT '',
|
`remote_server_id` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
`out_of_stock` VARCHAR(255) NOT NULL DEFAULT '',
|
`out_of_stock` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
`slot_max_qty` INT(11) NOT NULL DEFAULT 0,
|
`slot_max_qty` INT(11) NOT NULL DEFAULT 0,
|
||||||
|
|
@ -54,8 +60,6 @@ $install_queries[0] = array(
|
||||||
`price_daily` FLOAT(15,4) NOT NULL DEFAULT 0,
|
`price_daily` FLOAT(15,4) NOT NULL DEFAULT 0,
|
||||||
`price_monthly` FLOAT(15,4) NOT NULL DEFAULT 0,
|
`price_monthly` FLOAT(15,4) NOT NULL DEFAULT 0,
|
||||||
`price_year` FLOAT(15,4) NOT NULL DEFAULT 0,
|
`price_year` FLOAT(15,4) NOT NULL DEFAULT 0,
|
||||||
`description` VARCHAR(1000) NOT NULL DEFAULT '',
|
|
||||||
`img_url` VARCHAR(255) NOT NULL DEFAULT '',
|
|
||||||
`ftp` VARCHAR(255) NOT NULL DEFAULT '',
|
`ftp` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
`install_method` VARCHAR(255) NOT NULL DEFAULT 'steamcmd',
|
`install_method` VARCHAR(255) NOT NULL DEFAULT 'steamcmd',
|
||||||
`manual_url` VARCHAR(255) NOT NULL DEFAULT '',
|
`manual_url` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
|
|
@ -66,7 +70,7 @@ $install_queries[0] = array(
|
||||||
KEY `mod_cfg_id` (`mod_cfg_id`)
|
KEY `mod_cfg_id` (`mod_cfg_id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;",
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;",
|
||||||
|
|
||||||
// Billing Orders - Actual game server instances (ongoing services)
|
// Billing Orders — active game server instances
|
||||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_orders` (
|
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_orders` (
|
||||||
`order_id` INT(11) NOT NULL AUTO_INCREMENT,
|
`order_id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||||
`user_id` INT(11) NOT NULL,
|
`user_id` INT(11) NOT NULL,
|
||||||
|
|
@ -92,12 +96,13 @@ $install_queries[0] = array(
|
||||||
KEY `home_id` (`home_id`)
|
KEY `home_id` (`home_id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;",
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;",
|
||||||
|
|
||||||
// Billing Invoices - Created when user adds to cart, becomes order after payment
|
// Billing Invoices — created on cart add, paid after payment capture
|
||||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_invoices` (
|
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_invoices` (
|
||||||
`invoice_id` INT(11) NOT NULL AUTO_INCREMENT,
|
`invoice_id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||||
`order_id` INT(11) NOT NULL DEFAULT 0,
|
`order_id` INT(11) NOT NULL DEFAULT 0,
|
||||||
`user_id` INT(11) NOT NULL,
|
`user_id` INT(11) NOT NULL,
|
||||||
`service_id` INT(11) NOT NULL,
|
`service_id` INT(11) NOT NULL,
|
||||||
|
`home_id` INT(11) NOT NULL DEFAULT 0,
|
||||||
`home_name` VARCHAR(255) NOT NULL DEFAULT '',
|
`home_name` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
`ip` INT(11) NOT NULL DEFAULT 0,
|
`ip` INT(11) NOT NULL DEFAULT 0,
|
||||||
`max_players` INT(11) NOT NULL DEFAULT 0,
|
`max_players` INT(11) NOT NULL DEFAULT 0,
|
||||||
|
|
@ -115,6 +120,14 @@ $install_queries[0] = array(
|
||||||
`payment_method` VARCHAR(50) NULL,
|
`payment_method` VARCHAR(50) NULL,
|
||||||
`description` VARCHAR(500) NOT NULL DEFAULT '',
|
`description` VARCHAR(500) NOT NULL DEFAULT '',
|
||||||
`invoice_duration` VARCHAR(16) NOT NULL DEFAULT 'month',
|
`invoice_duration` VARCHAR(16) NOT NULL DEFAULT 'month',
|
||||||
|
`rate_type` ENUM('daily','monthly','yearly') NOT NULL DEFAULT 'monthly',
|
||||||
|
`rate_per_player` DECIMAL(15,4) NOT NULL DEFAULT 0,
|
||||||
|
`players` INT(11) NOT NULL DEFAULT 0,
|
||||||
|
`period_start` DATETIME NULL,
|
||||||
|
`period_end` DATETIME NULL,
|
||||||
|
`subtotal` DECIMAL(15,2) NOT NULL DEFAULT 0,
|
||||||
|
`total_due` DECIMAL(15,2) NOT NULL DEFAULT 0,
|
||||||
|
`payment_status` ENUM('unpaid','paid','cancelled','refunded') NOT NULL DEFAULT 'unpaid',
|
||||||
`qty` INT(11) NOT NULL DEFAULT 1,
|
`qty` INT(11) NOT NULL DEFAULT 1,
|
||||||
PRIMARY KEY (`invoice_id`),
|
PRIMARY KEY (`invoice_id`),
|
||||||
KEY `order_id` (`order_id`),
|
KEY `order_id` (`order_id`),
|
||||||
|
|
@ -122,24 +135,9 @@ $install_queries[0] = array(
|
||||||
KEY `status` (`status`),
|
KEY `status` (`status`),
|
||||||
KEY `due_date` (`due_date`),
|
KEY `due_date` (`due_date`),
|
||||||
KEY `service_id` (`service_id`)
|
KEY `service_id` (`service_id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;",
|
||||||
);
|
|
||||||
|
|
||||||
// Version 2: New columns on billing_invoices, transaction log table, service-to-node mapping
|
// Billing Transactions — immutable payment audit trail
|
||||||
// Each ALTER TABLE is a separate statement because ADD COLUMN IF NOT EXISTS requires MySQL 8.0+.
|
|
||||||
// The module manager only runs these once (on db_version bump 1->2), so they do not need IF NOT EXISTS.
|
|
||||||
$install_queries[1] = array(
|
|
||||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_invoices` ADD COLUMN `home_id` INT(11) NOT NULL DEFAULT 0 AFTER `service_id`",
|
|
||||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_invoices` ADD COLUMN `rate_type` ENUM('daily','monthly','yearly') NOT NULL DEFAULT 'monthly' AFTER `invoice_duration`",
|
|
||||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_invoices` ADD COLUMN `rate_per_player` DECIMAL(15,4) NOT NULL DEFAULT 0 AFTER `rate_type`",
|
|
||||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_invoices` ADD COLUMN `players` INT(11) NOT NULL DEFAULT 0 AFTER `rate_per_player`",
|
|
||||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_invoices` ADD COLUMN `period_start` DATETIME NULL AFTER `players`",
|
|
||||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_invoices` ADD COLUMN `period_end` DATETIME NULL AFTER `period_start`",
|
|
||||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_invoices` ADD COLUMN `subtotal` DECIMAL(15,2) NOT NULL DEFAULT 0 AFTER `period_end`",
|
|
||||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_invoices` ADD COLUMN `total_due` DECIMAL(15,2) NOT NULL DEFAULT 0 AFTER `subtotal`",
|
|
||||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_invoices` ADD COLUMN `payment_status` ENUM('unpaid','paid','cancelled','refunded') NOT NULL DEFAULT 'unpaid' AFTER `total_due`",
|
|
||||||
|
|
||||||
// Payment transaction log — immutable audit trail
|
|
||||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_transactions` (
|
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_transactions` (
|
||||||
`transaction_id` INT(11) NOT NULL AUTO_INCREMENT,
|
`transaction_id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||||
`invoice_id` INT(11) NOT NULL DEFAULT 0,
|
`invoice_id` INT(11) NOT NULL DEFAULT 0,
|
||||||
|
|
@ -161,29 +159,7 @@ $install_queries[1] = array(
|
||||||
KEY `payment_method` (`payment_method`)
|
KEY `payment_method` (`payment_method`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;",
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;",
|
||||||
|
|
||||||
// Service-to-remote-server mapping (admin can enable/disable per service)
|
// Drop legacy mapping table if it still exists from older installs
|
||||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."billing_service_remote_servers` (
|
|
||||||
`id` INT(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`service_id` INT(11) NOT NULL,
|
|
||||||
`remote_server_id` INT(11) NOT NULL,
|
|
||||||
`enabled` TINYINT(1) NOT NULL DEFAULT 1,
|
|
||||||
PRIMARY KEY (`id`),
|
|
||||||
UNIQUE KEY `svc_rs` (`service_id`, `remote_server_id`),
|
|
||||||
KEY `service_id` (`service_id`),
|
|
||||||
KEY `remote_server_id` (`remote_server_id`)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"
|
|
||||||
);
|
|
||||||
|
|
||||||
// Version 3 (array index 2, because install_queries is zero-indexed starting from version 1):
|
|
||||||
// Add override_price to service-to-server mapping table
|
|
||||||
$install_queries[2] = array(
|
|
||||||
"ALTER TABLE `".OGP_DB_PREFIX."billing_service_remote_servers` ADD COLUMN `override_price` DECIMAL(10,2) NULL AFTER `enabled`"
|
|
||||||
);
|
|
||||||
|
|
||||||
// Version 4 (array index 3): Remove the separate service-to-server mapping table.
|
|
||||||
// remote_server_id on billing_services now stores a comma-separated list of server IDs.
|
|
||||||
// The mapping table is no longer used; drop it if it still exists from older installs.
|
|
||||||
$install_queries[3] = array(
|
|
||||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."billing_service_remote_servers`"
|
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."billing_service_remote_servers`"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,15 @@ if (!$db) {
|
||||||
echo "DB connect failed: " . mysqli_connect_error() . PHP_EOL;
|
echo "DB connect failed: " . mysqli_connect_error() . PHP_EOL;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
$prefix = isset($table_prefix) ? $table_prefix : '';
|
||||||
$user = $argv[1] ?? 'iaregamer';
|
$user = $argv[1] ?? 'iaregamer';
|
||||||
$user_safe = mysqli_real_escape_string($db, $user);
|
$user_safe = mysqli_real_escape_string($db, $user);
|
||||||
$has_shadow = false;
|
$has_shadow = false;
|
||||||
$res_cols = mysqli_query($db, "SHOW COLUMNS FROM ogp_users LIKE 'users_pass_hash'");
|
$res_cols = mysqli_query($db, "SHOW COLUMNS FROM `{$prefix}users` LIKE 'users_pass_hash'");
|
||||||
if ($res_cols && mysqli_num_rows($res_cols) > 0) $has_shadow = true;
|
if ($res_cols && mysqli_num_rows($res_cols) > 0) $has_shadow = true;
|
||||||
$select_fields = 'user_id, users_login, users_passwd';
|
$select_fields = 'user_id, users_login, users_passwd';
|
||||||
if ($has_shadow) $select_fields .= ", users_pass_hash";
|
if ($has_shadow) $select_fields .= ", users_pass_hash";
|
||||||
$q = "SELECT $select_fields FROM ogp_users WHERE users_login = '$user_safe' LIMIT 1";
|
$q = "SELECT $select_fields FROM `{$prefix}users` WHERE users_login = '$user_safe' LIMIT 1";
|
||||||
$res = mysqli_query($db, $q);
|
$res = mysqli_query($db, $q);
|
||||||
if (!$res) {
|
if (!$res) {
|
||||||
echo "Query error: " . mysqli_error($db) . PHP_EOL;
|
echo "Query error: " . mysqli_error($db) . PHP_EOL;
|
||||||
|
|
|
||||||
|
|
@ -25,28 +25,25 @@
|
||||||
// Module general information
|
// Module general information
|
||||||
$module_title = "Fast Download";
|
$module_title = "Fast Download";
|
||||||
$module_version = "2.1";
|
$module_version = "2.1";
|
||||||
$db_version = 4;
|
$db_version = 1;
|
||||||
$module_required = TRUE;
|
$module_required = TRUE;
|
||||||
$module_menus = array( array( 'subpage' => '', 'name'=>'Fast Download', 'group'=>'admin' ) );
|
$module_menus = array( array( 'subpage' => '', 'name'=>'Fast Download', 'group'=>'admin' ) );
|
||||||
$module_access_rights = array('d' => 'allow_fast_download');
|
$module_access_rights = array('d' => 'allow_fast_download');
|
||||||
|
|
||||||
$install_queries[0] = array("SELECT NOW();");
|
$install_queries[0] = array(
|
||||||
$install_queries[1] = array("DROP TABLE IF EXISTS `".OGP_DB_PREFIX."fastdl`;");
|
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."fastdl_access_rules` (
|
||||||
$install_queries[2] = array("SELECT NOW();");
|
|
||||||
$install_queries[3] = array(
|
|
||||||
"CREATE TABLE ".OGP_DB_PREFIX."fastdl_access_rules (
|
|
||||||
`home_cfg_id` varchar(32) NOT NULL,
|
`home_cfg_id` varchar(32) NOT NULL,
|
||||||
`match_file_extension` TEXT,
|
`match_file_extension` TEXT,
|
||||||
`match_client_ip` TEXT,
|
`match_client_ip` TEXT,
|
||||||
UNIQUE KEY (`home_cfg_id`)
|
UNIQUE KEY (`home_cfg_id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||||
$install_queries[4] = array(
|
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."fastdl_settings` (
|
||||||
"CREATE TABLE ".OGP_DB_PREFIX."fastdl_settings (
|
|
||||||
`remote_server_id` int(11) NOT NULL,
|
`remote_server_id` int(11) NOT NULL,
|
||||||
`setting` varchar(63) NOT NULL,
|
`setting` varchar(63) NOT NULL,
|
||||||
`value` varchar(255) NOT NULL,
|
`value` varchar(255) NOT NULL,
|
||||||
UNIQUE KEY remote_server_id (remote_server_id,setting)
|
UNIQUE KEY remote_server_id (remote_server_id,setting)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;"
|
||||||
|
);
|
||||||
$uninstall_queries = array("DROP TABLE IF EXISTS `".OGP_DB_PREFIX."fastdl_access_rules`;",
|
$uninstall_queries = array("DROP TABLE IF EXISTS `".OGP_DB_PREFIX."fastdl_access_rules`;",
|
||||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."fastdl_settings`;");
|
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."fastdl_settings`;");
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -25,96 +25,66 @@
|
||||||
// Module general information
|
// Module general information
|
||||||
$module_title = "Game manager";
|
$module_title = "Game manager";
|
||||||
$module_version = "1.33";
|
$module_version = "1.33";
|
||||||
$db_version = 9;
|
$db_version = 1;
|
||||||
$module_required = TRUE;
|
$module_required = TRUE;
|
||||||
$module_menus = array( array( 'subpage' => 'game_monitor', 'name'=>'Game Monitor', 'group'=>'user' ) );
|
$module_menus = array( array( 'subpage' => 'game_monitor', 'name'=>'Game Monitor', 'group'=>'user' ) );
|
||||||
$module_access_rights = array('u' => 'allow_updates', 'p' => 'allow_parameter_usage', 'e' => 'allow_extra_params', 'c' => 'allow_custom_fields');
|
$module_access_rights = array('u' => 'allow_updates', 'p' => 'allow_parameter_usage', 'e' => 'allow_extra_params', 'c' => 'allow_custom_fields');
|
||||||
|
|
||||||
$install_queries[0] = array(
|
$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` (
|
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."home_ip_ports` (
|
||||||
`ip_id` int(11) NOT NULL,
|
`ip_id` int(11) NOT NULL,
|
||||||
`port` int(11) NOT NULL,
|
`port` int(11) NOT NULL,
|
||||||
`home_id` int(11) NOT NULL,
|
`home_id` int(11) NOT NULL,
|
||||||
|
`force_mod_id` int(11) NOT NULL DEFAULT '0',
|
||||||
PRIMARY KEY (`ip_id`,`port`)
|
PRIMARY KEY (`ip_id`,`port`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||||
|
|
||||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."server_homes",
|
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."server_homes` (
|
||||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."server_homes` (
|
|
||||||
`home_id` int(50) NOT NULL auto_increment,
|
`home_id` int(50) NOT NULL auto_increment,
|
||||||
`remote_server_id` int(11) NOT NULL,
|
`remote_server_id` int(11) NOT NULL,
|
||||||
`user_id_main` int(11) NOT NULL,
|
`user_id_main` int(11) NOT NULL,
|
||||||
`home_path` varchar(500) NOT NULL,
|
`home_path` varchar(500) NOT NULL,
|
||||||
`home_cfg_id` int(50) NOT NULL,
|
`home_cfg_id` int(50) NOT NULL,
|
||||||
`home_name` varchar(500) NOT NULL,
|
`home_name` varchar(500) NOT NULL,
|
||||||
`control_password` VARCHAR( 128 ) NULL,
|
`control_password` VARCHAR(128) NULL,
|
||||||
`ftp_password` VARCHAR( 128 ) NULL,
|
`ftp_password` VARCHAR(128) NULL,
|
||||||
|
`ftp_login` varchar(32) NULL,
|
||||||
|
`ftp_status` int(11) NOT NULL DEFAULT '0',
|
||||||
`last_param` LONGTEXT NULL,
|
`last_param` LONGTEXT NULL,
|
||||||
PRIMARY KEY (`home_id`),
|
`custom_fields` LONGTEXT NULL,
|
||||||
UNIQUE KEY remote_server_id (remote_server_id,home_path)
|
`server_expiration_date` VARCHAR(21) NOT NULL DEFAULT 'X',
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
`home_user_order` INT NOT NULL DEFAULT 99999,
|
||||||
|
PRIMARY KEY (`home_id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||||
|
|
||||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."rcon_presets;",
|
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."rcon_presets` (
|
||||||
"CREATE TABLE ".OGP_DB_PREFIX."rcon_presets (
|
|
||||||
`preset_id` int(50) NOT NULL auto_increment,
|
`preset_id` int(50) NOT NULL auto_increment,
|
||||||
`name` varchar(20) NOT NULL,
|
`name` varchar(20) NOT NULL,
|
||||||
`command` varchar(100) NOT NULL,
|
`command` varchar(100) NOT NULL,
|
||||||
`home_cfg_id` int(50) NOT NULL,
|
`home_cfg_id` int(50) NOT NULL,
|
||||||
`mod_cfg_id` int(50) NOT NULL,
|
`mod_cfg_id` int(50) NOT NULL,
|
||||||
PRIMARY KEY (`preset_id`)
|
PRIMARY KEY (`preset_id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||||
|
|
||||||
"DROP TABLE IF EXISTS ".OGP_DB_PREFIX."game_mods",
|
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."game_mods` (
|
||||||
"CREATE TABLE IF NOT EXISTS ".OGP_DB_PREFIX."game_mods (
|
|
||||||
`mod_id` int(50) NOT NULL auto_increment,
|
`mod_id` int(50) NOT NULL auto_increment,
|
||||||
`home_id` int(255) NOT NULL,
|
`home_id` int(255) NOT NULL,
|
||||||
`mod_cfg_id` int(11) NOT NULL,
|
`mod_cfg_id` int(11) NOT NULL,
|
||||||
`max_players` smallint(3) default NULL,
|
`max_players` smallint(3) DEFAULT NULL,
|
||||||
`extra_params` varchar(255) default NULL,
|
`extra_params` varchar(255) DEFAULT NULL,
|
||||||
`cpu_affinity` varchar(2) default NULL,
|
`cpu_affinity` varchar(2) DEFAULT NULL,
|
||||||
`nice` smallint(3) default '0',
|
`nice` smallint(3) DEFAULT '0',
|
||||||
`precmd` TEXT,
|
`precmd` TEXT,
|
||||||
`postcmd` TEXT,
|
`postcmd` TEXT,
|
||||||
PRIMARY KEY (mod_id),
|
PRIMARY KEY (mod_id),
|
||||||
UNIQUE KEY home_id (home_id,mod_cfg_id)
|
UNIQUE KEY home_id (home_id,mod_cfg_id)
|
||||||
) ENGINE=MyISAM;");
|
) ENGINE=MyISAM;",
|
||||||
|
|
||||||
$install_queries[1] = array(
|
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."status_cache` (
|
||||||
"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';");
|
|
||||||
|
|
||||||
$install_queries[2] = array(
|
|
||||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."status_cache`",
|
|
||||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."status_cache` (
|
|
||||||
`date_timestamp` char(16) NOT NULL,
|
`date_timestamp` char(16) NOT NULL,
|
||||||
`ip_id` char(3) NOT NULL,
|
`ip_id` char(3) NOT NULL,
|
||||||
`port` char(6) NOT NULL,
|
`port` char(6) NOT NULL,
|
||||||
`server_status_cache` longtext NOT NULL
|
`server_status_cache` longtext NOT NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;"
|
||||||
|
);
|
||||||
$install_queries[3] = array(
|
|
||||||
"ALTER TABLE `".OGP_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';");
|
|
||||||
|
|
||||||
$install_queries[5] = array(
|
|
||||||
"TRUNCATE `".OGP_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';");
|
|
||||||
|
|
||||||
$install_queries[7] = array(
|
|
||||||
"ALTER TABLE `".OGP_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;");
|
|
||||||
|
|
||||||
// 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);");
|
|
||||||
?>
|
?>
|
||||||
|
|
@ -25,21 +25,18 @@
|
||||||
// Module general information
|
// Module general information
|
||||||
$module_title = "Module manager";
|
$module_title = "Module manager";
|
||||||
$module_version = "1.1";
|
$module_version = "1.1";
|
||||||
$db_version = 2;
|
$db_version = 1;
|
||||||
$module_required = TRUE;
|
$module_required = TRUE;
|
||||||
$module_menus = array(
|
$module_menus = array(
|
||||||
array( 'subpage' => '', 'name'=>'Modules', 'group'=>'admin' )
|
array( 'subpage' => '', 'name'=>'Modules', 'group'=>'admin' )
|
||||||
);
|
);
|
||||||
|
|
||||||
## You will need uncomment the next three lines (remove /* from the beginning and */ from the end)
|
$install_queries[0] = 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` (".
|
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."module_access_rights` (".
|
||||||
"`module_id` int(11) NOT NULL COMMENT 'This references to modules.id',".
|
"`module_id` int(11) NOT NULL COMMENT 'This references to modules.id',".
|
||||||
"`flag` char(1) NOT NULL,".
|
"`flag` char(1) NOT NULL,".
|
||||||
"`description` varchar(64) NOT NULL,".
|
"`description` varchar(64) NOT NULL,".
|
||||||
"UNIQUE (`flag`)".
|
"UNIQUE (`flag`)".
|
||||||
") ENGINE=MyISAM DEFAULT CHARSET=latin1;");
|
") ENGINE=MyISAM DEFAULT CHARSET=latin1;"
|
||||||
|
);
|
||||||
?>
|
?>
|
||||||
|
|
@ -25,23 +25,22 @@
|
||||||
// Module general information
|
// Module general information
|
||||||
$module_title = "Server manager";
|
$module_title = "Server manager";
|
||||||
$module_version = "1.6.1";
|
$module_version = "1.6.1";
|
||||||
$db_version = 7;
|
$db_version = 1;
|
||||||
$module_required = TRUE;
|
$module_required = TRUE;
|
||||||
$module_menus = array(
|
$module_menus = array(
|
||||||
array( 'subpage' => '', 'name'=>'Servers', 'group'=>'admin' )
|
array( 'subpage' => '', 'name'=>'Servers', 'group'=>'admin' )
|
||||||
);
|
);
|
||||||
|
|
||||||
$install_queries = array();
|
$install_queries = array();
|
||||||
$install_queries[0] = 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` (
|
||||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."remote_server_ips` (
|
|
||||||
`ip_id` int(11) NOT NULL AUTO_INCREMENT,
|
`ip_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
`remote_server_id` int(11) NOT NULL,
|
`remote_server_id` int(11) NOT NULL,
|
||||||
`ip` varchar(255) NOT NULL,
|
`ip` varchar(255) NOT NULL,
|
||||||
PRIMARY KEY (`ip_id`)
|
PRIMARY KEY (`ip_id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;",
|
||||||
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."remote_servers`;",
|
|
||||||
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."remote_servers` (
|
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."remote_servers` (
|
||||||
`remote_server_id` int(11) NOT NULL auto_increment,
|
`remote_server_id` int(11) NOT NULL auto_increment,
|
||||||
`remote_server_name` varchar(100) NOT NULL,
|
`remote_server_name` varchar(100) NOT NULL,
|
||||||
`ogp_user` varchar(100) NOT NULL,
|
`ogp_user` varchar(100) NOT NULL,
|
||||||
|
|
@ -50,23 +49,15 @@ $install_queries[0] = array(
|
||||||
`ftp_port` int(11) NOT NULL,
|
`ftp_port` int(11) NOT NULL,
|
||||||
`encryption_key` varchar(50) NOT NULL,
|
`encryption_key` varchar(50) NOT NULL,
|
||||||
`timeout` int(11) NOT NULL,
|
`timeout` int(11) NOT NULL,
|
||||||
|
`use_nat` int(11) NOT NULL DEFAULT 0,
|
||||||
|
`ftp_ip` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`firewall_settings` LONGTEXT NULL,
|
||||||
|
`display_public_ip` varchar(255) NOT NULL DEFAULT '',
|
||||||
PRIMARY KEY (`remote_server_id`),
|
PRIMARY KEY (`remote_server_id`),
|
||||||
UNIQUE KEY `agent_ip` (`agent_ip`,`agent_port`)
|
UNIQUE KEY `agent_ip` (`agent_ip`,`agent_port`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Remote servers and IPs';");
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Remote servers and IPs';",
|
||||||
|
|
||||||
$install_queries[1] = array(
|
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."arrange_ports` (
|
||||||
"ALTER TABLE `".OGP_DB_PREFIX."remote_servers`
|
|
||||||
ADD `use_nat` int(11) NOT NULL;");
|
|
||||||
$install_queries[2] = array(
|
|
||||||
"ALTER TABLE `OGP_DB_PREFIXremote_servers`
|
|
||||||
ADD `ufw_status` CHAR(8);");
|
|
||||||
$install_queries[3] = array(
|
|
||||||
"ALTER TABLE `OGP_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` (
|
|
||||||
`range_id` int(11) NOT NULL auto_increment,
|
`range_id` int(11) NOT NULL auto_increment,
|
||||||
`ip_id` int(11) NOT NULL,
|
`ip_id` int(11) NOT NULL,
|
||||||
`home_cfg_id` int(11) NOT NULL,
|
`home_cfg_id` int(11) NOT NULL,
|
||||||
|
|
@ -75,20 +66,6 @@ $install_queries[4] = array(
|
||||||
`port_increment` smallint(11) unsigned NOT NULL,
|
`port_increment` smallint(11) unsigned NOT NULL,
|
||||||
PRIMARY KEY (`range_id`),
|
PRIMARY KEY (`range_id`),
|
||||||
UNIQUE KEY `ip_id` (`ip_id`,`home_cfg_id`)
|
UNIQUE KEY `ip_id` (`ip_id`,`home_cfg_id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Remote servers and IPs';");
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Remote servers and IPs';"
|
||||||
|
);
|
||||||
$install_queries[5] = array(
|
|
||||||
"ALTER TABLE `OGP_DB_PREFIXremote_servers`
|
|
||||||
DROP COLUMN `ufw_status`;",
|
|
||||||
"ALTER TABLE `OGP_DB_PREFIXremote_servers`
|
|
||||||
ADD `firewall_settings` LONGTEXT NULL;");
|
|
||||||
|
|
||||||
$install_queries[6] = array(
|
|
||||||
"ALTER TABLE `OGP_DB_PREFIXremote_servers`
|
|
||||||
ADD `display_public_ip` varchar(15) NOT NULL;");
|
|
||||||
|
|
||||||
$install_queries[7] = array(
|
|
||||||
"ALTER TABLE `OGP_DB_PREFIXremote_servers`
|
|
||||||
MODIFY `display_public_ip` varchar(255) NOT NULL;");
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue