module.php 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /*
  3. *
  4. * OGP - Open Game Panel
  5. * Copyright (C) 2008 - 2018 The OGP Development Team
  6. *
  7. * http://www.opengamepanel.org/
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  22. *
  23. */
  24. // Module general information
  25. $module_title = "Server manager";
  26. $module_version = "1.6.1";
  27. $db_version = 7;
  28. $module_required = TRUE;
  29. $module_menus = array(
  30. array( 'subpage' => '', 'name'=>'Servers', 'group'=>'admin' )
  31. );
  32. $install_queries = array();
  33. $install_queries[0] = array(
  34. "DROP TABLE IF EXISTS `".OGP_DB_PREFIX."remote_server_ips`;",
  35. "CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."remote_server_ips` (
  36. `ip_id` int(11) NOT NULL AUTO_INCREMENT,
  37. `remote_server_id` int(11) NOT NULL,
  38. `ip` varchar(255) NOT NULL,
  39. PRIMARY KEY (`ip_id`)
  40. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;",
  41. "DROP TABLE IF EXISTS `".OGP_DB_PREFIX."remote_servers`;",
  42. "CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."remote_servers` (
  43. `remote_server_id` int(11) NOT NULL auto_increment,
  44. `remote_server_name` varchar(100) NOT NULL,
  45. `ogp_user` varchar(100) NOT NULL,
  46. `agent_ip` varchar(255) NOT NULL,
  47. `agent_port` int(11) NOT NULL,
  48. `ftp_port` int(11) NOT NULL,
  49. `encryption_key` varchar(50) NOT NULL,
  50. `timeout` int(11) NOT NULL,
  51. PRIMARY KEY (`remote_server_id`),
  52. UNIQUE KEY `agent_ip` (`agent_ip`,`agent_port`)
  53. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='Remote servers and IPs';");
  54. $install_queries[1] = array(
  55. "ALTER TABLE `".OGP_DB_PREFIX."remote_servers`
  56. ADD `use_nat` int(11) NOT NULL;");
  57. $install_queries[2] = array(
  58. "ALTER TABLE `OGP_DB_PREFIXremote_servers`
  59. ADD `ufw_status` CHAR(8);");
  60. $install_queries[3] = array(
  61. "ALTER TABLE `OGP_DB_PREFIXremote_servers`
  62. ADD `ftp_ip` varchar(255) NOT NULL;");
  63. $install_queries[4] = array(
  64. "DROP TABLE IF EXISTS `".OGP_DB_PREFIX."arrange_ports`;",
  65. "CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."arrange_ports` (
  66. `range_id` int(11) NOT NULL auto_increment,
  67. `ip_id` int(11) NOT NULL,
  68. `home_cfg_id` int(11) NOT NULL,
  69. `start_port` smallint(11) unsigned NOT NULL,
  70. `end_port` smallint(11) unsigned NOT NULL,
  71. `port_increment` smallint(11) unsigned NOT NULL,
  72. PRIMARY KEY (`range_id`),
  73. UNIQUE KEY `ip_id` (`ip_id`,`home_cfg_id`)
  74. ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COMMENT='Remote servers and IPs';");
  75. $install_queries[5] = array(
  76. "ALTER TABLE `OGP_DB_PREFIXremote_servers`
  77. DROP COLUMN `ufw_status`;",
  78. "ALTER TABLE `OGP_DB_PREFIXremote_servers`
  79. ADD `firewall_settings` LONGTEXT NULL;");
  80. $install_queries[6] = array(
  81. "ALTER TABLE `OGP_DB_PREFIXremote_servers`
  82. ADD `display_public_ip` varchar(15) NOT NULL;");
  83. $install_queries[7] = array(
  84. "ALTER TABLE `OGP_DB_PREFIXremote_servers`
  85. MODIFY `display_public_ip` varchar(255) NOT NULL;");
  86. ?>