Example #1
0
        $task = mysql_real_escape_string($_GET['task']);
    }
}
switch (@$task) {
    case 'deletelog':
        query_basic("TRUNCATE `" . DBPREFIX . "log`");
        $_SESSION['msg1'] = T_('Activity Logs Deleted Successfully!');
        $_SESSION['msg2'] = T_('All activity logs have been removed.');
        $_SESSION['msg-type'] = 'success';
        header("Location: utilitieslog.php");
        die;
        break;
    case 'dumplogtxt':
        $output = '';
        $date = formatDate(date('Y-m-d H:i:s'));
        $numLogs = query_numrows("SELECT * FROM `" . DBPREFIX . "log` ORDER BY `logid`");
        //---------------------------------------------------------+
        $output .= "\n//==================================================================================\n//\n//\tBRIGHT GAME PANEL ACTIVITY LOGS DUMP\n//\n//==================================================================================\n//\n//\tFILENAME: bgp-activity-logs-" . date('Y-m-d') . "\n//\tDATE: {$date}\n//\tADMIN USERNAME: {$_SESSION['adminusername']}\n//\tADMIN FIRSTNAME: {$_SESSION['adminfirstname']}\n//\tADMIN LASTNAME: {$_SESSION['adminlastname']}\n//\n//\tNUMBER OF LOGS: {$numLogs}\n//\tORDERED BY: LOGID\n//\n//==================================================================================\n//\n//\tNOTES:\n//\n//\t\tTimestamp Format: date(Y-m-d H:i:s)\n//\n//==================================================================================\n";
        //---------------------------------------------------------+
        $output .= "\n" . str_pad("LOGID:", 8) . str_pad("Message:", 100) . str_pad("Name:", 24) . str_pad("IP:", 20) . str_pad("Timestamp:", 19) . "\n";
        //---------------------------------------------------------+
        $logs = mysql_query("SELECT * FROM `" . DBPREFIX . "log` ORDER BY `logid` DESC");
        while ($rowsLogs = mysql_fetch_assoc($logs)) {
            //---------------------------------------------------------+
            $output .= str_pad($rowsLogs['logid'], 8) . str_pad($rowsLogs['message'], 100) . str_pad($rowsLogs['name'], 24) . str_pad($rowsLogs['ip'], 20) . str_pad($rowsLogs['timestamp'], 19) . "\n";
            //---------------------------------------------------------+
        }
        //---------------------------------------------------------+
        $output .= "\n//==================================================================================\n//\tEND\n//==================================================================================\n";
        //---------------------------------------------------------+
        header('Content-type: text/plain');
Example #2
0
?>
"><?php 
echo T_('Game File Repositories');
?>
</a></li>
				<li><a href="boxlog.php?id=<?php 
echo $boxid;
?>
"><?php 
echo T_('Activity Logs');
?>
</a></li>
			</ul>
			<div id="charts">
<?php 
if (query_numrows("SELECT `timestamp`, `cache` FROM `" . DBPREFIX . "boxData` WHERE `timestamp` >= '" . (time() - (60 * 60 * 24 * 7 * 4 + CRONDELAY)) . "'") != 0) {
    ?>
				<script type="text/javascript">
				// Chart Containers
				var players;
				var top;
				var bw_usage;
				var bw_consumption;

				$(document).ready(function() {
					//------------------------------------------------------------------------------------------------------------+
					/**
					 * PLAYERS
					 */
					//------------------------------------------------------------------------------------------------------------+
					$(function() {
Example #3
0
     ###
     $_SESSION['msg1'] = T_('Admin Updated Successfully!');
     $_SESSION['msg2'] = T_('Your changes to the admin have been saved.');
     $_SESSION['msg-type'] = 'success';
     header("Location: configadmin.php");
     die;
     break;
 case 'configadmindelete':
     $adminid = $_GET['id'];
     ###
     $error = '';
     ###
     if (!is_numeric($adminid)) {
         $error .= T_('Invalid AdminID. ');
     } else {
         if (query_numrows("SELECT `adminid` FROM `" . DBPREFIX . "admin` WHERE `adminid` = '" . $adminid . "'") == 0) {
             $error .= T_('Invalid AdminID. ');
         }
     }
     if ($adminid == $_SESSION['adminid']) {
         $error .= T_('You cannot delete yourself!');
     }
     ###
     if (!empty($error)) {
         $_SESSION['msg1'] = T_('Validation Error!');
         $_SESSION['msg2'] = $error;
         $_SESSION['msg-type'] = 'error';
         unset($error);
         header("Location: index.php");
         die;
     }
Example #4
0
        while ($rowsCategoriesNav = mysql_fetch_assoc($categoriesNav)) {
            ?>
											<li class="dropdown-submenu">
												<a tabindex="-1" href="#"><i class="icon-th-large <?php 
            echo formatIcon();
            ?>
"></i>&nbsp;<?php 
            echo htmlspecialchars($rowsCategoriesNav['name'], ENT_QUOTES);
            ?>
</a>
												<ul class="dropdown-menu">
<?php 
            /**
             * Processing Scripts
             */
            if (query_numrows("SELECT `scriptid` FROM `" . DBPREFIX . "script` WHERE `catid` = '" . $rowsCategoriesNav['id'] . "' AND `status` = 'Active'") != 0) {
                $scriptsNav = mysql_query("SELECT `scriptid`, `boxid`, `catid`, `groupid`, `name` FROM `" . DBPREFIX . "script` WHERE ( `catid` = '" . $rowsCategoriesNav['id'] . "' AND `status` = 'Active' ) ORDER BY `name`");
                while ($rowsScriptsNav = mysql_fetch_assoc($scriptsNav)) {
                    if (checkClientGroup($rowsScriptsNav['groupid'], $_SESSION['clientid']) != FALSE) {
                        ?>
													<li>
														<a tabindex="-1" href="scriptsummary.php?id=<?php 
                        echo $rowsScriptsNav['scriptid'];
                        ?>
">
															<i class="icon-arrow-right <?php 
                        echo formatIcon();
                        ?>
"></i>
															&nbsp;<?php 
                        echo htmlspecialchars($rowsScriptsNav['name'], ENT_QUOTES);
//----------------------------------------------------+
switch (@$task) {
    case 'processlogin':
        if (isLoggedIn() == TRUE) {
            $_SESSION = array();
            session_destroy();
        }
        $username = mysql_real_escape_string($_POST['username']);
        $password = mysql_real_escape_string($_POST['password']);
        ###
        if (!empty($username) && !empty($password)) {
            ###
            $salt = hash('sha512', $username);
            $password = hash('sha512', $salt . $password);
            ###
            $numrows = query_numrows("SELECT * FROM `user` WHERE `username` = '" . $username . "' AND `password` = '" . $password . "'");
            if ($numrows == 1) {
                $rows = query_fetch_assoc("SELECT * FROM `user` WHERE `username` = '" . $username . "' AND `password` = '" . $password . "'");
                ###
                $_SESSION['id'] = $rows['id'];
                $_SESSION['username'] = $rows['username'];
                ###
                validate();
                ###
                $_SESSION['msg1'] = 'Zostałeś poprawnie zalogowany!';
                $_SESSION['msg-type'] = 'success';
                header("Location: admin.php?page=1");
                die;
            }
        }
        $_SESSION['msg1'] = 'Błędny login lub złe hasło!';
Example #6
0
    $clientid = $_GET['id'];
} else {
    exit('Error: ClientID error.');
}
###
$return = 'clientlog.php?id=' . urlencode($clientid);
require "../configuration.php";
require "./include.php";
$title = T_('Client Activity Logs');
if (query_numrows("SELECT `username` FROM `" . DBPREFIX . "client` WHERE `clientid` = '" . $clientid . "'") == 0) {
    exit('Error: ClientID is invalid.');
}
$rows = query_fetch_assoc("SELECT `firstname`, `lastname`, `status` FROM `" . DBPREFIX . "client` WHERE `clientid` = '" . $clientid . "' LIMIT 1");
//---------------------------------------------------------+
//Num Pages Process:
$numLogs = query_numrows("SELECT * FROM `" . DBPREFIX . "log` WHERE `clientid` = '" . $clientid . "' ORDER BY `logid` LIMIT 750");
$numPages = ceil($numLogs / 50);
//---------------------------------------------------------+
//Pages Process:
if (isset($_GET['page'])) {
    $page = mysql_real_escape_string($_GET['page']);
} else {
    $page = 1;
}
//Security
if ($page > 15 || !is_numeric($page)) {
    exit('Page error!');
}
//---------------------------------------------------------+
//Logs:
$logs = mysql_query("SELECT * FROM `" . DBPREFIX . "log` WHERE `clientid` = '" . $clientid . "' ORDER BY `logid` DESC LIMIT " . ($page - 1) * 50 . ", 50");
     $id = mysql_real_escape_string($_POST['id']);
 } else {
     if (isset($_GET['id'])) {
         $id = mysql_real_escape_string($_GET['id']);
     }
 }
 ###
 $error = '';
 ###
 if (empty($id)) {
     $error .= 'Brak id. ';
 }
 if (!is_numeric($id)) {
     $error .= 'Id vouchera jest nieprawidłowe. ';
 }
 if (query_numrows("SELECT `code` FROM `voucher` WHERE `id` = '" . $id . "'") == 0) {
     $error .= 'Taki voicher nie istnieje. ';
 }
 ###
 if (!empty($error)) {
     $_SESSION['msg1'] = $error;
     $_SESSION['msg-type'] = 'danger';
     unset($error);
     header("Location: admin.php?page=5");
     die;
 }
 ###
 query_basic("DELETE FROM `voucher` WHERE `id` = '" . $id . "'");
 ###
 $_SESSION['msg1'] = 'Pomyślnie usunięto voucher o id:' . $id . '!';
 $_SESSION['msg-type'] = 'success';
Example #8
0
// HOW OLD CACHE MUST BE BEFORE IT NEEDS REFRESHING
$request = "sep";
// WHAT TO PRE-CACHE: [s] = BASIC INFO [e] = SETTINGS [p] = PLAYERS
//------------------------------------------------------------------------------------------------------------+
$mysql_query = "SELECT `type`,`ip`,`c_port`,`q_port`,`s_port` FROM `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` WHERE `disabled`=0 ORDER BY `cache_time` ASC";
$mysql_result = mysql_query($mysql_query) or die(mysql_error());
while ($mysql_row = mysql_fetch_array($mysql_result, MYSQL_ASSOC)) {
    lgsl_query_cached($mysql_row['type'], $mysql_row['ip'], $mysql_row['c_port'], $mysql_row['q_port'], $mysql_row['s_port'], $request);
}
//------------------------------------------------------------------------------------------------------------+
//------------------------------------------------------------------------------------------------------------+
/**
 * BOX MONITORING
 */
$boxData = array();
if (query_numrows("SELECT `boxid` FROM `" . DBPREFIX . "box` ORDER BY `boxid`") != 0) {
    $boxes = mysql_query("SELECT `boxid`, `ip`, `login`, `password`, `sshport` FROM `" . DBPREFIX . "box`");
    while ($rowsBoxes = mysql_fetch_assoc($boxes)) {
        $aes = new Crypt_AES();
        $aes->setKeyLength(256);
        $aes->setKey(CRYPT_KEY);
        $ssh = new Net_SSH2($rowsBoxes['ip'], $rowsBoxes['sshport']);
        if (!$ssh->login($rowsBoxes['login'], $aes->decrypt($rowsBoxes['password']))) {
            //Connection Error!
            $boxCache = array($rowsBoxes['boxid'] => array('players' => array('players' => 0), 'bandwidth' => array('rx_usage' => 0, 'tx_usage' => 0, 'rx_total' => 0, 'tx_total' => 0), 'cpu' => array('proc' => '', 'cores' => 0, 'usage' => 0), 'ram' => array('total' => 0, 'used' => 0, 'free' => 0, 'usage' => 0), 'loadavg' => array('loadavg' => '0.00'), 'hostname' => array('hostname' => ''), 'os' => array('os' => ''), 'date' => array('date' => ''), 'kernel' => array('kernel' => ''), 'arch' => array('arch' => ''), 'uptime' => array('uptime' => ''), 'swap' => array('total' => 0, 'used' => 0, 'free' => 0, 'usage' => 0), 'hdd' => array('total' => 0, 'used' => 0, 'free' => 0, 'usage' => 0)));
            query_basic("UPDATE `" . DBPREFIX . "box` SET\n\t\t\t\t`cache` = '" . mysql_real_escape_string(gzcompress(serialize($boxCache), 2)) . "' WHERE `boxid` = '" . $rowsBoxes['boxid'] . "'");
            unset($boxCache);
        } else {
            //------------------------------------------------------------------------------------------------------------+
            //We have to clean screenlog.0 files
            $servers = mysql_query("SELECT `path` FROM `" . DBPREFIX . "server` WHERE `boxid` = '" . $rowsBoxes['boxid'] . "' && `status` = 'Active'");
Example #9
0
/**
 * Retrieve all Group's clients in a multi- dimensional array
 *
 * Return FALSE if the GROUPID is invalid OR if the Group doesn't have clients OR if there is no members in the table
 */
function getGroupClients($groupid)
{
    if (query_numrows("SELECT `name` FROM `" . DBPREFIX . "group` WHERE `groupid` = '" . $groupid . "'") != 0) {
        // The specified group exists
        if (query_numrows("SELECT `id` FROM `" . DBPREFIX . "groupMember`") > 0) {
            // There is at least one member
            $members = mysql_query("SELECT `clientid`, `groupids` FROM `" . DBPREFIX . "groupMember`");
            $i = 0;
            while ($rowsMembers = mysql_fetch_assoc($members)) {
                if (!empty($rowsMembers['clientid'])) {
                    $groupids = explode(';', $rowsMembers['groupids']);
                    // CSV
                    foreach ($groupids as $value) {
                        if ($value == $groupid) {
                            $clients[$i] = $rowsMembers['clientid'];
                            $i++;
                            break;
                        }
                    }
                }
            }
            if (isset($clients)) {
                return $clients;
            }
        }
    }
    return FALSE;
}
Example #10
0
 * @categories	Games/Entertainment, Systems Administration
 * @package		Bright Game Panel
 * @author		warhawk3407 <*****@*****.**> @NOSPAM
 * @copyleft	2013
 * @license		GNU General Public License version 3.0 (GPLv3)
 * @version		(Release 0) DEVELOPER BETA 8
 * @link		http://www.bgpanel.net/
 */
$page = 'scriptadd';
$tab = 5;
$return = 'scriptadd.php';
require "../configuration.php";
require "./include.php";
$title = T_('Add New Script');
$numBoxes = query_numrows("SELECT `boxid` FROM `" . DBPREFIX . "box`");
$numCats = query_numrows("SELECT `id` FROM `" . DBPREFIX . "scriptCat`");
//---------------------------------------------------------+
if ($numBoxes == 0) {
    $step = 'noboxes';
} else {
    if ($numCats == 0) {
        $step = 'nocats';
    } else {
        $step = 'form';
    }
}
//---------------------------------------------------------+
include "./bootstrap/header.php";
/**
 * Notifications
 */
 if (query_numrows("SELECT `name` FROM `offerts` WHERE `id` = '" . $id . "'") != 1) {
     $error .= 'Taka oferta nie istnieje. ';
 }
 ###
 if (!empty($error)) {
     notifications($error, 'danger');
     unset($error);
     header("Location: product.php?id=" . $id . "&payment=" . $payment . "");
     die;
 }
 ###
 $offert = query_fetch_assoc("SELECT `amount` FROM `offerts` WHERE `id` = '" . $id . "'");
 $config = query_fetch_assoc("SELECT * FROM `config`");
 $voucher = query_fetch_assoc("SELECT `amount`, `id` FROM `voucher` WHERE `code` = '" . $code . "' LIMIT 1");
 ###
 if (query_numrows("SELECT `amount` FROM `voucher` WHERE `code` = '" . $code . "'") == 1 && $voucher['amount'] != 0) {
     $amount = $voucher['amount'] - 1;
     ###
     query_basic("UPDATE `voucher` SET `amount`='" . $amount . "' WHERE `id` = '" . $voucher['id'] . "'");
 } else {
     notifications('Ten kod jest błędny lub został już wykorzystany!', 'danger');
     unset($error);
     header("Location: product.php?id=" . $id . "&payment=" . $payment . "");
     die;
 }
 ###
 define('MQ_SERVER_ADDR', $config['ip']);
 define('MQ_SERVER_PORT', $config['port_rcon']);
 define('MQ_SERVER_PASS', $config['password_rcon']);
 define('MQ_TIMEOUT', 2);
 ###
Example #12
0
 */
$page = 'configgroupedit';
$tab = 5;
$isSummary = TRUE;
###
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
    $groupid = $_GET['id'];
} else {
    exit('Error: GroupID error.');
}
###
$return = 'configgroupedit.php?id=' . urlencode($groupid);
require "../configuration.php";
require "./include.php";
$title = T_('Edit Group');
if (query_numrows("SELECT `name` FROM `" . DBPREFIX . "group` WHERE `groupid` = '" . $groupid . "'") == 0) {
    exit('Error: GroupID is invalid.');
}
$rows = query_fetch_assoc("SELECT `name`, `description` FROM `" . DBPREFIX . "group` WHERE `groupid` = '" . $groupid . "' LIMIT 1");
$clients = getGroupClients($groupid);
if ($clients == FALSE) {
    $error = T_("This group doesn't have clients.");
}
include "./bootstrap/header.php";
/**
 * Notifications
 */
include "./bootstrap/notifications.php";
?>
			<div class="well">
				<form method="post" action="configgroupprocess.php">
Example #13
0
$return = 'serveradd.php';
require "../configuration.php";
require "./include.php";
$title = T_('Add New Server');
$numBoxes = query_numrows("SELECT `boxid` FROM `" . DBPREFIX . "box`");
$numGroups = query_numrows("SELECT `groupid` FROM `" . DBPREFIX . "group`");
$games = mysql_query("SELECT `gameid`, `game` FROM `" . DBPREFIX . "game` WHERE `status` = 'Active' ORDER BY `game`");
//---------------------------------------------------------+
if ($numBoxes == 0) {
    $step = 'noboxes';
} else {
    if ($numGroups == 0) {
        $step = 'nogroups';
    } else {
        if (isset($_GET['gameid']) && is_numeric($_GET['gameid'])) {
            if (query_numrows("SELECT `game` FROM `" . DBPREFIX . "game` WHERE `gameid` = '" . $_GET['gameid'] . "'") == 0) {
                exit('Error: Game is invalid.');
            } else {
                $gameid = $_GET['gameid'];
                $step = 'form';
            }
        } else {
            $step = 'selectgame';
        }
    }
}
//---------------------------------------------------------+
include "./bootstrap/header.php";
/**
 * Notifications
 */
Example #14
0
define('DBVERSION', $panelVersion['value']);
define('TEMPLATE', $template['value']);
define('MAINTENANCE', $maintenance['value']);
unset($panelName, $panelVersion, $template, $maintenance);
define('PROJECT', $bgpCoreInfo->{'project'});
define('PACKAGE', $bgpCoreInfo->{'package'});
define('BRANCH', $bgpCoreInfo->{'branch'});
define('COREVERSION', $bgpCoreInfo->{'version'});
define('RELEASEDATE', $bgpCoreInfo->{'date'});
unset($bgpCoreInfo);
/**
 * CRYPT_KEY is the Passphrase Used to Cipher/Decipher SSH Passwords
 * The key is stored into the file: ".ssh/passphrase"
 */
define('CRYPT_KEY', file_get_contents("../.ssh/passphrase"));
/**
 * API_KEY is used to access / protect contents
 */
define('API_KEY', substr(CRYPT_KEY, strlen(CRYPT_KEY) / 2));
/**
 * MAINTENANCE CHECKER
 * Logout user if this one is not a Super Administrator.
 */
if (MAINTENANCE == 1) {
    if (isAdminLoggedIn() == TRUE) {
        if (query_numrows("SELECT `adminid` FROM `" . DBPREFIX . "admin` WHERE `adminid` = '" . $_SESSION['adminid'] . "' AND `access` = 'Super'") == 0) {
            logout();
            exit('<h1><b>503 Service Unavailable</b></h1>');
        }
    }
}
} else {
    if (isset($_GET['id'])) {
        $id = mysql_real_escape_string($_GET['id']);
    }
}
###
if (isset($_POST['payment'])) {
    $payment = mysql_real_escape_string($_POST['payment']);
} else {
    if (isset($_GET['payment'])) {
        $payment = mysql_real_escape_string($_GET['payment']);
    }
}
//----------------------------------------------------+
if (!empty($id) && !empty($payment)) {
    if (query_numrows("SELECT `name` FROM `offerts` WHERE `id` = '" . $id . "'") == 1) {
        $offerts = query_fetch_assoc("SELECT * FROM `offerts` WHERE `id` = '" . $id . "' LIMIT 150");
        $sms = query_fetch_assoc("SELECT `csms`, `nsms`, `asms` FROM `sms` WHERE `id` = '" . $offerts['amount'] . "' LIMIT 1");
        ?>
		<p style="font-size: 25px">Wybrałeś Ofertę: <b><?php 
        echo $offerts['name'];
        ?>
</b>, jej koszt wynosi <b><?php 
        echo $sms['asms'];
        ?>
</b> zł.</p>
		</hr>
        <?php 
        if ($payment == 'sms') {
            echo "<p>Wyślij smsa o treści: <b>" . $sms['csms'] . "</b> na numer: <b>" . $sms['nsms'] . "</b>.</p>";
        }
Example #16
0
 case 'processpassword':
     $username = mysql_real_escape_string($_POST['username']);
     $email = mysql_real_escape_string($_POST['email']);
     ###
     /**
      * Securimage - A PHP class for creating captcha images.
      *
      * VERSION: 3.0
      * AUTHOR: Drew Phillips <*****@*****.**>
      */
     require "./libs/securimage/securimage.php";
     $securimage = new Securimage();
     ###
     if ($securimage->check($_POST['captcha_code']) == TRUE) {
         if (!empty($username) && !empty($email)) {
             $numrows = query_numrows("SELECT `clientid` FROM `" . DBPREFIX . "client` WHERE `username` = '" . $username . "' && `email` = '" . $email . "'");
             if ($numrows == 1) {
                 $rows = query_fetch_assoc("SELECT `clientid`, `email` FROM `" . DBPREFIX . "client` WHERE `username` = '" . $username . "'");
                 ###
                 //Processing the password
                 $password = createRandomPassword(8);
                 $password2 = $password;
                 //Temp var for the email
                 $salt = hash('sha512', $username);
                 //Salt
                 $password = hash('sha512', $salt . $password);
                 //Hashed password with salt
                 query_basic("UPDATE `" . DBPREFIX . "client` SET `password` = '" . $password . "' WHERE `clientid` = '" . $rows['clientid'] . "'");
                 ###
                 $to = htmlentities($rows['email'], ENT_QUOTES);
                 $subject = T_('Reset Password');
Example #17
0
     $_SESSION['msg1'] = T_('Account Updated Successfully!');
     $_SESSION['msg2'] = T_('Your changes to your account have been saved.');
     $_SESSION['msg-type'] = 'success';
     header("Location: index.php");
     die;
     break;
 case 'personalnotes':
     $clientid = mysql_real_escape_string($_POST['clientid']);
     $notes = mysql_real_escape_string($_POST['notes']);
     ###
     $error = '';
     ###
     if (!is_numeric($clientid)) {
         $error .= T_('Invalid ClientID. ');
     } else {
         if (query_numrows("SELECT `username` FROM `" . DBPREFIX . "client` WHERE `clientid` = '" . $clientid . "'") == 0) {
             $error .= T_('Invalid ClientID. ');
         }
     }
     ###
     if (!empty($error)) {
         $_SESSION['msg1'] = T_('Validation Error!');
         $_SESSION['msg2'] = $error;
         $_SESSION['msg-type'] = 'error';
         unset($error);
         header("Location: index.php");
         die;
     }
     ###
     query_basic("UPDATE `" . DBPREFIX . "client` SET `notes` = '" . $notes . "' WHERE `clientid` = '" . $clientid . "'");
     ###
Example #18
0
<?php 
}
while ($rowsBoxes = mysql_fetch_assoc($boxes)) {
    $cache = unserialize(gzuncompress($rowsBoxes['cache']));
    ?>
						<tr>
							<td><?php 
    echo htmlspecialchars($rowsBoxes['name'], ENT_QUOTES);
    ?>
</td>
							<td><?php 
    echo htmlspecialchars($rowsBoxes['ip'], ENT_QUOTES);
    ?>
</td>
							<td><?php 
    echo query_numrows("SELECT `serverid` FROM `" . DBPREFIX . "server` WHERE `boxid` = '" . $rowsBoxes['boxid'] . "'");
    ?>
</td>
							<td><?php 
    echo formatStatus(getStatus($rowsBoxes['ip'], $rowsBoxes['sshport']));
    ?>
</td>
							<td> RX:&nbsp;<?php 
    echo bytesToSize($cache["{$rowsBoxes['boxid']}"]['bandwidth']['rx_usage']);
    ?>
/s </td>
							<td> TX:&nbsp;<?php 
    echo bytesToSize($cache["{$rowsBoxes['boxid']}"]['bandwidth']['tx_usage']);
    ?>
/s </td>
							<td><span class="badge badge-<?php 
Example #19
0
 */
$page = 'scriptcatedit';
$tab = 5;
$isSummary = TRUE;
###
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
    $catid = $_GET['id'];
} else {
    exit('Error: CatID error.');
}
###
$return = 'scriptcatedit.php?id=' . urlencode($catid);
require "../configuration.php";
require "./include.php";
$title = T_('Edit Script Category');
if (query_numrows("SELECT `name` FROM `" . DBPREFIX . "scriptCat` WHERE `id` = '" . $catid . "'") == 0) {
    exit('Error: CatID is invalid.');
}
$rows = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "scriptCat` WHERE `id` = '" . $catid . "' LIMIT 1");
include "./bootstrap/header.php";
/**
 * Notifications
 */
include "./bootstrap/notifications.php";
?>
			<div class="well">
				<form method="post" action="scriptprocess.php">
					<input type="hidden" name="task" value="scriptcatedit" />
					<input type="hidden" name="catid" value="<?php 
echo $catid;
?>
Example #20
0
###
$return = 'configgameedit.php?id=' . urlencode($gameid);
require "../configuration.php";
require "./include.php";
include "../libs/lgsl/lgsl_protocol.php";
$title = T_('Edit Game');
if (query_numrows("SELECT `game` FROM `" . DBPREFIX . "game` WHERE `gameid` = '" . $gameid . "'") == 0) {
    exit('Error: GameID is invalid.');
}
$rows = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "game` WHERE `gameid` = '" . $gameid . "' LIMIT 1");
include "./bootstrap/header.php";
/**
 * Notifications
 */
include "./bootstrap/notifications.php";
if (query_numrows("SELECT `serverid` FROM `" . DBPREFIX . "server` WHERE `gameid` = '" . $gameid . "'") != 0) {
    ?>
			<div class="alert alert-block">
				<h4 class="alert-heading">"<?php 
    echo htmlspecialchars($rows['game'], ENT_QUOTES);
    ?>
" <?php 
    echo T_('is currently in use by game servers!');
    ?>
</h4>
			</div>
<?php 
}
?>
			<div class="well">
				<form method="post" action="configgameprocess.php">
Example #21
0
$isSummary = TRUE;
###
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
    $serverid = $_GET['id'];
} else {
    exit('Error: ServerID error.');
}
###
$return = 'serverprofile.php?id=' . urlencode($serverid);
require "../configuration.php";
require "./include.php";
require_once "../includes/func.ssh2.inc.php";
require_once "../libs/phpseclib/Crypt/AES.php";
require_once "../libs/gameinstaller/gameinstaller.php";
$title = T_('Server Settings');
if (query_numrows("SELECT `name` FROM `" . DBPREFIX . "server` WHERE `serverid` = '" . $serverid . "'") == 0) {
    exit('Error: ServerID is invalid.');
}
$rows = query_fetch_assoc("SELECT * FROM `" . DBPREFIX . "server` WHERE `serverid` = '" . $serverid . "' LIMIT 1");
$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!');
Example #22
0
 case 'processpassword':
     $username = mysql_real_escape_string($_POST['username']);
     $email = mysql_real_escape_string($_POST['email']);
     ###
     /**
      * Securimage - A PHP class for creating captcha images.
      *
      * VERSION: 3.0
      * AUTHOR: Drew Phillips <*****@*****.**>
      */
     require "../libs/securimage/securimage.php";
     $securimage = new Securimage();
     ###
     if ($securimage->check($_POST['captcha_code']) == TRUE) {
         if (!empty($username) && !empty($email)) {
             $numrows = query_numrows("SELECT `adminid` FROM `" . DBPREFIX . "admin` WHERE `username` = '" . $username . "' && `email` = '" . $email . "'");
             if ($numrows == 1) {
                 $rows = query_fetch_assoc("SELECT `adminid`, `email` FROM `" . DBPREFIX . "admin` WHERE `username` = '" . $username . "'");
                 ###
                 //Processing the password
                 $password = createRandomPassword(8);
                 $password2 = $password;
                 //Temp var for the email
                 $salt = hash('sha512', $username);
                 //Salt
                 $password = hash('sha512', $salt . $password);
                 //Hashed password with salt
                 query_basic("UPDATE `" . DBPREFIX . "admin` SET `password` = '" . $password . "' WHERE `adminid` = '" . $rows['adminid'] . "'");
                 ###
                 $to = htmlentities($rows['email'], ENT_QUOTES);
                 $subject = T_('Reset Password');
Example #23
0
$isSummary = TRUE;
###
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
    $boxid = $_GET['id'];
} else {
    exit('Error: BoxID error.');
}
###
$return = 'boxgamefile.php?id=' . urlencode($boxid);
require "../configuration.php";
require "./include.php";
require_once "../includes/func.ssh2.inc.php";
require_once "../libs/phpseclib/Crypt/AES.php";
require_once "../libs/gameinstaller/gameinstaller.php";
$title = T_('Box Game File Repositories');
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);
Example #24
0
						</tr>
<?php 
}
while ($rowsCategories = mysql_fetch_assoc($categories)) {
    ?>
						<tr>
							<td><?php 
    echo htmlspecialchars($rowsCategories['name'], ENT_QUOTES);
    ?>
</td>
							<td><?php 
    echo htmlspecialchars($rowsCategories['description'], ENT_QUOTES);
    ?>
</td>
							<td><?php 
    echo query_numrows("SELECT `scriptid` FROM `" . DBPREFIX . "script` WHERE `catid` = '" . $rowsCategories['id'] . "'");
    ?>
</td>
							<td><div style="text-align: center;"><a class="btn btn-small" href="scriptcatedit.php?id=<?php 
    echo $rowsCategories['id'];
    ?>
"><i class="icon-edit <?php 
    echo formatIcon();
    ?>
"></i></a></div></td>
							<td><div style="text-align: center;"><a class="btn btn-danger btn-small" href="#" onclick="doDelete('<?php 
    echo $rowsCategories['id'];
    ?>
', '<?php 
    echo htmlspecialchars(addslashes($rowsCategories['name']), ENT_QUOTES);
    ?>