unset($client, $groupid, $groupids); } } //unset($clientid, $adminid); unset($clientid); ++$n; } $i++; } unset($i, $n); //---------------------------------------------------------+ //Updating data for table "config" query_basic("UPDATE `" . DBPREFIX . "config` SET `value` = '0.3.0' WHERE `setting` = 'panelversion' LIMIT 1"); //---------------------------------------------------------+ //Dumping data for table "game" query_basic("\n\t\tINSERT INTO `" . DBPREFIX . "game` (`game`, `status`, `maxslots`, `defaultport`, `cfg1name`, `cfg1`, `cfg2name`, `cfg2`, `cfg3name`, `cfg3`, `cfg4name`, `cfg4`, `cfg5name`, `cfg5`, `cfg6name`, `cfg6`, `cfg7name`, `cfg7`, `cfg8name`, `cfg8`, `cfg9name`, `cfg9`, `startline`, `querytype`, `queryport`, `cachedir`)\n\t\tVALUES\n\t\t ('Garrysmod (*)', 'Active', '16', '27015', 'Default Map', 'gm_construct', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', './srcds_run -game garrysmod -ip {ip} -port {port} -maxplayers {slots} +map {cfg1} -nohltv -autoupdate', 'source', '27015', ''),\n\t\t ('Counter-Strike: Global Offensive (*)', 'Active', '24', '27015', 'Default Map', 'cs_italy', 'Map Group', 'mg_hostage', 'Game Type', '0', 'Game Mode', '0', 'Tickrate', '100', '', '', '', '', '', '', '', '', './srcds_run -game csgo -console -usercon -secure -nohltv -tickrate {cfg5} +ip {ip} +hostport {port} -maxplayers_override {slots} +map {cfg1} +mapgroup {cfg2} +game_type {cfg3} +game_mode {cfg4}', 'source', '27015', '') ; "); //---------------------------------------------------------+ //Table structure for table "script" query_basic("DROP TABLE IF EXISTS `" . DBPREFIX . "script` ; "); query_basic("\n\t\tCREATE TABLE `" . DBPREFIX . "script` (\n\t\t `scriptid` int(8) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t `groupid` int(8) UNSIGNED NULL,\n\t\t `boxid` int(8) UNSIGNED NOT NULL,\n\t\t `catid` int(8) UNSIGNED NOT NULL,\n\t\t `name` text NOT NULL,\n\t\t `description` text NULL,\n\t\t `status` text NOT NULL,\n\t\t `panelstatus` text NULL,\n\t\t `startline` text NOT NULL,\n\t\t `filename` text NOT NULL,\n\t\t `homedir` text NOT NULL,\n\t\t `type` int(1) NOT NULL,\n\t\t `screen` text NULL,\n\t\t PRIMARY KEY (`scriptid`)\n\t\t)\n\t\tENGINE=MyISAM ; "); //---------------------------------------------------------+ //Table structure for table "scriptCat" query_basic("DROP TABLE IF EXISTS `" . DBPREFIX . "scriptCat` ; "); query_basic("\n\t\tCREATE TABLE `" . DBPREFIX . "scriptCat` (\n\t\t `id` int(8) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t `name` text NOT NULL,\n\t\t `description` text NULL,\n\t\t PRIMARY KEY (`id`)\n\t\t)\n\t\tENGINE=MyISAM ; "); //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ mysql_close($mysql_link); } } //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
} 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; } ### query_basic("DELETE FROM `" . DBPREFIX . "admin` WHERE `adminid` = '" . $adminid . "' LIMIT 1"); ### $_SESSION['msg1'] = T_('Admin Deleted Successfully!'); $_SESSION['msg2'] = T_('The selected admin has been removed.'); $_SESSION['msg-type'] = 'success'; header("Location: configadmin.php"); die; break; default: exit('<h1><b>Error</b></h1>'); } exit('<h1><b>403 Forbidden</b></h1>'); //If the task is incorrect or unspecified, we drop the user.
* @version (Release 0) DEVELOPER BETA 8 * @link http://www.bgpanel.net/ */ $return = TRUE; require "../configuration.php"; require "./include.php"; if (isset($_POST['task'])) { $task = mysql_real_escape_string($_POST['task']); } else { if (isset($_GET['task'])) { $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"; //---------------------------------------------------------+
//---------------------------------------------------------+ //Table structure for table "groupMember" query_basic("DROP TABLE IF EXISTS `" . DBPREFIX . "groupMember` ; "); query_basic("\n\t\tCREATE TABLE `" . DBPREFIX . "groupMember` (\n\t\t `id` int(8) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t `clientid` int(8) NULL,\n\t\t `groupids` text NULL,\n\t\t PRIMARY KEY (`id`)\n\t\t)\n\t\tENGINE=MyISAM ; "); //---------------------------------------------------------+ //Table structure for table "lgsl" query_basic("DROP TABLE IF EXISTS `" . DBPREFIX . "lgsl` ; "); query_basic("\n\t\tCREATE TABLE `" . DBPREFIX . "lgsl` (\n\t\t `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t `type` VARCHAR (50) NOT NULL DEFAULT '',\n\t\t `ip` VARCHAR (255) NOT NULL DEFAULT '',\n\t\t `c_port` VARCHAR (5) NOT NULL DEFAULT '0',\n\t\t `q_port` VARCHAR (5) NOT NULL DEFAULT '0',\n\t\t `s_port` VARCHAR (5) NOT NULL DEFAULT '0',\n\t\t `zone` VARCHAR (255) NOT NULL DEFAULT '',\n\t\t `disabled` TINYINT (1) NOT NULL DEFAULT '0',\n\t\t `comment` VARCHAR (255) NOT NULL DEFAULT '',\n\t\t `status` TINYINT (1) NOT NULL DEFAULT '0',\n\t\t `cache` TEXT NOT NULL,\n\t\t `cache_time` TEXT NOT NULL,\n\t\t PRIMARY KEY (`id`)\n\t\t)\n\t\tENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci ; "); //---------------------------------------------------------+ //Table structure for table "log" query_basic("DROP TABLE IF EXISTS `" . DBPREFIX . "log` ; "); query_basic("\n\t\tCREATE TABLE `" . DBPREFIX . "log` (\n\t\t `logid` int(8) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t `clientid` int(8) UNSIGNED NULL,\n\t\t `scriptid` int(8) UNSIGNED NULL,\n\t\t `serverid` int(8) UNSIGNED NULL,\n\t\t `boxid` int(8) UNSIGNED NULL,\n\t\t `message` text NOT NULL,\n\t\t `name` text NOT NULL,\n\t\t `ip` text NOT NULL,\n\t\t `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n\t\t PRIMARY KEY (`logid`)\n\t\t)\n\t\tENGINE=MyISAM ; "); //---------------------------------------------------------+ //Table structure for table "script" query_basic("DROP TABLE IF EXISTS `" . DBPREFIX . "script` ; "); query_basic("\n\t\tCREATE TABLE `" . DBPREFIX . "script` (\n\t\t `scriptid` int(8) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t `groupid` int(8) UNSIGNED NULL,\n\t\t `boxid` int(8) UNSIGNED NOT NULL,\n\t\t `catid` int(8) UNSIGNED NOT NULL,\n\t\t `name` text NOT NULL,\n\t\t `description` text NULL,\n\t\t `status` text NOT NULL,\n\t\t `panelstatus` text NULL,\n\t\t `startline` text NOT NULL,\n\t\t `filename` text NOT NULL,\n\t\t `homedir` text NOT NULL,\n\t\t `type` int(1) NOT NULL,\n\t\t `screen` text NULL,\n\t\t PRIMARY KEY (`scriptid`)\n\t\t)\n\t\tENGINE=MyISAM ; "); //---------------------------------------------------------+ //Table structure for table "scriptCat" query_basic("DROP TABLE IF EXISTS `" . DBPREFIX . "scriptCat` ; "); query_basic("\n\t\tCREATE TABLE `" . DBPREFIX . "scriptCat` (\n\t\t `id` int(8) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t `name` text NOT NULL,\n\t\t `description` text NULL,\n\t\t PRIMARY KEY (`id`)\n\t\t)\n\t\tENGINE=MyISAM ; "); //---------------------------------------------------------+ //Table structure for table "server" query_basic("DROP TABLE IF EXISTS `" . DBPREFIX . "server` ; "); query_basic("\n\t\tCREATE TABLE `" . DBPREFIX . "server` (\n\t\t `serverid` int(8) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t `groupid` int(8) UNSIGNED NOT NULL,\n\t\t `boxid` int(8) UNSIGNED NOT NULL,\n\t\t `ipid` int(8) UNSIGNED NOT NULL,\n\t\t `gameid` int(8) UNSIGNED NOT NULL,\n\t\t `name` text NOT NULL,\n\t\t `game` text NOT NULL,\n\t\t `status` text NOT NULL,\n\t\t `panelstatus` text NOT NULL,\n\t\t `slots` int(4) UNSIGNED NOT NULL,\n\t\t `port` int(5) UNSIGNED NOT NULL,\n\t\t `queryport` int(5) UNSIGNED NOT NULL,\n\t\t `priority` text NOT NULL,\n\t\t `cfg1name` text NULL,\n\t\t `cfg1` text NULL,\n\t\t `cfg2name` text NULL,\n\t\t `cfg2` text NULL,\n\t\t `cfg3name` text NULL,\n\t\t `cfg3` text NULL,\n\t\t `cfg4name` text NULL,\n\t\t `cfg4` text NULL,\n\t\t `cfg5name` text NULL,\n\t\t `cfg5` text NULL,\n\t\t `cfg6name` text NULL,\n\t\t `cfg6` text NULL,\n\t\t `cfg7name` text NULL,\n\t\t `cfg7` text NULL,\n\t\t `cfg8name` text NULL,\n\t\t `cfg8` text NULL,\n\t\t `cfg9name` text NULL,\n\t\t `cfg9` text NULL,\n\t\t `startline` text NOT NULL,\n\t\t `path` text NOT NULL,\n\t\t `screen` text NOT NULL,\n\t\t PRIMARY KEY (`serverid`)\n\t\t)\n\t\tENGINE=MyISAM ; "); //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ mysql_close($mysql_link); } } //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
#-----------------+ if (!$mail) { exit("<h1><b>Error: message could not be sent.</b></h1>"); } ### //Message has been sent unset($_SESSION['loginattempt']); unset($_SESSION['lockout']); $_SESSION['success'] = 'Yes'; header("Location: login.php?task=password"); die; } } } $_SESSION['success'] = 'No'; $_SESSION['loginattempt']++; if (4 < $_SESSION['loginattempt']) { $_SESSION['lockout'] = time(); $_SESSION['loginattempt'] = 0; //Reseting attempts as the user will be ban for 5 mins $message = T_('5 Incorrect Admin Login Attempts') . '(' . $username . ')'; query_basic("INSERT INTO `" . DBPREFIX . "log` SET `message` = '" . $message . "', `name` = 'System Message', `ip` = '" . $_SERVER['REMOTE_ADDR'] . "'"); } header("Location: login.php?task=password"); die; break; default: exit('<h1><b>Error</b></h1>'); } exit('<h1><b>403 Forbidden</b></h1>'); //If the task is incorrect or unspecified, we drop the user.
while ($rowsServers = mysql_fetch_assoc($servers)) { query_basic("UPDATE `" . DBPREFIX . "server` SET `screen` = '" . preg_replace('#[^a-zA-Z0-9]#', "_", $rowsServers['screen']) . "' WHERE `serverid` = '" . $rowsServers['serverid'] . "'"); } unset($servers); //---------------------------------------------------------+ //Updating data for table "script" $scripts = mysql_query("SELECT `scriptid`, `screen` FROM `" . DBPREFIX . "script` WHERE `panelstatus` = 'Stopped'"); while ($rowsScripts = mysql_fetch_assoc($scripts)) { if (!empty($rowsScripts['screen'])) { query_basic("UPDATE `" . DBPREFIX . "script` SET `screen` = '" . preg_replace('#[^a-zA-Z0-9]#', "_", $rowsScripts['screen']) . "' WHERE `scriptid` = '" . $rowsScripts['scriptid'] . "'"); } } unset($scripts); //---------------------------------------------------------+ //Updating structure for table "box" query_basic("ALTER TABLE `" . DBPREFIX . "box` ADD `bw_rx` BIGINT(20) UNSIGNED NOT NULL"); query_basic("ALTER TABLE `" . DBPREFIX . "box` ADD `bw_tx` BIGINT(20) UNSIGNED NOT NULL"); //Updating structure for table "boxData" query_basic("ALTER TABLE `" . DBPREFIX . "boxData` ADD `bw_rx` text NOT NULL"); query_basic("ALTER TABLE `" . DBPREFIX . "boxData` ADD `bw_tx` text NOT NULL"); //---------------------------------------------------------+ //Updating data for table "config" query_basic("UPDATE `" . DBPREFIX . "config` SET `value` = '0.3.9' WHERE `setting` = 'panelversion' LIMIT 1"); //---------------------------------------------------------+ //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ mysql_close($mysql_link); } } //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
} 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'; header("Location: admin.php?page=5"); die; break; case 'logdelete': query_basic("TRUNCATE `log`"); $_SESSION['msg1'] = 'Logi zostały usunięte!'; $_SESSION['msg-type'] = 'success'; header("Location: admin.php?page=6"); die; break; default: exit('<h1><b>Błąd</b></h1>'); } exit('<h1><b>403 Forbidden</b></h1>');
* SESSION check up (Test if the information stored in the globals $_SESSION are valid) */ if (isClientLoggedIn() == TRUE) { $clientverify = mysql_query("SELECT `username`, `firstname`, `lastname`, `token`, `lastip` FROM `" . DBPREFIX . "client` WHERE `clientid` = '" . $_SESSION['clientid'] . "' && `status` = 'Active'"); ### $clientverify = mysql_fetch_assoc($clientverify); if ($clientverify['username'] != $_SESSION['clientusername'] || $clientverify['firstname'] != $_SESSION['clientfirstname'] || $clientverify['lastname'] != $_SESSION['clientlastname'] || $clientverify['token'] != session_id() || $clientverify['lastip'] != $_SERVER['REMOTE_ADDR']) { session_destroy(); header("Location: login.php"); die; } /** * Define Language Using 'php gettext' */ defineLanguage($_SESSION['clientlang']); query_basic("UPDATE `" . DBPREFIX . "client` SET `lastactivity` = '" . $_SERVER['REQUEST_TIME'] . "' WHERE `clientid` = '" . $_SESSION['clientid'] . "'"); } /** * GET BrightGamePanel Database INFORMATION * Load 'values' from `config` Table */ $panelName = query_fetch_assoc("SELECT `value` FROM `" . DBPREFIX . "config` WHERE `setting` = 'panelname' LIMIT 1"); $panelVersion = query_fetch_assoc("SELECT `value` FROM `" . DBPREFIX . "config` WHERE `setting` = 'panelversion' LIMIT 1"); $template = query_fetch_assoc("SELECT `value` FROM `" . DBPREFIX . "config` WHERE `setting` = 'clienttemplate' LIMIT 1"); $maintenance = query_fetch_assoc("SELECT `value` FROM `" . DBPREFIX . "config` WHERE `setting` = 'maintenance' LIMIT 1"); /** * GET BGP CORE FILES INFORMATION * Load version.xml (ROOT/.version/version.xml) */ $bgpCoreInfo = simplexml_load_file('./.version/version.xml'); /**
<br /> </div> </div> </center> <?php if ($_GET['page'] == '3') { if ($_POST['login'] && $_POST['password']) { require "../config.php"; require "../include/mysql.php"; ### $login = mysql_real_escape_string($_POST['login']); $password = mysql_real_escape_string($_POST['password']); ### $salt = hash('sha512', $login); $password = hash('sha512', $salt . $password); query_basic("INSERT INTO `user` SET\n\t\t\t`username` = '" . $login . "',\n\t\t\t`password` = '" . $password . "',\n\t\t\t`session` = '~'"); header('Location: ?page=4'); } ?> <center> <div class="panel panel-success" style="width:800px;"> <div class="panel-heading"> <h3 class="panel-title">Instalacja itemshopu! Krok - 3</h3> </div> <div class="panel-body"> Wpisz login i hasło administratora itemshopu! <br /> <br /> <form method="POST"> Login <input class="form-control" type="text" style="width: 200px; height: 30px;" name="login" /> Hasło <input class="form-control" type="text" style="width: 200px; height: 30px;" name="password" />
define('MQ_TIMEOUT', 2); ### include INCLUDES_DIR . "rcon.php"; ### $Rcon = new MinecraftRcon(); $Rcon->Connect(MQ_SERVER_ADDR, MQ_SERVER_PORT, MQ_SERVER_PASS, MQ_TIMEOUT); $offerts = mysql_query("SELECT * FROM `offerts` WHERE `id` = '" . $id . "'"); while ($rowsOfferts = @mysql_fetch_assoc($offerts)) { $commends = explode(",", $rowsOfferts['commends']); $output = count($commends); ### for ($i = 0; $i < $output; $i++) { $by = array("{NICK}"); $after = array($nick); ### $commends[$i] = str_replace($by, $after, $commends[$i]); $data = $Rcon->Command($commends[$i]); } } $Rcon->Disconnect(); ### query_basic("INSERT INTO `log` SET\n\t\t\t`offertsid` = '" . $offertsid . "',\n\t\t\t`message` = 'Gracz: '" . $nick . "' dostał ofertę o id: '" . $id . "'',\n\t\t\t`status` = 'success',\n\t\t\t`date` = '" . date('Y-m-d G:i:s') . "'"); ### notifications('Usługa została poprawnie przydzielona!', 'success'); header("Location: index.php"); die; break; default: exit('<h1><b>Błąd</b></h1>'); } exit('<h1><b>403 Forbidden</b></h1>');
//------------------------------------------------------------------------------------------------------------+ /** * '*Data' table operations */ //---------------------------------------------------------+ // Remove old data $time = time() - (60 * 60 * 24 * 7 * 4 * 3 + 3600); $numOldData = mysql_num_rows(mysql_query("SELECT `id` FROM `" . DBPREFIX . "boxData` WHERE `timestamp` < '" . $time . "'")); if ($numOldData > 0) { $oldData = mysql_query("SELECT `id` FROM `" . DBPREFIX . "boxData` WHERE `timestamp` < '" . $time . "'"); while ($rowsData = mysql_fetch_assoc($oldData)) { query_basic("DELETE FROM `" . DBPREFIX . "boxData` WHERE `id` = '" . $rowsData['id'] . "'"); } unset($oldData); } //---------------------------------------------------------+ // Optimize table $sql = "OPTIMIZE TABLE `" . DBPREFIX . "boxData`"; query_basic($sql); unset($sql); //------------------------------------------------------------------------------------------------------------+ //------------------------------------------------------------------------------------------------------------+ /** * 'log' table operations */ //---------------------------------------------------------+ // Optimize table $sql = "OPTIMIZE TABLE `" . DBPREFIX . "log`"; query_basic($sql); unset($sql); //------------------------------------------------------------------------------------------------------------+
$error .= T_('Invalid Client template !'); } //---------------------------------------------------------+ ### if (!empty($error)) { $_SESSION['msg1'] = T_('Validation Error! Form has been reset!'); $_SESSION['msg2'] = $error; $_SESSION['msg-type'] = 'error'; unset($error); header("Location: configgeneral.php"); die; } ### //Update query_basic("UPDATE `" . DBPREFIX . "config` SET `value` = '" . $panelName . "' WHERE `setting` = 'panelname'"); query_basic("UPDATE `" . DBPREFIX . "config` SET `value` = '" . $systemUrl . "' WHERE `setting` = 'systemurl'"); query_basic("UPDATE `" . DBPREFIX . "config` SET `value` = '" . $adminTemplate . "' WHERE `setting` = 'admintemplate'"); query_basic("UPDATE `" . DBPREFIX . "config` SET `value` = '" . $clientTemplate . "' WHERE `setting` = 'clienttemplate'"); query_basic("UPDATE `" . DBPREFIX . "config` SET `value` = '" . $maintenance . "' WHERE `setting` = 'maintenance'"); ### $_SESSION['msg1'] = T_('Settings Updated Successfully!'); $_SESSION['msg2'] = T_('Your changes to the settings have been saved.'); $_SESSION['msg-type'] = 'success'; header("Location: configgeneral.php"); die; break; default: exit('<h1><b>Error</b></h1>'); } exit('<h1><b>403 Forbidden</b></h1>'); //If the task is incorrect or unspecified, we drop the user.
* SESSION check up (Test if the information stored in the globals $_SESSION are valid) */ if (isAdminLoggedIn() == TRUE) { $adminverify = mysql_query("SELECT `username`, `firstname`, `lastname`, `token`, `lastip` FROM `" . DBPREFIX . "admin` WHERE `adminid` = '" . $_SESSION['adminid'] . "' && `status` = 'Active'"); ### $adminverify = mysql_fetch_assoc($adminverify); if ($adminverify['username'] != $_SESSION['adminusername'] || $adminverify['firstname'] != $_SESSION['adminfirstname'] || $adminverify['lastname'] != $_SESSION['adminlastname'] || $adminverify['token'] != session_id() || $adminverify['lastip'] != $_SERVER['REMOTE_ADDR']) { session_destroy(); header("Location: login.php"); die; } /** * Define Language Using 'php gettext' */ defineLanguage($_SESSION['adminlang']); query_basic("UPDATE `" . DBPREFIX . "admin` SET `lastactivity` = '" . $_SERVER['REQUEST_TIME'] . "' WHERE `adminid` = '" . $_SESSION['adminid'] . "'"); } /** * GET BrightGamePanel Database INFORMATION * Load 'values' from `config` Table */ $panelName = query_fetch_assoc("SELECT `value` FROM `" . DBPREFIX . "config` WHERE `setting` = 'panelname' LIMIT 1"); $panelVersion = query_fetch_assoc("SELECT `value` FROM `" . DBPREFIX . "config` WHERE `setting` = 'panelversion' LIMIT 1"); $template = query_fetch_assoc("SELECT `value` FROM `" . DBPREFIX . "config` WHERE `setting` = 'admintemplate' LIMIT 1"); $maintenance = query_fetch_assoc("SELECT `value` FROM `" . DBPREFIX . "config` WHERE `setting` = 'maintenance' LIMIT 1"); /** * GET BGP CORE FILES INFORMATION * Load version.xml (ROOT/.version/version.xml) */ $bgpCoreInfo = simplexml_load_file('../.version/version.xml'); /**
### if (!is_numeric($adminid)) { $error .= T_('Invalid AdminID. '); } else { if (query_numrows("SELECT `username` FROM `" . DBPREFIX . "admin` WHERE `adminid` = '" . $adminid . "'") == 0) { $error .= T_('Invalid AdminID. '); } } ### 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 . "admin` SET `notes` = '" . $notes . "' WHERE `adminid` = '" . $adminid . "'"); ### $_SESSION['msg1'] = T_('Personal Notes Updated Successfully!'); $_SESSION['msg2'] = T_('Your changes to your personal notes have been saved.'); $_SESSION['msg-type'] = 'success'; header("Location: index.php"); die; break; default: exit('<h1><b>Error</b></h1>'); } exit('<h1><b>403 Forbidden</b></h1>'); //If the task is incorrect or unspecified, we drop the user.
### 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 . "'"); ### $_SESSION['msg1'] = T_('Personal Notes Updated Successfully!'); $_SESSION['msg2'] = T_('Your changes to your personal notes have been saved.'); $_SESSION['msg-type'] = 'success'; header("Location: index.php"); die; break; default: exit('<h1><b>Error</b></h1>'); } exit('<h1><b>403 Forbidden</b></h1>'); //If the task is incorrect or unspecified, we drop the user.
$_SESSION['msg1'] = T_('Connection Error!'); $_SESSION['msg2'] = $ssh; $_SESSION['msg-type'] = 'error'; header("Location: scriptsummary.php?id=" . urlencode($scriptid)); die; } $session = $ssh->exec("screen -ls | awk '{ print \$1 }' | grep '^[0-9]*\\." . $script['screen'] . "\$'" . "\n"); $session = trim($session); #-----------------+ $cmd = "screen -S " . $session . " -X quit" . "\n"; $ssh->exec($cmd . "\n"); #-----------------+ $ssh->disconnect(); //Mark the script as stopped query_basic("UPDATE `" . DBPREFIX . "script` SET `panelstatus` = 'Stopped' WHERE `scriptid` = '" . $scriptid . "'"); ### //Adding event to the database $message = 'Script Stopped : ' . mysql_real_escape_string($script['name']); query_basic("INSERT INTO `" . DBPREFIX . "log` SET `scriptid` = '" . $scriptid . "', `message` = '" . $message . "', `name` = '" . mysql_real_escape_string($_SESSION['clientusername']) . "', `ip` = '" . $_SERVER['REMOTE_ADDR'] . "'"); ### $_SESSION['msg1'] = T_('Script Successfully Stopped!'); $_SESSION['msg2'] = ''; $_SESSION['msg-type'] = 'info'; header("Location: scriptsummary.php?id=" . urlencode($scriptid)); die; break; default: exit('<h1><b>Error</b></h1>'); } exit('<h1><b>403 Forbidden</b></h1>'); //If the task is incorrect or unspecified, we drop the user.
++$n; } #-----------------+ $cmd = "screen -AdmSL " . $server['screen'] . " nice -n " . $server['priority'] . " " . $startline; $ssh->exec('cd ' . dirname($server['path']) . '; ' . $cmd . "\n"); #-----------------+ if (preg_match("#^xvfb-run#", $server['startline'])) { //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ // Xvfb - virtual framebuffer X server for X - Xvfb pid backup sleep(3); $ssh->exec('cd ' . dirname($server['path']) . '; pgrep -u ' . $box['login'] . ' Xvfb -n > xvfb.pid.tmp'); //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ } $ssh->disconnect(); query_basic("UPDATE `" . DBPREFIX . "server` SET `panelstatus` = 'Started' WHERE `serverid` = '" . $serverid . "'"); ### //Adding event to the database $message = 'Server Rebooted : ' . mysql_real_escape_string($server['name']); query_basic("INSERT INTO `" . DBPREFIX . "log` SET `serverid` = '" . $serverid . "', `message` = '" . $message . "', `name` = '" . $_SESSION['clientfirstname'] . " " . $_SESSION['clientlastname'] . "', `ip` = '" . $_SERVER['REMOTE_ADDR'] . "'"); ### $_SESSION['msg1'] = T_('Server Successfully Rebooted!'); $_SESSION['msg2'] = ''; $_SESSION['msg-type'] = 'info'; header("Location: server.php?id=" . urlencode($serverid)); die; break; default: exit('<h1><b>Error</b></h1>'); } exit('<h1><b>403 Forbidden</b></h1>'); //If the task is incorrect or unspecified, we drop the user.
} ### if (isset($removeids)) { // Remove groupID from groupMember table foreach ($removeids as $key => $value) { $groupids = query_fetch_assoc("SELECT `groupids` FROM `" . DBPREFIX . "groupMember` WHERE `clientid` = '" . $value . "'"); ### $groupids['groupids'] = str_replace($groupid . ';', '', $groupids['groupids']); ### if (empty($groupids['groupids'])) { query_basic("DELETE FROM `" . DBPREFIX . "groupMember` WHERE `clientid` = '" . $value . "' LIMIT 1"); } else { query_basic("UPDATE `" . DBPREFIX . "groupMember` SET `groupids` = '" . $groupids['groupids'] . "' WHERE `clientid` = '" . $value . "'"); } unset($groupids); } } ### query_basic("DELETE FROM `" . DBPREFIX . "group` WHERE `groupid` = '" . $groupid . "' LIMIT 1"); ### $_SESSION['msg1'] = T_('Group Deleted Successfully!'); $_SESSION['msg2'] = T_('The selected group has been removed.'); $_SESSION['msg-type'] = 'success'; header("Location: configgroup.php"); die; break; default: exit('<h1><b>Error</b></h1>'); } exit('<h1><b>403 Forbidden</b></h1>'); //If the task is incorrect or unspecified, we drop the user.
header('Location: index.php'); die; } $ansi = new File_ANSI(); // We retrieve screen name ($session) $session = $ssh->exec("screen -ls | awk '{ print \$1 }' | grep '^[0-9]*\\." . $server['screen'] . "\$'" . "\n"); $session = trim($session); if (!empty($_GET['cmd'])) { $cmdRcon = $_GET['cmd']; // We prepare and we send the command into the screen $cmd = "screen -S " . $session . " -p 0 -X stuff \"" . $cmdRcon . "\"`echo -ne '\r'`"; $ssh->exec($cmd . "\n"); unset($cmd); // Adding event to the database $message = 'RCON command (' . mysql_real_escape_string($cmdRcon) . ') sent to : ' . 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'] . "'"); unset($cmdRcon); header('Location: utilitiesrcontool.php?serverid=' . urlencode($serverid)); die; } // We retrieve screen contents $ssh->write("screen -R " . $session . "\n"); $ssh->setTimeout(1); @$ansi->appendString($ssh->read()); $screenContents = htmlspecialchars_decode(strip_tags($ansi->getScreen())); $ssh->disconnect(); unset($session); include "./bootstrap/header.php"; /** * Notifications */
} ### if (!empty($error)) { $_SESSION['msg1'] = T_('Validation Error!'); $_SESSION['msg2'] = $error; $_SESSION['msg-type'] = 'error'; unset($error); header("Location: index.php"); die; } ### if (query_numrows("SELECT `serverid` FROM `" . DBPREFIX . "server` WHERE `gameid` = '" . $gameid . "'") != 0) { $_SESSION['msg1'] = T_('Error!'); $_SESSION['msg2'] = T_('The selected game cannot be deleted as it is currently in use by a game server. The server must be deleted first.'); $_SESSION['msg-type'] = 'error'; header("Location: configgame.php"); die; } ### query_basic("DELETE FROM `" . DBPREFIX . "game` WHERE `gameid` = '" . $gameid . "' LIMIT 1"); $_SESSION['msg1'] = T_('Game Deleted Successfully!'); $_SESSION['msg2'] = T_('The selected game has been removed.'); $_SESSION['msg-type'] = 'success'; header("Location: configgame.php"); die; break; default: exit('<h1><b>Error</b></h1>'); } exit('<h1><b>403 Forbidden</b></h1>'); //If the task is incorrect or unspecified, we drop the user.
while ($rowsBoxes = mysql_fetch_assoc($boxes)) { $aes->setKey($oldPassphrase); $password = $aes->decrypt($rowsBoxes['password']); $aes->setKey($newPassphrase); $password = $aes->encrypt($password); query_basic("UPDATE `" . DBPREFIX . "box` SET `password` = '" . mysql_real_escape_string($password) . "' WHERE `boxid` = '" . $rowsBoxes['boxid'] . "'"); unset($password); } unset($boxes); } unset($line); //---------------------------------------------------------+ //Updating structure for table "log" query_basic("ALTER TABLE `" . DBPREFIX . "log` ADD `scriptid` int(8) UNSIGNED NULL"); //---------------------------------------------------------+ //Updating structure for table "script" query_basic("ALTER TABLE `" . DBPREFIX . "script` CHANGE `daemon` `type` int(1) NOT NULL "); //Updating data for table "config" query_basic("UPDATE `" . DBPREFIX . "config` SET `value` = '0.3.5' WHERE `setting` = 'panelversion' LIMIT 1"); query_basic("\n\t\tINSERT INTO `" . DBPREFIX . "config` (`setting`, `value`)\n\t\tVALUES\n\t\t ('maintenance', '0') ; "); //---------------------------------------------------------+ //Dumping data for table "game" query_basic("\n\t\tINSERT INTO `" . DBPREFIX . "game` (`game`, `status`, `maxslots`, `defaultport`, `cfg1name`, `cfg1`, `cfg2name`, `cfg2`, `cfg3name`, `cfg3`, `cfg4name`, `cfg4`, `cfg5name`, `cfg5`, `cfg6name`, `cfg6`, `cfg7name`, `cfg7`, `cfg8name`, `cfg8`, `cfg9name`, `cfg9`, `startline`, `querytype`, `queryport`, `cachedir`)\n\t\tVALUES\n\t\t ('ArmA: Armed Assault (*)', 'Active', '64', '2302', 'Server CFG File', 'server.cfg', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', './server -config={cfg1} -netlog -port={port}', 'arma', '2302', ''),\n\t\t ('Battlefield 2 (*)', 'Active', '64', '16567', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', './start.sh', 'bf2', '29900', ''),\n\t\t ('Battlefield 1942 (*)', 'Active', '64', '14567', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', './start.sh +statusMonitor 1', 'bf1942', '23000', ''),\n\t\t ('Multi Theft Auto (*)', 'Active', '128', '22003', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', './mta-server', 'mta', '22126', ''),\n\t\t ('San Andreas: Multiplayer (SA-MP) (*)', 'Active', '128', '7777', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', './samp03svr', 'samp', '7777', ''),\n\t\t ('Urban Terror (*)', 'Active', '32', '27960', 'Server CFG File', 'server.cfg', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', './ioUrTded.i386 +set fs_game q3ut4 +set net_port {port} +set com_hunkmegs 128 +exec {cfg1} +set dedicated 2', 'urbanterror', '27960', '') ; "); //---------------------------------------------------------+ //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ mysql_close($mysql_link); } } //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
query_basic("ALTER TABLE `" . DBPREFIX . "box` ADD `swap` text NOT NULL"); query_basic("ALTER TABLE `" . DBPREFIX . "box` ADD `hdd` text NOT NULL"); //---------------------------------------------------------+ $boxes = mysql_query("SELECT `boxid`, `password` FROM `" . DBPREFIX . "box`"); while ($rowsBoxes = mysql_fetch_assoc($boxes)) { $password = base64_decode($rowsBoxes['password']); $password = $aes->encrypt($password); query_basic("UPDATE `" . DBPREFIX . "box` SET\n\t\t\t\t`password` = '" . mysql_real_escape_string($password) . "',\n\t\t\t\t`hostname` = '~',\n\t\t\t\t`os` = '~',\n\t\t\t\t`date` = '~',\n\t\t\t\t`kernel` = '~',\n\t\t\t\t`arch` = '~',\n\t\t\t\t`uptime` = '~',\n\t\t\t\t`swap` = '~',\n\t\t\t\t`hdd` = '~' WHERE `boxid` = '" . $rowsBoxes['boxid'] . "'"); unset($password); } unset($boxes); //---------------------------------------------------------+ //Table structure for table "boxData" query_basic("DROP TABLE IF EXISTS `" . DBPREFIX . "boxData` ; "); query_basic("\n\t\tCREATE TABLE `" . DBPREFIX . "boxData` (\n\t\t `id` int(8) UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t `timestamp` text NOT NULL,\n\t\t `boxids` text NOT NULL,\n\t\t `boxnetstat` text NOT NULL,\n\t\t `players` text NOT NULL,\n\t\t `cpu` text NOT NULL,\n\t\t `ram` text NOT NULL,\n\t\t `loadavg` text NOT NULL,\n\t\t `hdd` text NOT NULL,\n\t\t PRIMARY KEY (`id`)\n\t\t)\n\t\tENGINE=MyISAM ; "); //---------------------------------------------------------+ //Dumping data for table "config" query_basic("DELETE FROM `" . DBPREFIX . "config` WHERE `setting` = 'template' AND `value` = 'Bootstrap' LIMIT 1"); query_basic("\n\t\tINSERT INTO `" . DBPREFIX . "config` (`setting`, `value`)\n\t\tVALUES\n\t\t ('admintemplate', 'bootstrap.css'),\n\t\t ('clienttemplate', 'bootstrap.css') ; "); query_basic("UPDATE `" . DBPREFIX . "config` SET `value` = '0.1.1' WHERE `setting` = 'panelversion' LIMIT 1"); query_basic("UPDATE `" . DBPREFIX . "config` SET `value` = 'default' WHERE `setting` = 'template' LIMIT 1"); //---------------------------------------------------------+ //Dumping data for table "game" query_basic("\n\t\tINSERT INTO `" . DBPREFIX . "game` (`game`, `status`, `maxslots`, `defaultport`, `cfg1name`, `cfg1`, `cfg2name`, `cfg2`, `cfg3name`, `cfg3`, `cfg4name`, `cfg4`, `cfg5name`, `cfg5`, `cfg6name`, `cfg6`, `cfg7name`, `cfg7`, `cfg8name`, `cfg8`, `cfg9name`, `cfg9`, `startline`, `querytype`, `queryport`, `cachedir`)\n\t\tVALUES\n\t\t ('Call of Duty: Modern Warfare 3 (*)', 'Active', '18', '27015', 'net_queryPort', '27014', 'net_authPort', '8766', 'net_masterServerPort', '27016', 'Server CFG File', 'server.cfg', '', '', '', '', '', '', '', '', '', '', 'xvfb-run -a wine iw5mp_server.exe +set sv_config {cfg4} +set sv_maxclients {slots} +start_map_rotate +set net_ip {ip} +set net_port {port} +set net_queryPort {cfg1} +set net_authPort {cfg2} +set net_masterServerPort {cfg3} +set dedicated 2', 'callofdutymw3', '27014', ''),\n\t\t ('Call of Duty 2 (*)', 'Active', '32', '28960', 'Server CFG', 'server.cfg', 'fs_homepath', '/home/user/cod2', 'fs_basepath', '/home/user/cod2', '', '', '', '', '', '', '', '', '', '', '', '', './cod2_lnxded +exec {cfg1} +map_rotate +set net_ip {ip} +set net_port {port} +set fs_homepath {cfg2} +set fs_basepath {cfg3} +set dedicated 2', 'callofduty2', '28960', ''),\n\t\t ('Call of Duty: World at War (*)', 'Active', '32', '28960', 'Server CFG File', 'server.cfg', 'fs_homepath', '/home/user/codwaw', 'fs_basepath', '/home/user/codwaw', '', '', '', '', '', '', '', '', '', '', '', '', './codwaw_lnxded +exec {cfg1} +set sv_maxclients {slots} +map_rotate +set net_ip {ip} +set net_port {port} +set fs_homepath {cfg2} +set fs_basepath {cfg3} +set dedicated 2', 'callofdutywaw', '28960', ''),\n\t\t ('Wolfenstein: Enemy Territory (*)', 'Active', '32', '27960', 'Server CFG File', 'server.cfg', 'fs_homepath', '/home/user/wolfet', 'fs_basepath', '/home/user/wolfet', '', '', '', '', '', '', '', '', '', '', '', '', './etded +exec {cfg1} +sv_maxclients {slots} +set fs_homepath {cfg2} +set fs_basepath {cfg3} +set net_port {port}', 'wolfet', '27960', ''),\n\t\t ('ArmA: 2 (*)', 'Active', '64', '2302', 'Server CFG File', 'server.cfg', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', './server -config={cfg1} -netlog -port={port}', 'arma2', '2302', '') ; "); //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ mysql_close($mysql_link); } } //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+