SHARE
TWEET

Bgpanel minecraft config

a guest Aug 30th, 2014 273 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  3.  
  4. /**
  5.  * LICENSE:
  6.  * This program is free software: you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License as published by
  8.  * the Free Software Foundation, either version 3 of the License, or
  9.  * (at your option) any later version.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  *
  20.  * @categories  Games/Entertainment, Systems Administration
  21.  * @package             Bright Game Panel
  22.  * @author              warhawk3407 <warhawk3407@gmail.com> @NOSPAM
  23.  * @copyleft    2013
  24.  * @license             GNU General Public License version 3.0 (GPLv3)
  25.  * @version             (Release 0) DEVELOPER BETA 9
  26.  * @link                http://www.bgpanel.net/
  27.  */
  28.  
  29. function parse_properties($txtProperties) {
  30.         $result = array();
  31.        
  32.         $lines = explode("\n", $txtProperties);
  33.         $key = "";
  34.        
  35.         $isWaitingOtherLine = false;
  36.         foreach($lines as $i=>$line) {
  37.                 if(empty($line) || (!$isWaitingOtherLine && strpos($line,"#") === 0)) continue;
  38.        
  39.                 if(!$isWaitingOtherLine) {
  40.                         $key = substr($line,0,strpos($line,'='));
  41.                         $value = substr($line,strpos($line,'=') + 1, strlen($line));
  42.                 }else{
  43.                         $value .= $line;
  44.                 }
  45.  
  46.                 if(strrpos($value,"\\") === strlen($value)-strlen("\\")) {
  47.                         $value = substr($value, 0, strlen($value)-1)."\n";
  48.                         $isWaitingOtherLine = true;
  49.                 }else{
  50.                         $isWaitingOtherLine = false;
  51.                 }
  52.        
  53.                 $result[$key] = $value;
  54.                 unset($lines[$i]);
  55.         }
  56.        
  57.         return $result;
  58. }
  59.  
  60. $page = 'server';
  61. $tab = 2;
  62. $isSummary = FALSE;
  63.  
  64. if ( !isset($_GET['id']) || !is_numeric($_GET['id']) )
  65. {
  66.         header( 'Location: index.php' );
  67.         die();
  68. }
  69.  
  70. $return = 'mc_config.php';
  71.  
  72.  
  73. require("configuration.php");
  74. require("include.php");
  75. require("./libs/lgsl/lgsl_class.php");
  76.  
  77. require("./includes/func.ssh2.inc.php");
  78. require_once("./libs/phpseclib/Crypt/AES.php");
  79.  
  80.  
  81. $title = T_('Minecraft Configuration');
  82.  
  83. $serverid = mysql_real_escape_string($_GET['id']);
  84.  
  85.  
  86. if (query_numrows( "SELECT `name` FROM `".DBPREFIX."server` WHERE `serverid` = '".$serverid."'" ) == 0)
  87. {
  88.         exit('Error: ServerID is invalid.');
  89. }
  90.  
  91.  
  92. $rows = query_fetch_assoc( "SELECT * FROM `".DBPREFIX."server` WHERE `serverid` = '".$serverid."' LIMIT 1" );
  93. $serverIp = query_fetch_assoc( "SELECT `ip` FROM `".DBPREFIX."boxIp` WHERE `ipid` = '".$rows['ipid']."' LIMIT 1" );
  94. $box = query_fetch_assoc( "SELECT * FROM `".DBPREFIX."box` WHERE `boxid` = '".$rows['boxid']."' LIMIT 1" );
  95. $type = query_fetch_assoc( "SELECT `querytype` FROM `".DBPREFIX."game` WHERE `gameid` = '".$rows['gameid']."' LIMIT 1");
  96. $game = query_fetch_assoc( "SELECT `game` FROM `".DBPREFIX."game` WHERE `gameid` = '".$rows['gameid']."' LIMIT 1" );
  97. $group = query_fetch_assoc( "SELECT `name` FROM `".DBPREFIX."group` WHERE `groupid` = '".$rows['groupid']."' LIMIT 1" );
  98. $logs = mysql_query( "SELECT * FROM `".DBPREFIX."log` WHERE `serverid` = '".$serverid."' ORDER BY `logid` DESC LIMIT 15" );
  99.  
  100.  
  101. //---------------------------------------------------------+
  102.  
  103.  
  104. $checkGroup = checkClientGroup($rows['groupid'], $_SESSION['clientid']);
  105.  
  106. if ($checkGroup == FALSE)
  107. {
  108.         $_SESSION['msg1'] = T_('Error!');
  109.         $_SESSION['msg2'] = T_('This is not your server!');
  110.         $_SESSION['msg-type'] = 'error';
  111.         header( 'Location: index.php' );
  112.         die();
  113. }
  114.  
  115. if(strcmp($game['game'], "Minecraft") != 0)
  116. {
  117.         $_SESSION['msg1'] = T_('Error!');
  118.         $_SESSION['msg2'] = T_('This is not a minecraft server!');
  119.         $_SESSION['msg-type'] = 'error';
  120.         header( 'Location: index.php' );
  121.         die();
  122. }
  123.  
  124.  
  125. //---------------------------------------------------------+
  126.  
  127.  
  128. include("./bootstrap/header.php");
  129.  
  130.  
  131. /**
  132.  * Notifications
  133.  */
  134. include("./bootstrap/notifications.php");
  135.  
  136. require_once("./libs/phpseclib/SFTP.php");
  137.  
  138. $aes = new Crypt_AES();
  139. $aes->setKeyLength(256);
  140. $aes->setKey(CRYPT_KEY);
  141.  
  142. // Get SFTP
  143. $sftp = new Net_SFTP($box['ip'], $box['sshport']);
  144. if (!$sftp->login($box['login'], $aes->decrypt($box['password'])))
  145. {
  146.         $_SESSION['msg1'] = T_('Connection Error!');
  147.         $_SESSION['msg2'] = '';
  148.         $_SESSION['msg-type'] = 'error';
  149.         header( "Location: index.php");
  150.         die();
  151. }
  152.  
  153. $properties = $sftp->get(dirname($rows['path']) .'/server.properties');
  154. $sftp->disconnect();
  155.  
  156. $properties = parse_properties($properties);
  157.  
  158. $tutorials = array(
  159.         array(
  160.                 "title" => "allow-flight",
  161.                 "body" => "Allows users to use flight on your server while in Survival mode, if they have a mod that provides flight installed.<br />With allow-flight enabled griefers will possibly be more common, because it will make their work easier. In Creative mode this has no effect.<br /><ul><li>false - Flight is not allowed (players in air for at least 5 seconds will be kicked).</li><li><strong>true</strong> - Flight is allowed, and used if the player has a fly mod installed.</li></ul>",
  162.         ),
  163.         array(
  164.                 "title" => "allow-nether",
  165.                 "body" => "Allows players to travel to the Nether.<br /><ul><li><strong>false</strong> - Nether portals will not work.</li><li><strong>true</strong> - The server will allow portals to send players to the Nether.</li></ul>",
  166.         ),
  167.         array(
  168.                 "title" => "announce-player-achievements",
  169.                 "body" => "Allows server to announce when a player gets an achievement.",
  170.         ),
  171.         array(
  172.                 "title" => "difficulty",
  173.                 "body" => "Defines the difficulty (such as damage dealt by mobs and the way hunger and poison affects players) of the server.<br /><ul><li><strong>0</strong> - Peaceful</li><li><strong>1</strong> - Easy</li><li><strong>2</strong> - Normal</li><li><strong>3</strong> - Hard</li></ul>",
  174.         ),
  175.         array(
  176.                 "title" => "enable-query",
  177.                 "body" => "Enables GameSpy4 protocol server listener. Used to get information about server.<br/><strong>This setting can't be changed</strong>",
  178.         ),
  179.         array(
  180.                 "title" => "enable-rcon",
  181.                 "body" => "Enables remote access to the server console.<br /><strong>This setting can't be changed</strong>",
  182.         ),
  183.         array(
  184.                 "title" => "enable-command-block",
  185.                 "body" => "Enables command blocks",
  186.         ),
  187.         array(
  188.                 "title" => "force-gamemode",
  189.                 "body" => "Force players to join in the default game mode.<br /><ul><li><strong>false</strong> - Players will join in the gamemode they left in.</li><li><strong>true</strong> - Players will always join in the default gamemode.</li></ul>",
  190.         ),
  191.         array(
  192.                 "title" => "gamemode",
  193.                 "body" => "Defines the mode of gameplay.<br /><ul><li><strong>0</strong> - Survival</li><li><strong>1</strong> - Creative</li><li><strong>2</strong> - Adventure</li><li><strong>3</strong> - Spectator</li></ul>",
  194.         ),
  195.         array(
  196.                 "title" => "generate-structures",
  197.                 "body" => "Defines whether structures (such as villages) will be generated.<br /><ul><li><strong>false</strong> - Structures will not be generated in new chunks.</li><li><strong>true</strong> - Structures will be generated in new chunks.</li></ul><strong>Note: Dungeons and Nether Fortresses will still generate if this is set to false.</strong>",
  198.         ),
  199.         array(
  200.                 "title" => "generator-settings",
  201.                 "body" => "The settings used to customize Superflat world generation. See <a href=\"http://minecraft.gamepedia.com/Superflat\">Superflat</a> for possible settings and examples.",
  202.         ),
  203.         array(
  204.                 "title" => "hardcore",
  205.                 "body" => "If set to <strong>true</strong>, players will be permanently banned if they die.",
  206.         ),
  207.         array(
  208.                 "title" => "level-name",
  209.                 "body" => "The \"level-name\" value will be used as the world name and its folder name. You may also copy your saved game folder here, and change the name to the same as that folder's to load it instead.
  210. <ul><li>Characters such as ' (apostrophe) may need to be escaped by adding a backslash before them.</li></ul><br /><strong>This setting can't be changed</strong>",
  211.         ),
  212.         array(
  213.                 "title" => "level-seed",
  214.                 "body" => "Add a seed for your world, as in Singleplayer.<br/>Some examples are:<br /><ul><li>minecraft</li><li>404</li><li>1a2b3c</li><li>redstonepower</li></ul>",
  215.         ),
  216.         array(
  217.                 "title" => "level-type",
  218.                 "body" => "Determines the type of map that is generated.<br /><ul><li><strong>DEFAULT</strong> - Standard world with hills, valleys, water, etc.</li><li><strong>FLAT</strong> - A flat world with no features, meant for building.</li><li><strong>LARGEBIOMES</strong> - Same as default but all biomes are larger.</li><li><strong>AMPLIFIED</strong> - Same as default but world-generation height limit is increased.</li><li><strong>CUSTOMIZED</strong> - Since snapshot 14w21b, servers also support the custom terrain. First you have to generate a customized world in singleplayer and copy it to the server.</li></ul>",
  219.         ),
  220.         array(
  221.                 "title" => "max-build-height",
  222.                 "body" => "The maximum height in which building is allowed. Terrain may still naturally generate above a low height limit.",
  223.         ),
  224.         array(
  225.                 "title" => "max-players",
  226.                 "body" => "The maximum number of players that can play on the server at the same time. Note that if more players are on the server it will use more resources. Note also, op player connections are not supposed to count against the max players, but ops currently cannot join a full server. Extremely large values for this field result in the client-side user list being broken.<br /><strong>This setting can't be changed</strong>",
  227.         ),
  228.         array(
  229.                 "title" => "motd",
  230.                 "body" => "This is the message that is displayed in the server list of the client, below the name.<br /><ul><li>The MOTD does support <a href=\"http://minecraft.gamepedia.com/Formatting_codes\">color and formatting codes</a>.</li><li>If the MOTD is over 59 characters, the server list will likely report a communication error.</li></ul>",
  231.         ),
  232.         array(
  233.                 "title" => "online-mode",
  234.                 "body" => "Server checks connecting players against minecraft's account database. Only set this to false if your server is not connected to the Internet. Hackers with fake accounts can connect if this is set to false! If minecraft.net is down or inaccessible, no players will be able to connect if this is set to true. Setting this variable to off purposely is called \"cracking\" a server, and servers that are presently with online mode off are called \"cracked\" servers, allowing players with unlicensed copies of Minecraft to join.<ul><li><strong>true</strong> - Enabled. The server will assume it has an Internet connection and check every connecting player.</li><li><strong>false</strong> - Disabled. The server will not attempt to check connecting players.</li></ul><br /><strong>This setting can't be changed.</strong>",
  235.         ),
  236.         array(
  237.                 "title" => "op-permission-level",
  238.                 "body" => "Sets permission level for ops.<br /><ul><li><strong>1</strong> - Ops can bypass spawn protection.</li><li><strong>2</strong> - Ops can use /clear, /difficulty, /effect, /gamemode, /gamerule, /give, and /tp, and can edit command blocks.</li><li><strong>3</strong> - Ops can use /ban, /deop, /kick, and /op.</li><li><strong>4</strong> - Ops can use /stop.</li></ul>",
  239.         ),
  240.         array(
  241.                 "title" => "player-idle-timeout",
  242.                 "body" => "If non-zero, players are kicked from the server if they are idle for more than that many minutes.<br/><strong>Note:</strong> Idle time is reset when the server receives one of the following packets:<br /><ul><li>102 (0x66) WindowClick</li><li>108 (0x6c) ButtonClick</li><li>130 (0x82) UpdateSign</li><li>14 (0xe) BlockDig</li><li>15 (0xf) Place</li><li>16 (0x10) BlockItemSwitch</li><li>18 (0x12) ArmAnimation</li><li>19 (0x13) EntityAction</li><li>205 (0xcd) ClientCommand</li><li>3 (0x3) Chat</li><li>7 (0x7) UseEntity</li></ul>",
  243.         ),
  244.         array(
  245.                 "title" => "pvp",
  246.                 "body" => "Enable PvP on the server. Players shooting themselves with arrows will only receive damage if PvP is enabled.<br /><ul><li><strong>true</strong> - Players will be able to kill each other.</li><li><strong>false</strong> - Players cannot kill other players (also known as Player versus Environment (PvE)).</li></ul><strong>Note:</strong> Indirect damage sources spawned by players (such as lava, fire, TNT and to some extent water, sand and gravel) will still deal damage to other players.",
  247.         ),
  248.         array(
  249.                 "title" => "query.port",
  250.                 "body" => "Sets the port for the query server (see enable-query).<br /><strong>This setting can't be changed</strong>",
  251.         ),
  252.         array(
  253.                 "title" => "rcon.password",
  254.                 "body" => "Sets the password to rcon.<br /><strong>This setting can't be changed</strong>",
  255.         ),
  256.         array(
  257.                 "title" => "rcon.port",
  258.                 "body" => "Sets the port to rcon.<br /><strong>This setting can't be changed</strong>",
  259.         ),
  260.         array(
  261.                 "title" => "resource-pack",
  262.                 "body" => "No information available",
  263.         ),
  264.         array(
  265.                 "title" => "server-ip",
  266.                 "body" => "Set this if you want the server to bind to a particular IP. It is strongly recommended that you leave server-ip blank!<br />Set to blank, or the IP you want your server to run (listen) on.<br /><strong>This setting can't be changed</strong>",
  267.         ),
  268.         array(
  269.                 "title" => "server-name",
  270.                 "body" => "The name of your server.",
  271.         ),
  272.         array(
  273.                 "title" => "server-port",
  274.                 "body" => "Changes the port the server is hosting (listening) on. This port must be forwarded if the server is hosted in a network using NAT (If you have a home router/firewall).<br /><strong>This setting can't be changed</strong>",
  275.         ),
  276.         array(
  277.                 "title" => "snooper-enabled",
  278.                 "body" => "Sets whether the server sends snoop data regularly to http://snoop.minecraft.net.<br /><ul><li><strong>false</strong> - disable snooping.</li><li><strong>true</strong> - enable snooping.</li></ul><br /><strong>This setting can't be changed</strong>",
  279.         ),
  280.         array(
  281.                 "title" => "spawn-animals",
  282.                 "body" => "Determines if animals will be able to spawn.<br /><li><strong>true</strong> - Animals spawn as normal.</li><li><strong>false</strong> - Animals will immediately vanish.</li></ul><br /><strong>Tip:</strong> if you have major lag, turn this off/set to false.",
  283.         ),
  284.         array(
  285.                 "title" => "spawn-monsters",
  286.                 "body" => "Determines if monsters will be spawned.<br /><ul><li><strong>true</strong> - Enabled. Monsters will appear at night and in the dark.</li><li><strong>false</strong> - Disabled. No monsters.</li></ul><br />This does nothing if difficulty = 0 (peaceful) Unless your difficulty is not set to 0, when a monster can still spawn from a Monster Spawner.<br /><strong>Tip</strong>: if you have major lag, turn this off/set to false.",
  287.         ),
  288.         array(
  289.                 "title" => "spawn-npcs",
  290.                 "body" => "Determines if villagers will be spawned.<br /><ul><li><strong>true</strong> - Enabled. Villagers will spawn.</li><li><strong>false</strong> - Disabled. No villagers.</li></ul>",
  291.         ),
  292.         array(
  293.                 "title" => "spawn-protection",
  294.                 "body" => "Determines the radius of the spawn protection. Setting this to 0 will not disable spawn protection. 0 will protect the single block at the spawn point. 1 will protect a 3x3 area centered on the spawn point. 2 will protect 5x5, 3 will protect 7x7, etc. This option is not generated on the first server start and appears when the first player joins. If there are no ops set on the server, the spawn protection will be disabled automatically.",
  295.         ),
  296.         array(
  297.                 "title" => "view-distance",
  298.                 "body" => "Sets the amount of world data the server sends the client, measured in chunks in each direction of the player (radius, not diameter). It determines the server-side viewing distance. The \"Far\" viewing distance is 16 chunks, sending 1089 total chunks (the amount of chunks that the server will load can be seen in the debug screen). \"Normal\" view distance is 8, for 289 chunks.<br/>10 is the default/recommended. If you have major lag, reduce this value.",
  299.         ),
  300.         array(
  301.                 "title" => "white-list",
  302.                 "body" => "Enables a whitelist on the server.<br />
  303. With a whitelist enabled, users not on the whitelist will be unable to connect. Intended for private servers, such as those for real-life friends or strangers carefully selected via an application process, for example.<br /><ul><li><strong>false</strong> - No white list is used.</li><li><strong>true</strong> - The file white-list.txt is used to generate the white list.</li></ul><strong>Note</strong>: Ops are automatically white listed, and there is no need to add them to the whitelist.",
  304.         ),
  305. );
  306.  
  307. foreach($tutorials as $key => $value)
  308. {
  309. ?>
  310. <div class="modal fade" id="<?php echo str_replace("-", "", $value['title']); ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  311.   <div class="modal-dialog">
  312.     <div class="modal-content">
  313.       <div class="modal-header">
  314.         <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only"></span></button>
  315.         <h4 class="modal-title" id="myModalLabel"><?php echo $value['title']; ?></h4>
  316.       </div>
  317.       <div class="modal-body">
  318.       <?php echo $value['body']; ?>
  319.       </div>
  320.       <div class="modal-footer">
  321.         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  322.       </div>
  323.     </div>
  324.   </div>
  325. </div>
  326. <?php } ?>
  327.                         <div class="tabbable">
  328.                                 <ul class="nav nav-tabs">
  329.                                         <li <?php if(!isset($_GET['task']) || empty($_GET['task']) || strcmp($_GET['task'], "plugin") != 0){ ?>class="active"<?php }?>><a href="#1" data-toggle="tab"><?php echo T_('Basic Config'); ?></a></li>
  330.                                         <li <?php if(isset($_GET['task']) && !empty($_GET['task']) && strcmp($_GET['task'], "plugin") == 0){ ?>class="active"<?php }?>><a href="#2" data-toggle="tab"><?php echo T_('Plugin Config'); ?></a></li>
  331.                                 </ul>
  332.  
  333.                                 <div class="tab-content">
  334.                                         <div class="tab-pane <?php if(!isset($_GET['task']) || empty($_GET['task']) || strcmp($_GET['task'], "plugin") != 0){ ?>active<?php } ?>" id="1">
  335.                                                 <div class="row-fluid">
  336.                                                         <div class="span6">
  337.                                                                 <div class="well">
  338.                                                                         <div style="text-align: center; margin-bottom: 5px;">
  339.                                                                                 <span class="label label-info"><?php echo T_('Minecraft Configuration'); ?></span>
  340.                                                                         </div>
  341.                                                                         <table class="table table-striped table-bordered table-condensed">
  342.                                    
  343.                                     <tr>
  344.                                             <td>server-name <a href="#" data-toggle="modal" data-target="#servername"><span class="icon icon-question-sign"></span></a></td>
  345.                                         <td><input name="server-name" type="text" value="<?php echo $properties['server-name']; ?>" /></td>
  346.                                     </tr>    
  347.                                    
  348.                                     <tr>
  349.                                             <td>motd <a href="#" data-toggle="modal" data-target="#motd"><span class="icon icon-question-sign"></span></a></td>
  350.                                         <td><input name="motd" type="text" value="<?php echo $properties['motd']; ?>" /></td>
  351.                                     </tr>
  352.                                     <tr>
  353.                                             <td>hardcore <a href="#" data-toggle="modal" data-target="#hardcore"><span class="icon icon-question-sign"></span></a></td>
  354.                                         <td><select name="hardcore">
  355.                                                 <option <?php echo ($properties['hardcore'] == "true") ? "selected" : ""; ?> value="true">true</option>
  356.                                                 <option <?php echo ($properties['hardcore'] == "false") ? "selected" : ""; ?> value="false">false</option>
  357.                                             </select></td>
  358.                                     </tr>                                
  359.                                     <tr>
  360.                                             <td>difficulty <a href="#" data-toggle="modal" data-target="#difficulty"><span class="icon icon-question-sign"></span></a></td>
  361.                                         <td><select name="difficulty">
  362.                                         <option <?php echo ($properties['difficulty'] == "0") ? "selected" : ""; ?> value="0">Peaceful</option>
  363.                                         <option <?php echo ($properties['difficulty'] == "1") ? "selected" : ""; ?> value="1">Easy</option>
  364.                                         <option <?php echo ($properties['difficulty'] == "2") ? "selected" : ""; ?> value="2">Normal</option>
  365.                                         <option <?php echo ($properties['difficulty'] == "3") ? "selected" : ""; ?> value="3">Hard</option>
  366.                                         </select></td>
  367.                                     </tr>  
  368.                                     <tr>
  369.                                             <td>gamemode <a href="#" data-toggle="modal" data-target="#gamemode"><span class="icon icon-question-sign"></span></a></td>
  370.                                         <td><select name="difficulty">
  371.                                         <option <?php echo ($properties['gamemode'] == "0") ? "selected" : ""; ?> value="0">Survival</option>
  372.                                         <option <?php echo ($properties['gamemode'] == "1") ? "selected" : ""; ?> value="1">Creative</option>
  373.                                         <option <?php echo ($properties['gamemode'] == "2") ? "selected" : ""; ?> value="2">Adventure</option>
  374.                                         <option <?php echo ($properties['gamemode'] == "3") ? "selected" : ""; ?> value="3">Spectator</option>
  375.                                         </select></td>
  376.                                     </tr>
  377.                                     <tr>
  378.                                             <td>level-seed <a href="#" data-toggle="modal" data-target="#levelseed"><span class="icon icon-question-sign"></span></a></td>
  379.                                         <td><input name="level-seed" type="text" value="<?php echo $properties['level-seed']; ?>" /></td>
  380.                                     </tr>
  381.                                     <tr>
  382.                                             <td>level-type <a href="#" data-toggle="modal" data-target="#leveltype"><span class="icon icon-question-sign"></span></a></td>
  383.                                         <td><select name="level-type">
  384.                                                 <option <?php echo ($properties['level-type'] == "DEFAULT") ? "selected" : ""; ?> value="DEFAULT">default</option>
  385.                                                 <option <?php echo ($properties['level-type'] == "FLAT") ? "selected" : ""; ?> value="FLAT">flat</option>
  386.                                                 <option <?php echo ($properties['level-type'] == "LARGEBIOMES") ? "selected" : ""; ?> value="LARGEBIOMES">large biomes</option>
  387.                                                 <option <?php echo ($properties['level-type'] == "AMPLIFIED") ? "selected" : ""; ?> value="AMPLIFIED">amplified</option>
  388.                                                 <option <?php echo ($properties['level-type'] == "CUSTOMIZED") ? "selected" : ""; ?> value="CUSTOMIZED">customized</option>
  389.                                             </select></td>
  390.                                     </tr>
  391.                                     <tr>
  392.                                             <td>allow-flight <a href="#" data-toggle="modal" data-target="#allowflight"><span class="icon icon-question-sign"></span></a></td>
  393.                                         <td>
  394.                                                 <select name="allow-flight">
  395.                                                 <option <?php echo ($properties['allow-flight'] == "true") ? "selected" : ""; ?> value="true">true</option>
  396.                                                 <option <?php echo ($properties['allow-flight'] == "false") ? "selected" : ""; ?> value="false">false</option>
  397.                                             </select>
  398.                                         </td>
  399.                                     </tr>
  400.                                    
  401.                                     <tr>
  402.                                             <td>allow-nether <a href="#" data-toggle="modal" data-target="#allownether"><span class="icon icon-question-sign"></span></a></td>
  403.                                         <td>
  404.                                                                                         <select name="allow-nether">
  405.                                                 <option <?php echo ($properties['allow-nether'] == "true") ? "selected" : ""; ?> value="true">true</option>
  406.                                                 <option <?php echo ($properties['allow-nether'] == "false") ? "selected" : ""; ?> value="false">false</option>
  407.                                             </select></td>
  408.                                     </tr>
  409.                                    
  410.                                     <tr>
  411.                                             <td>announce-player-achievements <a href="#" data-toggle="modal" data-target="#announceplayerachievements"><span class="icon icon-question-sign"></span></a></td>
  412.                                         <td>
  413.                                                                                         <select name="announce-player-achievements">
  414.                                                 <option <?php echo ($properties['announce-player-achievements'] == "true") ? "selected" : ""; ?> value="true">true</option>
  415.                                                 <option <?php echo ($properties['announce-player-achievements'] == "false") ? "selected" : ""; ?> value="false">false</option>
  416.                                             </select></td>
  417.                                     </tr>                                
  418.                                     <tr>
  419.                                             <td>enable-command-block <a href="#" data-toggle="modal" data-target="#enablecommandblock"><span class="icon icon-question-sign"></span></a></td>
  420.                                         <td>
  421.                                                                                         <select name="enable-command-block">
  422.                                                 <option <?php echo ($properties['enable-command-block'] == "true") ? "selected" : ""; ?> value="true">true</option>
  423.                                                 <option <?php echo ($properties['enable-command-block'] == "false") ? "selected" : ""; ?> value="false">false</option>
  424.                                             </select></td>
  425.                                     </tr>
  426.                                    
  427.                                     <tr>
  428.                                             <td>force-gamemode <a href="#" data-toggle="modal" data-target="#forcegamemode"><span class="icon icon-question-sign"></span></a></td>
  429.                                         <td><select name="force-gamemode">
  430.                                                 <option <?php echo ($properties['force-gamemode'] == "true") ? "selected" : ""; ?> value="true">true</option>
  431.                                                 <option <?php echo ($properties['force-gamemode'] == "false") ? "selected" : ""; ?> value="false">false</option>
  432.                                             </select>
  433.                                         </td>
  434.                                     </tr>
  435.                                     <tr>
  436.                                             <td>generate-structures <a href="#" data-toggle="modal" data-target="#generatestructures"><span class="icon icon-question-sign"></span></a></td>
  437.                                         <td>
  438.                                                                                         <select name="generate-structures">
  439.                                                 <option <?php echo ($properties['generate-structures'] == "true") ? "selected" : ""; ?> value="true">true</option>
  440.                                                 <option <?php echo ($properties['generate-structures'] == "false") ? "selected" : ""; ?> value="false">false</option>
  441.                                             </select>
  442.                                         </td>
  443.                                     </tr>
  444.                                     <tr>
  445.                                             <td>generator-settings <a href="#" data-toggle="modal" data-target="#generatorsettings"><span class="icon icon-question-sign"></span></a></td>
  446.                                         <td><input name="generator-settings" type="text" maxlength="256" value="<?php echo $properties['generator-settings']; ?>" /></td>
  447.                                     </tr>
  448.                                     <tr>
  449.                                             <td>max-build-height <a href="#" data-toggle="modal" data-target="#maxbuildheight"><span class="icon icon-question-sign"></span></a></td>
  450.                                         <td><input name="max-build-height" type="number" max="256" value="<?php echo $properties['max-build-height']; ?>" /></td>
  451.                                     </tr>
  452.                                     <tr>
  453.                                             <td>online-mode <a href="#" data-toggle="modal" data-target="#onlinemode"><span class="icon icon-question-sign"></span></a></td>
  454.                                         <td><select name="online-mode" disabled>
  455.                                                 <option <?php echo ($properties['online-mode'] == "true") ? "selected" : ""; ?> value="true">true</option>
  456.                                                 <option <?php echo ($properties['online-mode'] == "false") ? "selected" : ""; ?> value="false">false</option>
  457.                                             </select></td>
  458.                                     </tr>
  459.                                     <tr>
  460.                                             <td>op-permission-level <a href="#" data-toggle="modal" data-target="#oppermissionlevel"><span class="icon icon-question-sign"></span></a></td>
  461.                                         <td><select name="op-permission-level">
  462.                                                 <option <?php echo ($properties['op-permission-level'] == "1") ? "selected" : ""; ?> value="1">Ops can bypass spawn protection.</option>
  463.                                                 <option <?php echo ($properties['op-permission-level'] == "2") ? "selected" : ""; ?> value="2">Ops can use /clear, /difficulty, /effect, /gamemode, /gamerule, /give, and /tp, and can edit command blocks.</option>
  464.                                                 <option <?php echo ($properties['op-permission-level'] == "3") ? "selected" : ""; ?> value="3">Ops can use /ban, /deop, /kick, and /op.</option>
  465.                                                 <option <?php echo ($properties['op-permission-level'] == "4") ? "selected" : ""; ?> value="4">Ops can use /stop.</option>
  466.                                             </select></td>
  467.                                     </tr>
  468.                                     <tr>
  469.                                             <td>player-idle-timeout <a href="#" data-toggle="modal" data-target="#playeridletimeout"><span class="icon icon-question-sign"></span></a></td>
  470.                                         <td><input name="max-build-height" type="number" max="60" value="<?php echo $properties['player-idle-timeout']; ?>" /></td>
  471.                                     </tr>
  472.                                     <tr>
  473.                                             <td>pvp <a href="#" data-toggle="modal" data-target="#pvp"><span class="icon icon-question-sign"></span></a></td>
  474.                                         <td><select name="pvp">
  475.                                                 <option <?php echo ($properties['pvp'] == "true") ? "selected" : ""; ?> value="true">true</option>
  476.                                                 <option <?php echo ($properties['pvp'] == "false") ? "selected" : ""; ?> value="false">false</option>
  477.                                             </select></td>
  478.                                     </tr>
  479.                                     <tr>
  480.                                             <td>spawn-animals <a href="#" data-toggle="modal" data-target="#spawnanimals"><span class="icon icon-question-sign"></span></a></td>
  481.                                         <td><select name="spawn-animals">
  482.                                                 <option <?php echo ($properties['spawn-animals'] == "true") ? "selected" : ""; ?> value="true">true</option>
  483.                                                 <option <?php echo ($properties['spawn-animals'] == "false") ? "selected" : ""; ?> value="false">false</option>
  484.                                             </select></td>
  485.                                     </tr>
  486.                                     <tr>
  487.                                             <td>spawn-monsters <a href="#" data-toggle="modal" data-target="#spawnmonsters"><span class="icon icon-question-sign"></span></a></td>
  488.                                         <td><select name="spawn-monsters">
  489.                                                 <option <?php echo ($properties['spawn-monsters'] == "true") ? "selected" : ""; ?> value="true">true</option>
  490.                                                 <option <?php echo ($properties['spawn-monsters'] == "false") ? "selected" : ""; ?> value="false">false</option>
  491.                                             </select></td>
  492.                                     </tr>
  493.                                     <tr>
  494.                                             <td>spawn-npcs <a href="#" data-toggle="modal" data-target="#spawnnpcs"><span class="icon icon-question-sign"></span></a></td>
  495.                                         <td><select name="spawn-npcs">
  496.                                                 <option <?php echo ($properties['spawn-npcs'] == "true") ? "selected" : ""; ?> value="true">true</option>
  497.                                                 <option <?php echo ($properties['spawn-npcs'] == "false") ? "selected" : ""; ?> value="false">false</option>
  498.                                             </select></td>
  499.                                     </tr>
  500.                                     <tr>
  501.                                             <td>spawn-protection <a href="#" data-toggle="modal" data-target="#spawnprotection"><span class="icon icon-question-sign"></span></a></td>
  502.                                         <td><input name="spawn-protection" type="number" max="128" value="<?php echo $properties['spawn-protection']; ?>" /></td>
  503.                                     </tr>
  504.                                     <tr>
  505.                                             <td>view-distance <a href="#" data-toggle="modal" data-target="#viewdistance"><span class="icon icon-question-sign"></span></a></td>
  506.                                         <td><input name="view-distance" type="number" max="128" value="<?php echo $properties['view-distance']; ?>" /></td>
  507.                                     </tr>
  508.                                     <tr>
  509.                                             <td>white-list <a href="#" data-toggle="modal" data-target="#whitelist"><span class="icon icon-question-sign"></span></a></td>
  510.                                         <td><select name="white-list">
  511.                                                 <option <?php echo ($properties['white-list'] == "true") ? "selected" : ""; ?> value="true">true</option>
  512.                                                 <option <?php echo ($properties['white-list'] == "false") ? "selected" : ""; ?> value="false">false</option>
  513.                                             </select></td>
  514.                                     </tr>
  515.                                     </table>
  516.                                     </div>
  517.                                     </div>
  518.                              <div class="span6">
  519.                                                                 <div class="well">
  520.                                                                         <div style="text-align: center; margin-bottom: 5px;">
  521.                                                                                 <span class="label label-info"><?php echo T_('Uneditable Minecraft Configurations'); ?></span>
  522.                                                                         </div>
  523.                                                                         <table class="table table-striped table-bordered table-condensed">
  524.                                    
  525.                                     <tr>
  526.                                             <td>level-name <a href="#" data-toggle="modal" data-target="#levelname"><span class="icon icon-question-sign"></span></a></td>
  527.                                         <td><?php echo $properties['level-name']; ?></td>
  528.                                     </tr>
  529.                                     <tr>
  530.                                             <td>enable-query <a href="#" data-toggle="modal" data-target="#enablequery"><span class="icon icon-question-sign"></span></a></td>
  531.                                         <td><?php echo $properties['enable-query']; ?></td>
  532.                                     </tr>
  533.                                    
  534.                                     <tr>
  535.                                             <td>enable-rcon <a href="#" data-toggle="modal" data-target="#enable-rcon"><span class="icon icon-question-sign"></span></a></td>
  536.                                         <td><?php echo $properties['enable-rcon']; ?></td>
  537.                                     </tr>
  538.                                     <tr>
  539.                                             <td>query.port <a href="#" data-toggle="modal" data-target="#queryport"><span class="icon icon-question-sign"></span></a></td>
  540.                                         <td><?php echo $properties['query.port']; ?></td>
  541.                                     </tr>
  542.                                     <tr>
  543.                                             <td>rcon.password <a href="#" data-toggle="modal" data-target="#rcon.password"><span class="icon icon-question-sign"></span></a></td>
  544.                                         <td><?php echo $properties['rcon.password']; ?></td>
  545.                                     </tr>
  546.                                     <tr>
  547.                                             <td>rcon.port <a href="#" data-toggle="modal" data-target="#rconport"><span class="icon icon-question-sign"></span></a></td>
  548.                                         <td><?php echo $properties['rcon.port']; ?></td>
  549.                                     </tr>
  550.                                     <tr>
  551.                                             <td>resource-pack <a href="#" data-toggle="modal" data-target="#resourcepack"><span class="icon icon-question-sign"></span></a></td>
  552.                                         <td><?php echo $properties['resource-pack']; ?></td>
  553.                                     </tr>
  554.                                     <tr>
  555.                                             <td>server-ip <a href="#" data-toggle="modal" data-target="#serverip"><span class="icon icon-question-sign"></span></a></td>
  556.                                         <td><?php echo $properties['server-ip']; ?></td>
  557.                                     </tr>
  558.                                     <tr>
  559.                                             <td>server-port <a href="#" data-toggle="modal" data-target="#serverport"><span class="icon icon-question-sign"></span></a></td>
  560.                                         <td><?php echo $properties['server-port']; ?></td>
  561.                                     </tr>
  562.                                     <tr>
  563.                                             <td>snooper-enabled <a href="#" data-toggle="modal" data-target="#snooperenabled"><span class="icon icon-question-sign"></span></a></td>
  564.                                         <td><?php echo $properties['snooper-enabled']; ?></td>
  565.                                     </tr>
  566.                                                                         </table>
  567.                                                                 </div>
  568.                                                         </div>
  569.                                                 </div>
  570.                                         </div>
  571.                     <div class="tab-pane <?php if(isset($_GET['s']) && !empty($_GET['s'])){ ?>active<?php } ?>" id="2">
  572.                                                 <div class="row">
  573.                                                         <div class="span6 offset3">
  574.                                                                 <div class="well">
  575. <?php
  576. if(isset($_GET['s']) && !empty($_GET['s']))
  577. {
  578.         $ch = curl_init();
  579.         curl_setopt($ch, CURLOPT_URL,"http://api.bukget.org/3/search/plugin_name/like/".$_GET['s']."?fields=plugin_name,versions,slug");
  580.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  581.         curl_setopt($ch, CURLOPT_USERAGENT, 'RedstonePower (BGP custom)');
  582.         $server_output = curl_exec($ch);
  583.                                
  584.         curl_close ($ch);      
  585.         $info = json_decode($server_output, true);
  586. ?>
  587.                                                                         <div style="text-align: center; margin-bottom: 5px;">
  588.                                                                                 <span class="label label-info">Search plugins</span>
  589.                                      </div>
  590. <table class="table table-bordered">
  591. <?php
  592.         foreach($info as $key => $value)
  593.         {
  594.                 if(!(preg_match("@CB 1\.7\.[9,10]-(.*?)@", $value['versions'][0]['game_versions'][0]) == 1) && isset($_GET['comp'])) continue;
  595. ?>
  596.         <tr>
  597.                 <td>
  598.                         <div style="text-align: center;"><a href="http://dev.bukkit.org/bukkit-plugins/<?php echo $value['slug']; ?>/"><?php echo $value['plugin_name']; ?></a></div>
  599.                 </td>
  600.         <td>
  601.                         <div style="text-align: center;"><span class="label <?php if(!(preg_match("@CB 1\.7\.[9,10]-(.*?)@", $value['versions'][0]['game_versions'][0]) == 1)) { echo "label-warning"; }else{ echo "label-success"; } ?>"><?php echo $value['versions'][0]['game_versions'][0]; ?></span></div>
  602.         </td>
  603. <?php
  604.         if(preg_match("@CB 1\.7\.[9,10]-(.*?)@", $value['versions'][0]['game_versions'][0]) == 1)
  605.         {
  606.                 if(in_array($value['versions'][0]['filename'], $plugins['name']))
  607.                 {
  608.                         echo "<td><div style=\"text-align: center;\"><span class=\"label label-info\">Already installed</span></div></td>";
  609.                 }else{
  610.                         echo "<td><div style=\"text-align: center;\"><a href=\"serverprocess.php?task=addBukkitPlug&serverid=".$serverid."&id=".$value['slug']."\" title=\"Install ".$value['plugin_name']."\"><span class=\"icon icon-ok\"></span></a></div></td>";
  611.                 }
  612.         }else{
  613. ?>
  614.         <td><div style="text-align: center;"><span class="label label-warning" title="There is no version available for your version of bukkit">Not compatible</span></div></td>
  615. <?php  
  616.         }
  617. ?>
  618.        
  619.         </tr>
  620. <?php
  621.         }
  622. ?>
  623. </table>
  624. <?php
  625. }else{
  626. ?>
  627.                                                                         <div style="text-align: center; margin-bottom: 5px;">
  628.                                                                                 <span class="label label-info">Installed</span>
  629.                                      </div>
  630. <table class="table table-bordered">
  631. <?php  
  632.                 if(empty($plugins) && sizeof($plugins) == 0)
  633.                 {
  634. ?>
  635.         <tr>
  636.                 <td>
  637.                         <div style="text-align: center;"><span class="label label-warning"><?php echo T_('No plugins installed'); ?></span></div>
  638.                 </td>
  639.         </tr>
  640. <?php
  641.                 }else{
  642.                         foreach($plugins['info'] as $name)
  643.                         {
  644. ?>
  645.         <tr>
  646.                 <td>
  647.                         <div style="text-align: center;"><a href="http://dev.bukkit.org/bukkit-plugins/<?php echo $name['slug']; ?>/"><?php echo $name['plugin_name']; ?></a></div>
  648.                 </td>
  649.         <td>
  650.                         <div style="text-align: center;"><span class="label <?php if(!(preg_match("@CB 1\.7\.[9,10]-(.*?)@", $name['versions'][0]['game_versions'][0]) == 1)) { echo "label-warning"; }else{ echo "label-success"; } ?>"><?php echo $name['versions'][0]['game_versions'][0]; ?></span></div>
  651.         </td>
  652.         <td>
  653.                         <div style="text-align: center;">
  654.                 <a href="serverprocess.php?task=rmBukkitPlug&serverid=<?php echo $serverid; ?>&id=<?php echo $name['slug']; ?>" title="Remove <?php echo $name['plugin_name']; ?>"><span class="icon icon-remove"></span></a>
  655.                 <a href="mc_config.php?task=plugin&serverid=<?php echo $serverid; ?>&id=<?php echo $name['slug']; ?>" title="Configure <?php echo $name['plugin_name']; ?>"><span class="icon icon-cog"></span></a>
  656.             </div>
  657.         </td>
  658.         </tr>
  659. <?php
  660.                         }
  661.                 }
  662.  
  663.                 $sftp->disconnect();
  664. ?>
  665. </table>
  666.                                                                         <div style="text-align: center; margin-bottom: 5px;">
  667.                                                                                 <span class="label label-success">15 Popular plugins this Month</span>
  668.                                      </div>
  669. <table class="table table-bordered">
  670. <?php
  671. $ch = curl_init();
  672. curl_setopt($ch, CURLOPT_URL,"http://api.bukget.org/3/plugins?size=15&sort=popularity.monthly&fields=plugin_name,versions,slug");
  673. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  674. curl_setopt($ch, CURLOPT_USERAGENT, 'RedstonePower (BGP custom)');
  675. $server_output = curl_exec($ch);
  676.                                
  677. curl_close ($ch);      
  678.                        
  679. $info = json_decode($server_output, true);
  680. foreach($info as $key => $value)
  681. {
  682.         echo "<tr><td><div style=\"text-align: center;\"><a href=\"http://dev.bukkit.org/bukkit-plugins/".$value['slug']."\">".$value['plugin_name'] . "</a></div></td>";
  683.         echo "<td><div style=\"text-align: center;\">".$value['versions'][0]['game_versions'][0]."</div></td>";
  684.         if((preg_match("@CB 1\.7\.[9,10]-(.*?)@", $value['versions'][0]['game_versions'][0]) == 1))
  685.         {
  686.                 if(in_array($value['versions'][0]['filename'], $plugins['name']))
  687.                 {
  688.                         echo "<td><div style=\"text-align: center;\"><span class=\"label label-info\">Already installed</span></div></td>";
  689.                 }else{
  690.                         echo "<td><div style=\"text-align: center;\"><a href=\"serverprocess.php?task=addBukkitPlug&serverid=".$serverid."&id=".$value['slug']."\" title=\"Install ".$value['plugin_name']."\"><span class=\"icon icon-ok\"></span></a></div></td>";
  691.                 }
  692.         }else{
  693.                 echo "<td><div style=\"text-align: center;\"><span class=\"label label-warning\" title=\"There is no version available for your version of bukkit\">Not compatible</span></div></td>";
  694.         }
  695.         echo "</tr>";
  696. }
  697. ?>
  698. </table>
  699. <?php } ?>
  700.                                                                         <div style="text-align: center; margin-bottom: 5px;">
  701.                                                                                 <span class="label label-info">Search</span>
  702.                                      </div>
  703. <table class="table table-bordered">
  704. <form method="get">
  705. <input type="hidden" name="id" value="<?php echo $serverid; ?>" />
  706.         <tr>
  707.         <td><input type="text" name="s" placeholder="Search.." value="<?php echo (isset($_GET['s'])) ? htmlentities($_GET['s']) : ""; ?>" /></td>
  708.         <td>Only compatible: <input type="checkbox" name="comp" <?php if(isset($_GET['comp'])){ ?>checked<?php } ?> /></td>
  709.         <td><input type="submit" value="Search" /></td>
  710.     </tr>
  711. </form>
  712. </table>
  713.                                                                 </div>
  714.                                                         </div>
  715.                                                 </div>
  716.                                         </div>
  717.                    
  718.                                 </div>
  719.                         </div>
  720.                         <div style="text-align: center;">
  721.                                 <ul class="pager">
  722.                                         <li>
  723.                                                 <a href="index.php"><?php echo T_('Back to Home'); ?></a>
  724.                                         </li>
  725.                                 </ul>
  726.                         </div>
  727.                         <script>
  728.                         function dlScrLog()
  729.                         {
  730.                                 if (confirm("<?php echo T_('Download SCREENLOG ?'); ?>"))
  731.                                 {
  732.                                         window.location.href='serverprocess.php?task=getserverlog&serverid=<?php echo $serverid; ?>';
  733.                                 }
  734.                         }
  735.                         </script>
  736. <?php
  737.  
  738.  
  739. include("./bootstrap/footer.php");
  740. ?>
RAW Paste Data
Pastebin PRO Summer Special!
Get 60% OFF on Pastebin PRO accounts!
Top