if (query_numrows("SELECT `name` FROM `" . DBPREFIX . "box` WHERE `boxid` = '" . $boxid . "'") == 0) { exit('Error: BoxID is invalid.'); } $rows = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "box` WHERE `boxid` = '" . $boxid . "' LIMIT 1"); $games = mysql_query("SELECT * FROM `" . DBPREFIX . "game` ORDER BY `game`"); $aes = new Crypt_AES(); $aes->setKeyLength(256); $aes->setKey(CRYPT_KEY); // Get SSH2 Object OR ERROR String $ssh = newNetSSH2($rows['ip'], $rows['sshport'], $rows['login'], $aes->decrypt($rows['password'])); if (!is_object($ssh)) { $_SESSION['msg1'] = T_('Connection Error!'); $_SESSION['msg2'] = $ssh; $_SESSION['msg-type'] = 'error'; } $gameInstaller = new GameInstaller($ssh); include "./bootstrap/header.php"; /** * Notifications */ include "./bootstrap/notifications.php"; ?> <ul class="nav nav-tabs"> <li><a href="boxsummary.php?id=<?php echo $boxid; ?> "><?php echo T_('Summary'); ?> </a></li> <li><a href="boxprofile.php?id=<?php
$box = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "box` WHERE `boxid` = '" . $rows['boxid'] . "' LIMIT 1"); $ip = query_fetch_assoc("SELECT `ip`, `boxid` FROM `" . DBPREFIX . "boxIp` WHERE `ipid` = '" . $rows['ipid'] . "' LIMIT 1"); $game = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "game` WHERE `gameid` = '" . $rows['gameid'] . "' LIMIT 1"); $boxes = mysql_query("SELECT `boxid`, `name` FROM `" . DBPREFIX . "box` ORDER BY `boxid`"); $groups = mysql_query("SELECT `groupid`, `name` FROM `" . DBPREFIX . "group` ORDER BY `groupid`"); $aes = new Crypt_AES(); $aes->setKeyLength(256); $aes->setKey(CRYPT_KEY); // Get SSH2 Object OR ERROR String $ssh = newNetSSH2($box['ip'], $box['sshport'], $box['login'], $aes->decrypt($box['password'])); if (!is_object($ssh)) { $_SESSION['msg1'] = T_('Connection Error!'); $_SESSION['msg2'] = $ssh; $_SESSION['msg-type'] = 'error'; } $gameInstaller = new GameInstaller($ssh); $gameCacheInfo = $gameInstaller->getCacheInfo(dirname($rows['path'])); $gameExists = $gameInstaller->gameExists($game['game']); include "./bootstrap/header.php"; /** * Notifications */ include "./bootstrap/notifications.php"; if ($rows['panelstatus'] == 'Started') { ?> <div class="alert alert-block"> <h4 class="alert-heading">"<?php echo htmlspecialchars($rows['name'], ENT_QUOTES); ?> " <?php echo T_('is currently running!');
} ### $aes = new Crypt_AES(); $aes->setKeyLength(256); $aes->setKey(CRYPT_KEY); ### // Get SSH2 Object OR ERROR String $ssh = newNetSSH2($box['ip'], $box['sshport'], $box['login'], $aes->decrypt($box['password'])); if (!is_object($ssh)) { $_SESSION['msg1'] = T_('Connection Error!'); $_SESSION['msg2'] = $ssh; $_SESSION['msg-type'] = 'error'; header("Location: server.php?id=" . urlencode($serverid)); die; } $gameInstaller = new GameInstaller($ssh); ### $setGameServerPath = $gameInstaller->setGameServerPath(dirname($server['path'])); if ($setGameServerPath == FALSE) { $_SESSION['msg1'] = T_('Error!'); $_SESSION['msg2'] = T_('Unable To Set Game Server Directory'); $_SESSION['msg-type'] = 'error'; header("Location: server.php?id=" . urlencode($serverid)); die; } ### $opStatus = $gameInstaller->checkOperation('installGame'); if ($opStatus == TRUE) { $_SESSION['msg1'] = T_('Unable To Install Game Server!'); $_SESSION['msg2'] = T_('Operation in Progress!'); $_SESSION['msg-type'] = 'error';
continue; } } } $server = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "server` WHERE `serverid` = '" . $serverid . "' LIMIT 1"); $box = query_fetch_assoc("SELECT `ip`, `login`, `password`, `sshport` FROM `" . DBPREFIX . "box` WHERE `boxid` = '" . $server['boxid'] . "' LIMIT 1"); $game = query_fetch_assoc("SELECT `game`, `cachedir` FROM `" . DBPREFIX . "game` WHERE `gameid` = '" . $server['gameid'] . "' LIMIT 1"); $aes = new Crypt_AES(); $aes->setKeyLength(256); $aes->setKey(CRYPT_KEY); // Get SSH2 Object OR ERROR String $ssh = newNetSSH2($box['ip'], $box['sshport'], $box['login'], $aes->decrypt($box['password'])); if (!is_object($ssh)) { continue; } $gameInstaller = new GameInstaller($ssh); ### $setGame = $gameInstaller->setGame($game['game']); if ($setGame == FALSE) { continue; } $setRepoPath = $gameInstaller->setRepoPath($game['cachedir']); if ($setRepoPath == FALSE) { continue; } $repoCacheInfo = $gameInstaller->getCacheInfo($game['cachedir']); if ($repoCacheInfo['status'] != 'Ready') { continue; } $setGameServerPath = $gameInstaller->setGameServerPath(dirname($server['path'])); if ($setGameServerPath == FALSE) {
### $aes = new Crypt_AES(); $aes->setKeyLength(256); $aes->setKey(CRYPT_KEY); ### // Get SSH2 Object OR ERROR String $ssh = newNetSSH2($box['ip'], $box['sshport'], $box['login'], $aes->decrypt($box['password'])); if (!is_object($ssh)) { $_SESSION['msg1'] = T_('Connection Error!'); $_SESSION['msg2'] = $ssh; $_SESSION['msg-type'] = 'error'; header("Location: serversummary.php?id=" . urlencode($serverid)); die; } ### $gameInstaller = new GameInstaller($ssh); ### $gameInstaller->setGameServerPath(dirname($server['path'])); ### $gameInstaller->abortOperation('installGame'); ### //Adding event to the database $message = 'Server Action Aborted : ' . mysql_real_escape_string($server['name']); query_basic("INSERT INTO `" . DBPREFIX . "log` SET `serverid` = '" . $serverid . "', `message` = '" . $message . "', `name` = '" . mysql_real_escape_string($_SESSION['adminfirstname']) . " " . mysql_real_escape_string($_SESSION['adminlastname']) . "', `ip` = '" . $_SERVER['REMOTE_ADDR'] . "'"); ### $_SESSION['msg1'] = T_('Warning: Operation Aborted!'); $_SESSION['msg2'] = ''; $_SESSION['msg-type'] = 'warning'; header("Location: serversummary.php?id=" . urlencode($serverid)); die; break;
### $aes = new Crypt_AES(); $aes->setKeyLength(256); $aes->setKey(CRYPT_KEY); ### // Get SSH2 Object OR ERROR String $ssh = newNetSSH2($box['ip'], $box['sshport'], $box['login'], $aes->decrypt($box['password'])); if (!is_object($ssh)) { $_SESSION['msg1'] = T_('Connection Error!'); $_SESSION['msg2'] = $ssh; $_SESSION['msg-type'] = 'error'; header("Location: boxgamefile.php?id=" . urlencode($boxid)); die; } ### $gameInstaller = new GameInstaller($ssh); ### $gameInstaller->setRepoPath($game['cachedir']); ### $opStatus = $gameInstaller->checkOperation('makeRepo'); if ($opStatus == TRUE) { $_SESSION['msg1'] = T_('Unable To Delete Game Cache Repository!'); $_SESSION['msg2'] = T_('Operation In Progress For This Repository Or Repository Locked For Server Side Operation!'); $_SESSION['msg-type'] = 'error'; header("Location: boxgamefile.php?id=" . urlencode($boxid)); die; } ### $gameInstaller->deleteRepo(); ### //Adding event to the database