mirror of
https://github.com/easy-wi/developer.git
synced 2025-02-20 11:23:28 +08:00
#207: Improve map group support
This commit is contained in:
parent
03676b0cb7
commit
760bd5ffee
@ -142,9 +142,14 @@ function popup(url) {
|
||||
window.open(url, "popup_id", "scrollbars,resizable,width=1024,height=756");
|
||||
return false;
|
||||
}
|
||||
function SwitchShowHideRows (Element) {
|
||||
function SwitchShowHideRows (Element, change) {
|
||||
var TheRest = document.getElementsByTagName('div');
|
||||
var ElementLenght = Element.length;
|
||||
|
||||
if(typeof(change)==='undefined') {
|
||||
change = 'switch';
|
||||
}
|
||||
|
||||
for(var x=0; x<TheRest.length; x++) {
|
||||
var TheClass = TheRest[x].getAttribute('class');
|
||||
if (TheClass != null) {
|
||||
@ -155,7 +160,7 @@ function SwitchShowHideRows (Element) {
|
||||
TheRest[x].style.display = '';
|
||||
}
|
||||
} else {
|
||||
if (TheClass.indexOf('switch')!=-1) {
|
||||
if (TheClass.indexOf(change)!=-1) {
|
||||
if (TheClass.substring(0,ElementLenght) == Element) {
|
||||
if (TheRest[x].style.display == 'none') {
|
||||
TheRest[x].style.display = '';
|
||||
|
@ -301,6 +301,72 @@ class EasyWiFTP {
|
||||
return $dir;
|
||||
}
|
||||
|
||||
public function getMapGroups () {
|
||||
|
||||
$mapGroups = array();
|
||||
|
||||
$contents = $this->getTempFileContent();
|
||||
if (!is_array($contents)) {
|
||||
$contents = array($contents);
|
||||
}
|
||||
|
||||
foreach ($contents as $content) {
|
||||
|
||||
@list($buffer, $mapgroupsRaw) = explode('"mapgroups"', $content);
|
||||
|
||||
if ($mapgroupsRaw) {
|
||||
|
||||
$mapGroupStarted = false;
|
||||
$mapGroupBlockStarted = false;
|
||||
$mapGroupMapsBlockStarted = false;
|
||||
|
||||
$splitConfig = preg_split('/\n/',str_replace("\r", '', str_replace(array("\0", "\b", "\r", "\Z"), '', $mapgroupsRaw)) , -1, PREG_SPLIT_NO_EMPTY);
|
||||
|
||||
foreach ($splitConfig as $line) {
|
||||
if (isset($mapGroupStarted) and $mapGroupStarted) {
|
||||
|
||||
if ($mapGroupBlockStarted) {
|
||||
|
||||
if ($mapGroupMapsBlockStarted and preg_match('/^[\s+]{0,}[\}][\s+]{0,}$/', $line)) {
|
||||
$mapGroupMapsBlockStarted = false;
|
||||
} else if (!$mapGroupMapsBlockStarted and preg_match('/^[\s+]{0,}[\{][\s+]{0,}$/', $line)) {
|
||||
$mapGroupMapsBlockStarted = true;
|
||||
} else if (!$mapGroupMapsBlockStarted and preg_match('/^[\s+]{0,}[\}][\s+]{0,}$/', $line)) {
|
||||
$mapGroupBlockStarted = false;
|
||||
}
|
||||
|
||||
} else if (!$mapGroupBlockStarted and preg_match('/^[\s+]{0,}[\{][\s+]{0,}$/', $line)) {
|
||||
$mapGroupBlockStarted = true;
|
||||
|
||||
} else if (substr_count($line, '"') == 2 and !$mapGroupBlockStarted and !$mapGroupMapsBlockStarted) {
|
||||
$mapGroups[] = preg_replace('/\s/', '', str_replace('"', '', $line));
|
||||
|
||||
} else if (!$mapGroupBlockStarted and !$mapGroupMapsBlockStarted and preg_match('/^[\s+]{0,}[\}][\s+]{0,}$/', $line)) {
|
||||
unset($mapGroupStarted);
|
||||
}
|
||||
} else if (isset($mapGroupStarted) and !$mapGroupStarted and preg_match('/^[\s+]{0,}[\{][\s+]{0,}$/', $line)) {
|
||||
$mapGroupStarted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
natsort($mapGroups);
|
||||
|
||||
return $mapGroups;
|
||||
|
||||
}
|
||||
|
||||
public function removeTempFiles () {
|
||||
if (is_array($this->tempHandle)) {
|
||||
foreach (array_keys($this->tempHandle) as $k) {
|
||||
fclose($this->tempHandle[$k]);
|
||||
}
|
||||
} else if (is_resource($this->tempHandle)) {
|
||||
fclose($this->tempHandle);
|
||||
}
|
||||
}
|
||||
|
||||
function __destruct() {
|
||||
|
||||
if (is_resource($this->ftpConnection)) {
|
||||
@ -311,12 +377,6 @@ class EasyWiFTP {
|
||||
ftp_close($this->ftpSecondConnection);
|
||||
}
|
||||
|
||||
if (is_array($this->tempHandle)) {
|
||||
foreach (array_keys($this->tempHandle) as $k) {
|
||||
fclose($this->tempHandle[$k]);
|
||||
}
|
||||
} else if (is_resource($this->tempHandle)) {
|
||||
fclose($this->tempHandle);
|
||||
}
|
||||
$this->removeTempFiles();
|
||||
}
|
||||
}
|
@ -39,8 +39,9 @@ if ((!isset($main) or $main != 1) or (!isset($user_id) or (isset($user_id) and !
|
||||
die('No acces');
|
||||
}
|
||||
|
||||
include(EASYWIDIR . '/stuff/keyphrasefile.php');
|
||||
include(EASYWIDIR . '/stuff/class_ftp.php');
|
||||
include(EASYWIDIR . '/stuff/ssh_exec.php');
|
||||
include(EASYWIDIR . '/stuff/keyphrasefile.php');
|
||||
|
||||
$sprache = getlanguagefile('gserver',$user_language,$reseller_id);
|
||||
$loguserid = $user_id;
|
||||
@ -188,108 +189,160 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
$hlds_6 = $row['hlds_6'];
|
||||
}
|
||||
|
||||
$query = $sql->prepare("SELECT `id`,AES_DECRYPT(`ftppassword`,?) AS `cftppass`,CONCAT(`serverip`,':',`port`) AS `server`,`eacallowed`,`serverid` FROM `gsswitch` WHERE `id`=? AND `userid`=? AND `resellerid`=? LIMIT 1");
|
||||
$query->execute(array($aeskey,$id,$user_id,$reseller_id));
|
||||
$query = $sql->prepare("SELECT g.`id`,g.`serverip`,g.`port`,g.`eacallowed`,g.`serverid`,g.`newlayout`,g.`protected`,AES_DECRYPT(g.`ftppassword`,?) AS `cftppass`,AES_DECRYPT(g.`ppassword`,?) AS `pftppass`,u.`cname`,r.`ftpport` FROM `gsswitch` g INNER JOIN `userdata` u ON g.`userid`=u.`id` INNER JOIN `rserverdata` r ON g.`rootID`=r.`id` WHERE g.`id`=? AND g.`userid`=? AND g.`resellerid`=? LIMIT 1");
|
||||
$query->execute(array($aeskey, $aeskey, $id, $user_id, $reseller_id));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
$address = $row['server'];
|
||||
$gsIP = $row['serverip'];
|
||||
$gsPort = $row['port'];
|
||||
$ftppass = $row['cftppass'];
|
||||
$eacallowed = $row['eacallowed'];
|
||||
$serverID = $row['serverid'];
|
||||
$eacallowed = $row['eacallowed'];
|
||||
$ftpPort = $row['ftpport'];
|
||||
$protected = $row['protected'];
|
||||
|
||||
$address = $row['serverip'] . ':' .$row['port'];
|
||||
$ftpUser = ($row['newlayout'] == 'Y') ? $row['cname'] . '-' . $row['id'] : $row['cname'];
|
||||
|
||||
if ($row['protected']) {
|
||||
$ftpUser .= '-p';
|
||||
$pserverFolder = '';
|
||||
$ftpPWD = $row['pftppass'];
|
||||
} else {
|
||||
$pserverFolder = 'server/';
|
||||
$ftpPWD = $row['cftppass'];
|
||||
}
|
||||
}
|
||||
|
||||
$query = $sql->prepare("SELECT s.*,AES_DECRYPT(s.`uploaddir`,?) AS `decypteduploaddir`,AES_DECRYPT(s.`webapiAuthkey`,?) AS `dwebapiAuthkey`,t.`description`,t.`qstat`,t.`shorten`,t.`modcmds`,t.`mapGroup` AS `defaultMapGroup`,t.`ftpAccess`,t.`appID`,t.`map` AS `defaultmap` FROM `serverlist` s INNER JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE s.`switchID`=? AND s.`resellerid`=?");
|
||||
$query->execute(array($aeskey,$aeskey,$id,$reseller_id));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
$gshorten = $row['shorten'];
|
||||
$qstat = $row['qstat'];
|
||||
$anticheat = $row['anticheat'];
|
||||
if (isset($gsIP)) {
|
||||
|
||||
if ($row['ftpAccess'] == 'N') {
|
||||
$ftpAccess = 'N';
|
||||
$query = $sql->prepare("SELECT 1 FROM `serverlist` s INNER JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE s.`switchID`=? AND s.`resellerid`=? AND (t.`mapGroup` IS NOT NULL OR t.`mapGroup`!='') LIMIT 1");
|
||||
$query->execute(array($id,$reseller_id));
|
||||
|
||||
if ($query->rowCount() > 0) {
|
||||
$ftp = new EasyWiFTP($gsIP, $ftpPort, $ftpUser, $ftpPWD);
|
||||
}
|
||||
|
||||
if ($qstat == 'a2s' and $row['user_uploaddir'] == 'Y' and $row['upload']>1 and $row['upload']<4) {
|
||||
$uploaddir = $row['decypteduploaddir'];
|
||||
$upload = true;
|
||||
} else {
|
||||
$upload = false;
|
||||
$uploaddir = '';
|
||||
}
|
||||
if ($qstat=="a2s" or $qstat=="hla2s") {
|
||||
$anticheatsoft="Valve Anti Cheat";
|
||||
} else if ($qstat=="cods") {
|
||||
$anticheatsoft="Punkbuster";
|
||||
} else {
|
||||
$anticheatsoft = '';
|
||||
}
|
||||
if ($row['id'] == $serverID) {
|
||||
$currentTemplate = $gshorten;
|
||||
$displayNone = '';
|
||||
$displayNoneBoot='in';
|
||||
$option='<option value="'.$row['id'].'" selected="selected">'.$gshorten.'</option>';
|
||||
} else {
|
||||
$displayNone='display_none';
|
||||
$displayNoneBoot = '';
|
||||
$option='<option value="'.$row['id'].'">'.$gshorten.'</option>';
|
||||
}
|
||||
$eac = array();
|
||||
if ($rowcount>0 and $eacallowed == 'Y' and ($gshorten=="css" or $gshorten=="cod4" or $gshorten=="cstrike" or $gshorten=="czero" or $gshorten=="tf")) {
|
||||
if ($gshorten=="cstrike" or $gshorten=="czero") {
|
||||
if ($anticheat==3 and $hlds_3 == 'Y') {
|
||||
$eac[] = '<option value="3" selected="selected">Easy Anti Cheat</option>';
|
||||
} else if ($hlds_3 == 'Y') {
|
||||
$eac[] = '<option value="3">Easy Anti Cheat</option>';
|
||||
}
|
||||
if ($anticheat==4 and $hlds_4 == 'Y') {
|
||||
$eac[] = '<option value="4" selected="selected">Easy Anti Cheat Public</option>';
|
||||
} else if ($hlds_4 == 'Y') {
|
||||
$eac[] = '<option value="4">Easy Anti Cheat Public</option>';
|
||||
}
|
||||
if ($anticheat==5 and $hlds_5 == 'Y') {
|
||||
$eac[] = '<option value="5" selected="selected">Easy Anti Cheat 32Bit</option>';
|
||||
} else if ($hlds_5 == 'Y') {
|
||||
$eac[] = '<option value="5">Easy Anti Cheat 32Bit</option>';
|
||||
}
|
||||
if ($anticheat==6 and $hlds_6 == 'Y') {
|
||||
$eac[] = '<option value="6" selected="selected">Easy Anti Cheat Public 32Bit</option>';
|
||||
} else if ($hlds_6 == 'Y') {
|
||||
$eac[] = '<option value="6">Easy Anti Cheat Public 32Bit</option>';
|
||||
}
|
||||
$query = $sql->prepare("SELECT s.*,AES_DECRYPT(s.`uploaddir`,?) AS `decypteduploaddir`,AES_DECRYPT(s.`webapiAuthkey`,?) AS `dwebapiAuthkey`,t.`modfolder`,t.`description`,t.`gamebinary`,t.`shorten`,t.`modcmds`,t.`ftpAccess`,t.`appID`,t.`workShop` AS `workShopAllowed`,t.`map` AS `defaultmap`,t.`mapGroup` AS `defaultMapGroup` FROM `serverlist` s INNER JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE s.`switchID`=? AND s.`resellerid`=?");
|
||||
$query->execute(array($aeskey,$aeskey,$id,$reseller_id));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
$eac = array();
|
||||
$mods = array();
|
||||
|
||||
$gshorten = $row['shorten'];
|
||||
$anticheat = $row['anticheat'];
|
||||
|
||||
if ($row['ftpAccess'] == 'N') {
|
||||
$ftpAccess = 'N';
|
||||
}
|
||||
|
||||
if ($row['gamebinary'] == 'srcds_run' and $row['user_uploaddir'] == 'Y' and $row['upload']>1 and $row['upload']<4) {
|
||||
$uploaddir = $row['decypteduploaddir'];
|
||||
$upload = true;
|
||||
} else {
|
||||
if ($anticheat==3 and $normal_3 == 'Y') {
|
||||
$eac[] = '<option value="3" selected="selected">Easy Anti Cheat</option>';
|
||||
} else if ($normal_3 == 'Y') {
|
||||
$eac[] = '<option value="3">Easy Anti Cheat</option>';
|
||||
}
|
||||
if ($anticheat==4 and $normal_4 == 'Y') {
|
||||
$eac[] = '<option value="4" selected="selected">Easy Anti Cheat Public</option>';
|
||||
} else if ($normal_4 == 'Y') {
|
||||
$eac[] = '<option value="4">Easy Anti Cheat Public</option>';
|
||||
$upload = false;
|
||||
$uploaddir = '';
|
||||
}
|
||||
|
||||
if ($row['gamebinary'] == 'srcds_run' or $row['gamebinary'] == 'hlds_run') {
|
||||
$anticheatsoft="Valve Anti Cheat";
|
||||
} else if ($row['gamebinary'] == 'cod4_lnxded') {
|
||||
$anticheatsoft = 'Punkbuster';
|
||||
} else {
|
||||
$anticheatsoft = '';
|
||||
}
|
||||
|
||||
if ($row['id'] == $serverID) {
|
||||
$currentTemplate = $gshorten;
|
||||
$displayNone = '';
|
||||
$displayNoneBoot = 'in';
|
||||
$option = '<option value="'.$row['id'].'" selected="selected">'.$gshorten.'</option>';
|
||||
} else {
|
||||
$displayNone = 'display_none';
|
||||
$displayNoneBoot = '';
|
||||
$option = '<option value="'.$row['id'].'">'.$gshorten.'</option>';
|
||||
}
|
||||
|
||||
|
||||
if ($rowcount > 0 and $eacallowed == 'Y' and ($gshorten == 'css' or $gshorten == 'cod4' or $gshorten == 'cstrike' or $gshorten == 'czero' or $gshorten == 'tf')) {
|
||||
|
||||
if ($gshorten == 'cstrike' or $gshorten == 'czero') {
|
||||
if ($anticheat==3 and $hlds_3 == 'Y') {
|
||||
$eac[] = '<option value="3" selected="selected">Easy Anti Cheat</option>';
|
||||
} else if ($hlds_3 == 'Y') {
|
||||
$eac[] = '<option value="3">Easy Anti Cheat</option>';
|
||||
}
|
||||
if ($anticheat==4 and $hlds_4 == 'Y') {
|
||||
$eac[] = '<option value="4" selected="selected">Easy Anti Cheat Public</option>';
|
||||
} else if ($hlds_4 == 'Y') {
|
||||
$eac[] = '<option value="4">Easy Anti Cheat Public</option>';
|
||||
}
|
||||
if ($anticheat==5 and $hlds_5 == 'Y') {
|
||||
$eac[] = '<option value="5" selected="selected">Easy Anti Cheat 32Bit</option>';
|
||||
} else if ($hlds_5 == 'Y') {
|
||||
$eac[] = '<option value="5">Easy Anti Cheat 32Bit</option>';
|
||||
}
|
||||
if ($anticheat==6 and $hlds_6 == 'Y') {
|
||||
$eac[] = '<option value="6" selected="selected">Easy Anti Cheat Public 32Bit</option>';
|
||||
} else if ($hlds_6 == 'Y') {
|
||||
$eac[] = '<option value="6">Easy Anti Cheat Public 32Bit</option>';
|
||||
}
|
||||
} else {
|
||||
if ($anticheat==3 and $normal_3 == 'Y') {
|
||||
$eac[] = '<option value="3" selected="selected">Easy Anti Cheat</option>';
|
||||
} else if ($normal_3 == 'Y') {
|
||||
$eac[] = '<option value="3">Easy Anti Cheat</option>';
|
||||
}
|
||||
if ($anticheat==4 and $normal_4 == 'Y') {
|
||||
$eac[] = '<option value="4" selected="selected">Easy Anti Cheat Public</option>';
|
||||
} else if ($normal_4 == 'Y') {
|
||||
$eac[] = '<option value="4">Easy Anti Cheat Public</option>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$mods = array();
|
||||
$mod = $row['modcmd'];
|
||||
foreach (explode("\r\n", $row['modcmds']) as $line) {
|
||||
if (preg_match('/^(\[[\w\/\.\-\_\= ]{1,}\])$/',$line)) {
|
||||
$name = trim($line,'[]');
|
||||
$ex=preg_split("/\=/",$name,-1,PREG_SPLIT_NO_EMPTY);
|
||||
$mods[] = trim($ex[0]);
|
||||
|
||||
$mod = $row['modcmd'];
|
||||
foreach (explode("\r\n", $row['modcmds']) as $line) {
|
||||
if (preg_match('/^(\[[\w\/\.\-\_\= ]{1,}\])$/',$line)) {
|
||||
$name = trim($line,'[]');
|
||||
$ex = preg_split("/\=/",$name,-1,PREG_SPLIT_NO_EMPTY);
|
||||
$mods[] = trim($ex[0]);
|
||||
}
|
||||
}
|
||||
|
||||
$workshopCollection = false;
|
||||
if ($row['workShopAllowed'] == 'Y') {
|
||||
$workshopCollection = $row['workshopCollection'];
|
||||
}
|
||||
|
||||
$mapGroupsAvailable = array();
|
||||
|
||||
if (!in_array($row['defaultMapGroup'],array('',null))) {
|
||||
|
||||
if ($ftp->loggedIn) {
|
||||
$serverTemplate = ($row['servertemplate'] == 1 or $protected == 'Y') ? $row['shorten'] : $row['shorten'] . '-' . $row['servertemplate'];
|
||||
$ftp->downloadToTemp($pserverFolder . $gsIP . '_' . $gsPort . '/' . $serverTemplate . '/' . $row['modfolder'] . '/', 0, array('gamemodes.txt','gamemodes_server.txt'));
|
||||
$mapGroupsAvailable = $ftp->getMapGroups();
|
||||
$ftp->removeTempFiles();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$map = (!in_array($row['defaultmap'], array('', null))) ? $row['map'] : null;
|
||||
|
||||
$table[] = array('id' => $row['id'], 'cmd' => $row['cmd'], 'fps' =>$row['fps'], 'tic' => $row['tic'], 'map' => $map, 'workShop' => $row['workShop'],'workshopCollection' => $workshopCollection,'webapiAuthkey' => $row['dwebapiAuthkey'], 'mapGroup' => $row['mapGroup'], 'defaultMapGroup' => $row['defaultMapGroup'], 'mapGroupsAvailable' => $mapGroupsAvailable, 'servertemplate' => $row['servertemplate'], 'userfps' => $row['userfps'], 'usertick' => $row['usertick'], 'usermap' => $row['usermap'], 'description' => $row['description'], 'option' => $option, 'gamebinary' => $row['gamebinary'],'upload' => $upload,'uploaddir' => $uploaddir,'anticheat' => $anticheat,'anticheatsoft' => $anticheatsoft,'eac' => $eac,'shorten' => $gshorten,'mod' => $mod,'mods' => $mods,'displayNone' => $displayNone,'displayNoneBoot' => $displayNoneBoot);
|
||||
$i++;
|
||||
}
|
||||
$workshopCollection = false;
|
||||
if (in_array($row['appID'], array(560,730,740))) {
|
||||
$workshopCollection = $row['workshopCollection'];
|
||||
}
|
||||
$map=(!in_array($row['defaultmap'], array('', null))) ? $row['map'] : null;
|
||||
$table[] = array('id' => $row['id'], 'cmd' => $row['cmd'], 'fps' =>$row['fps'], 'tic' => $row['tic'], 'map' => $map,'workshopCollection' => $workshopCollection,'webapiAuthkey' => $row['dwebapiAuthkey'], 'mapGroup' => $row['mapGroup'], 'defaultMapGroup' => $row['defaultMapGroup'], 'servertemplate' => $row['servertemplate'], 'userfps' => $row['userfps'], 'usertick' => $row['usertick'], 'usermap' => $row['usermap'], 'description' => $row['description'], 'option' => $option,'qstat' => $qstat,'upload' => $upload,'uploaddir' => $uploaddir,'anticheat' => $anticheat,'anticheatsoft' => $anticheatsoft,'eac' => $eac,'shorten' => $gshorten,'mod' => $mod,'mods' => $mods,'displayNone' => $displayNone,'displayNoneBoot' => $displayNoneBoot);
|
||||
$i++;
|
||||
|
||||
$ftp = null;
|
||||
}
|
||||
$template_file = ($i>0) ? 'userpanel_gserver_md.tpl' : 'userpanel_404.tpl';
|
||||
|
||||
$template_file = ($i > 0) ? 'userpanel_gserver_md.tpl' : 'userpanel_404.tpl';
|
||||
|
||||
} else if ($ui->smallletters('action',2, 'post') == 'md' and $ui->id('shorten',19, 'post')) {
|
||||
|
||||
$switchID = $ui->id('shorten',19, 'post');
|
||||
|
||||
$query = $sql->prepare("SELECT `active`,`normal_3`,`normal_4`,`hlds_3`,`hlds_4`,`hlds_5`,`hlds_6` FROM `eac` WHERE `resellerid`=? LIMIT 1");
|
||||
$query->execute(array($reseller_id));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
@ -301,6 +354,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
$hlds_5 = $row['hlds_5'];
|
||||
$hlds_6 = $row['hlds_6'];
|
||||
}
|
||||
|
||||
$query = $sql->prepare("SELECT g.*,AES_ENCRYPT(g.`ftppassword`,?) AS `encrypted`,AES_ENCRYPT(g.`ppassword`,?) AS `pencrypted`,u.`cname` FROM `gsswitch` g INNER JOIN `userdata` u ON g.`userid`=u.`id` WHERE g.`id`=? AND g.`resellerid`=? LIMIT 1");
|
||||
$query->execute(array($aeskey,$aeskey,$id,$reseller_id));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
@ -315,34 +369,66 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
$newlayout = $row['newlayout'];
|
||||
$server = $serverip . ':' . $port;
|
||||
}
|
||||
|
||||
$query = $sql->prepare("SELECT s.*,AES_DECRYPT(s.`uploaddir`,?) AS `decypteduploaddir`,t.`shorten`,t.`ftpAccess` FROM `serverlist` s INNER JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE s.`id`=? AND s.`resellerid`=? LIMIT 1");
|
||||
$query->execute(array($aeskey,$switchID,$reseller_id));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
$fps=($row['userfps'] == 'Y' and $ui->id("fps_${switchID}",4, 'post')) ? $ui->id("fps_${switchID}",4, 'post') : $row['fps'];
|
||||
$tic=($row['usertick'] == 'Y' and $ui->id("tic_${switchID}",4, 'post')) ? $ui->id("tic_${switchID}",4, 'post') : $row['tic'];
|
||||
$map=($row['usermap'] == 'Y' and $ui->mapname("map_${switchID}", 'post')) ? $ui->mapname("map_${switchID}", 'post') : $row['map'];
|
||||
$mapGroup=($row['usermap'] == 'Y' and $ui->mapname("mapGroup_${switchID}", 'post')) ? $ui->mapname("mapGroup_${switchID}", 'post') : $row['mapGroup'];
|
||||
$uploaddir=($row['user_uploaddir'] == 'Y' and $row['upload']>1 and $row['upload']<4) ? $ui->url("uploaddir_${switchID}", 'post') : $row['decypteduploaddir'];
|
||||
$servertemplate=($ui->id("servertemplate_${switchID}",1, 'post')) ? $ui->id("servertemplate_${switchID}",1, 'post') : 1;
|
||||
|
||||
$fps = ($row['userfps'] == 'Y' and $ui->id("fps_${switchID}", 4, 'post')) ? $ui->id("fps_${switchID}", 4, 'post') : $row['fps'];
|
||||
$tic = ($row['usertick'] == 'Y' and $ui->id("tic_${switchID}", 4, 'post')) ? $ui->id("tic_${switchID}", 4, 'post') : $row['tic'];
|
||||
$map = ($row['usermap'] == 'Y' and $ui->mapname("map_${switchID}", 'post')) ? $ui->mapname("map_${switchID}", 'post') : $row['map'];
|
||||
$mapGroup = ($row['usermap'] == 'Y' and $ui->mapname("mapGroup_${switchID}", 'post')) ? $ui->mapname("mapGroup_${switchID}", 'post') : $row['mapGroup'];
|
||||
$uploaddir = ($row['user_uploaddir'] == 'Y' and $row['upload'] > 1 and $row['upload'] < 4) ? $ui->url("uploaddir_${switchID}", 'post') : $row['decypteduploaddir'];
|
||||
$servertemplate = ($ui->id("servertemplate_${switchID}", 1, 'post')) ? $ui->id("servertemplate_${switchID}", 1, 'post') : 1;
|
||||
$modcmd = $ui->escaped("mod_${switchID}", 'post');
|
||||
$workshopCollection = $ui->id("workshopCollection_${switchID}",10, 'post');
|
||||
$webapiAuthkey = $ui->w("webapiAuthkey_${switchID}",32, 'post');
|
||||
if ($ui->id("anticheat_${switchID}",1, 'post')) {
|
||||
$anticheat=($ui->id("anticheat_${switchID}",1, 'post')>0) ? $ui->id("anticheat_${switchID}",1, 'post') : 1;
|
||||
if ($row['shorten']=="cstrike" or $row['shorten']=="czero") {
|
||||
if ($anticheat==3 and $hlds_3== 'N' and $hlds_5 == 'Y' and $active == 'Y') $anticheat = 5;
|
||||
else if ($anticheat==3 and $hlds_3== 'N' and $hlds_5== 'N' and $active == 'Y') $anticheat = 1;
|
||||
else if ($anticheat>1 and $active == 'N') $anticheat = 1;
|
||||
if ($anticheat==4 and $hlds_4== 'N' and $hlds_6 == 'Y' and $active == 'Y') $anticheat = 6;
|
||||
else if ($anticheat==4 and $hlds_4== 'N' and $hlds_6== 'N' and $active == 'Y') $anticheat = 1;
|
||||
else if ($anticheat>1 and $active == 'N') $anticheat = 1;
|
||||
if ($anticheat==5 and $hlds_5== 'N' and $active == 'Y') $anticheat = 1;
|
||||
if ($anticheat==6 and $hlds_6== 'N' and $active == 'Y') $anticheat = 1;
|
||||
if (($anticheat>6 and $active == 'Y') or $anticheat>2 and $active == 'N') $anticheat = 1;
|
||||
$workShop = ($ui->active("workShop_${switchID}", 'post')) ? $ui->active("workShop_${switchID}", 'post') : 'Y';
|
||||
$workshopCollection = $ui->id("workshopCollection_${switchID}", 10, 'post');
|
||||
$webapiAuthkey = $ui->w("webapiAuthkey_${switchID}", 32, 'post');
|
||||
|
||||
if ($ui->id("anticheat_${switchID}", 1, 'post')) {
|
||||
$anticheat=($ui->id("anticheat_${switchID}", 1, 'post')>0) ? $ui->id("anticheat_${switchID}", 1, 'post') : 1;
|
||||
|
||||
if ($row['shorten'] == 'cstrike' or $row['shorten'] == 'czero') {
|
||||
|
||||
if ($anticheat==3 and $hlds_3== 'N' and $hlds_5 == 'Y' and $active == 'Y') {
|
||||
$anticheat = 5;
|
||||
} else if ($anticheat==3 and $hlds_3== 'N' and $hlds_5== 'N' and $active == 'Y') {
|
||||
$anticheat = 1;
|
||||
} else if ($anticheat>1 and $active == 'N') {
|
||||
$anticheat = 1;
|
||||
}
|
||||
|
||||
if ($anticheat==4 and $hlds_4== 'N' and $hlds_6 == 'Y' and $active == 'Y') {
|
||||
$anticheat = 6;
|
||||
} else if ($anticheat==4 and $hlds_4== 'N' and $hlds_6== 'N' and $active == 'Y') {
|
||||
$anticheat = 1;
|
||||
} else if ($anticheat>1 and $active == 'N') {
|
||||
$anticheat = 1;
|
||||
}
|
||||
|
||||
if ($anticheat==5 and $hlds_5== 'N' and $active == 'Y') {
|
||||
$anticheat = 1;
|
||||
}
|
||||
|
||||
if ($anticheat==6 and $hlds_6== 'N' and $active == 'Y') {
|
||||
$anticheat = 1;
|
||||
}
|
||||
|
||||
if (($anticheat>6 and $active == 'Y') or $anticheat>2 and $active == 'N') {
|
||||
$anticheat = 1;
|
||||
}
|
||||
} else {
|
||||
if ($anticheat==3 and $normal_3== 'N' and $active == 'Y') $anticheat = 1;
|
||||
if ($anticheat==4 and $normal_4== 'N' and $active == 'Y') $anticheat = 1;
|
||||
if (($anticheat>4 and $active == 'Y') or $anticheat>2 and $active == 'N') $anticheat = 1;
|
||||
if ($anticheat==3 and $normal_3== 'N' and $active == 'Y') {
|
||||
$anticheat = 1;
|
||||
}
|
||||
|
||||
if ($anticheat==4 and $normal_4== 'N' and $active == 'Y') {
|
||||
$anticheat = 1;
|
||||
}
|
||||
|
||||
if (($anticheat>4 and $active == 'Y') or $anticheat>2 and $active == 'N') {
|
||||
$anticheat = 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$anticheat = 1;
|
||||
@ -351,9 +437,10 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
$ftpAccess = 'N';
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($anticheat)) {
|
||||
$query = $sql->prepare("UPDATE `serverlist` SET `anticheat`=?,`fps`=?,`tic`=?,`map`=?,`workshopCollection`=?,`mapGroup`=?,`modcmd`=?,`servertemplate`=?,`uploaddir`=AES_ENCRYPT(?,?),`webapiAuthkey`=AES_ENCRYPT(?,?) WHERE `id`=? AND `resellerid`=? LIMIT 1");
|
||||
$query->execute(array($anticheat,$fps,$tic,$map,$workshopCollection,$mapGroup,$modcmd,$servertemplate,$uploaddir,$aeskey,$webapiAuthkey,$aeskey,$switchID,$reseller_id));
|
||||
$query = $sql->prepare("UPDATE `serverlist` SET `anticheat`=?,`fps`=?,`tic`=?,`map`=?,`workShop`=?,`workshopCollection`=?,`mapGroup`=?,`modcmd`=?,`servertemplate`=?,`uploaddir`=AES_ENCRYPT(?,?),`webapiAuthkey`=AES_ENCRYPT(?,?) WHERE `id`=? AND `resellerid`=? LIMIT 1");
|
||||
$query->execute(array($anticheat,$fps,$tic,$map,$workShop,$workshopCollection,$mapGroup,$modcmd,$servertemplate,$uploaddir,$aeskey,$webapiAuthkey,$aeskey,$switchID,$reseller_id));
|
||||
|
||||
$updated = ($query->rowCount() > 0) ? true : false;
|
||||
|
||||
@ -413,15 +500,17 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
$template_file = 'Error: No such game!';
|
||||
}
|
||||
} else if ($ui->st('d', 'get') == 'cf' and $ui->id('id', 10, 'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'),$substituteAccess['gs']))) {
|
||||
|
||||
$id = $ui->id('id', 10, 'get');
|
||||
|
||||
$serverID = 0;
|
||||
$query = $sql->prepare("SELECT g.*,AES_DECRYPT(g.`ftppassword`,?) AS `dftppass`,AES_DECRYPT(g.`ppassword`,?) AS `dpftppass`,s.`anticheat`,s.`servertemplate`,t.`shorten`,t.`gamebinary`,t.`modfolder`,t.`binarydir`,t.`qstat`,u.`cname` FROM `gsswitch` g INNER JOIN `serverlist` s ON g.`serverid`=s.`id` INNER JOIN `servertypes` t ON s.`servertype`=t.`id` INNER JOIN `userdata` u ON g.`userid`=u.`id` WHERE g.`id`=? AND g.`userid`=? AND g.`resellerid`=? LIMIT 1");
|
||||
$query->execute(array($aeskey,$aeskey,$id,$user_id,$reseller_id));
|
||||
$configs = array();
|
||||
$configCheck = array();
|
||||
|
||||
$query = $sql->prepare("SELECT g.*,AES_DECRYPT(g.`ftppassword`,?) AS `dftppass`,AES_DECRYPT(g.`ppassword`,?) AS `dpftppass`,s.`anticheat`,s.`servertemplate`,t.`shorten`,t.`gamebinary`,t.`modfolder`,t.`binarydir`,u.`cname` FROM `gsswitch` g INNER JOIN `serverlist` s ON g.`serverid`=s.`id` INNER JOIN `servertypes` t ON s.`servertype`=t.`id` INNER JOIN `userdata` u ON g.`userid`=u.`id` WHERE g.`id`=? AND g.`userid`=? AND g.`resellerid`=? LIMIT 1");
|
||||
$query->execute(array($aeskey, $aeskey,$id, $user_id, $reseller_id));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
$username = $row['cname'];
|
||||
if ($row['newlayout'] == 'Y') $username = $username . '-' . $row['id'];
|
||||
$anticheat = $row['anticheat'];
|
||||
$qstat = $row['qstat'];
|
||||
$eacallowed = $row['eacallowed'];
|
||||
$serverip = $row['serverip'];
|
||||
$port = $row['port'];
|
||||
@ -434,12 +523,15 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
$servertemplate = $row['servertemplate'];
|
||||
$ftppass = $row['dftppass'];
|
||||
$pallowed = $row['pallowed'];
|
||||
if ($protected == 'N' and $servertemplate>1) {
|
||||
|
||||
$username = ($row['newlayout'] == 'Y') ? $row['cname'] . '-' . $row['id'] : $row['cname'];
|
||||
|
||||
if ($protected == 'N' and $servertemplate > 1) {
|
||||
$ftpshorten = $row['shorten'] . '-' . $servertemplate;
|
||||
$pserver="server/";
|
||||
} else if ($protected == 'Y' and $pallowed == 'Y') {
|
||||
$ftpshorten = $row['shorten'];
|
||||
$username = $username."-p";
|
||||
$username = $username . '-p';
|
||||
$ftppass = $row['dpftppass'];
|
||||
$pserver = '';
|
||||
} else {
|
||||
@ -447,8 +539,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
$pserver="server/";
|
||||
}
|
||||
}
|
||||
$configs = array();
|
||||
$configCheck = array();
|
||||
|
||||
$query = $sql->prepare("SELECT g.`protected`,t.`configs`,s.`id` FROM `gsswitch` g INNER JOIN `serverlist` s ON g.`serverid`=s.`id` INNER JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE g.`id`=? AND g.`userid`=? AND g.`resellerid`=? LIMIT 1");
|
||||
$query->execute(array($id,$user_id,$reseller_id));
|
||||
$customer = getusername($user_id);
|
||||
@ -465,6 +556,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$query = $sql->prepare("SELECT a.`configs`,a.`paddon` FROM `addons_installed` i INNER JOIN `addons` a ON i.`addonid`=a.`id` WHERE i.`serverid`=? AND i.`userid`=? AND i.`resellerid`=?");
|
||||
$query->execute(array($serverID,$user_id,$reseller_id));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
@ -480,7 +572,9 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($ui->smallletters('type',4, 'get')) {
|
||||
|
||||
if ($ui->smallletters('type', 4, 'get')) {
|
||||
|
||||
if ($ui->config('config', 'get')) {
|
||||
$postconfig = $ui->config('config', 'get');
|
||||
} else if ($ui->config('config', 'post')) {
|
||||
@ -488,18 +582,22 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
} else {
|
||||
$postconfig = null;
|
||||
}
|
||||
if (in_array($postconfig,$configCheck) and $ui->smallletters('type',4, 'get') and ($ui->smallletters('type',4, 'get') == 'easy' or $ui->smallletters('type',4, 'get') == 'full')) {
|
||||
$explodeconfig=explode("/", $postconfig);
|
||||
$configname = $explodeconfig[(count($explodeconfig)-1)];
|
||||
|
||||
if (in_array($postconfig,$configCheck) and $ui->smallletters('type', 4, 'get') and ($ui->smallletters('type', 4, 'get') == 'easy' or $ui->smallletters('type', 4, 'get') == 'full')) {
|
||||
|
||||
$explodeconfig = explode('/', $postconfig);
|
||||
$configname = $explodeconfig[(count($explodeconfig) - 1)];
|
||||
|
||||
$query = $sql->prepare("SELECT `ip`,`ftpport` FROM `rserverdata` WHERE `id`=? AND `resellerid`=? LIMIT 1");
|
||||
$query->execute(array($rootID,$reseller_id));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
$ftpport = $row['ftpport'];
|
||||
$ip = $row['ip'];
|
||||
}
|
||||
|
||||
if ($gamebinary == 'srcds_run'){
|
||||
$config = $binarydir. '/' . $modfolder. '/' . $postconfig;
|
||||
if ($configname=="server.cfg" and $qstat=="a2s") {
|
||||
if ($configname=="server.cfg" and $gamebinary == 'srcds_run') {
|
||||
$general_cvar=array('hostname','sv_password','sv_contact','sv_tags','motdfile','mapcyclefile','sv_downloadurl','net_maxfilesize','rcon_password','sv_rcon_minfailures','sv_rcon_maxfailures','sv_rcon_banpenalty','sv_rcon_minfailuretime','sv_pure','sv_pure_kick_clients','sv_timeout','sv_voiceenable','sv_allowdownload','sv_allowupload','sv_region','sv_friction','sv_stopspeed','sv_gravity','sv_accelerate','sv_airaccelerate','sv_wateraccelerate','sv_allow_color_correction','sv_allow_wait_command','mp_flashlight','mp_footsteps','mp_falldamage','mp_limitteams','mp_limitteams','mp_friendlyfire','mp_autokick','mp_forcecamera','mp_fadetoblack','mp_allowspectators','mp_chattime','log','sv_log_onefile','sv_logfile','sv_logbans','sv_logecho','mp_logdetail','mp_timelimit','mp_winlimit','sv_minrate','sv_maxrate','sv_minupdaterate','sv_maxupdaterate','sv_mincmdrate','sv_maxcmdrate','sv_client_cmdrate_difference','sv_client_min_interp_ratio','sv_client_max_interp_ratio','mp_fraglimit','mp_maxrounds');
|
||||
} else {
|
||||
$general_cvar = array();
|
||||
@ -511,14 +609,14 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
$general_cvar = array();
|
||||
$config = $postconfig;
|
||||
}
|
||||
if ($shorten=="css" and $configname=="server.cfg") {
|
||||
if ($shorten == 'css' and $configname=="server.cfg") {
|
||||
$game_cvars=array('motdfile_text','sv_disablefreezecam','sv_nonemesis','sv_nomvp','sv_nostats','sv_allowminmodels','sv_hudhint_sound','sv_competitive_minspec','sv_legacy_grenade_damage','sv_enableboost','sv_enablebunnyhopping','mp_forceautoteam','mp_enableroundwaittime','mp_startmoney','mp_roundtime','mp_buytime','mp_c4timer','mp_freezetime','mp_spawnprotectiontime','mp_hostagepenalty','mp_tkpunish');
|
||||
} else if ($shorten=="dods" and $configname=="server.cfg") {
|
||||
$game_cvars=array('mp_limit_allies_rocket','mp_limit_axis_rocket','mp_limit_axis_mg','mp_limit_axis_sniper','mp_limit_axis_assault','mp_limit_axis_support','mp_limit_axis_rifleman','mp_limit_allies_mg','mp_limit_allies_sniper','mp_limit_allies_assault','mp_limit_allies_support','mp_limit_allies_rifleman','dod_freezecam','dod_enableroundwaittime','dod_bonusroundtime','dod_bonusround');
|
||||
} else {
|
||||
$game_cvars = array();
|
||||
}
|
||||
if ($ui->smallletters('type',4, 'get') == 'full' and isset($ui->post['update']) and $ui->post['update']==1) {
|
||||
if ($ui->smallletters('type', 4, 'get') == 'full' and isset($ui->post['update']) and $ui->post['update']==1) {
|
||||
$configfile=stripslashes($ui->post['cleanedconfig']);
|
||||
$fp = true;
|
||||
} else {
|
||||
@ -527,7 +625,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
}
|
||||
$noConfig=($fp == false) ? true: false;
|
||||
$cleanedconfig = '';
|
||||
if ($noConfig === false and ($ui->smallletters('type',4, 'get')=="easy" or ($ui->smallletters('type',4, 'get')=="full" and !isset($ui->post['update'])))) {
|
||||
if ($noConfig === false and ($ui->smallletters('type', 4, 'get')=="easy" or ($ui->smallletters('type', 4, 'get')=="full" and !isset($ui->post['update'])))) {
|
||||
stream_set_timeout($fp,5);
|
||||
while (!feof($fp)) $configfile .=fread($fp,1024);
|
||||
$info=stream_get_meta_data($fp);
|
||||
@ -551,11 +649,11 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
$value = $split[1];
|
||||
if ($cvar!="exec") {
|
||||
if (isset($ui->post[$cvar])) {
|
||||
if (isset($ui->post['oldrcon']) and $cvar=="rcon_password" and $ui->post[$cvar] != $ui->post['oldrcon'] and $configname=="server.cfg" and (($anticheat==2 or $anticheat==3 or $anticheat==4 or $anticheat==5)) and ($qstat=="a2s" or $qstat=="hla2s") and $eacallowed == 'Y') {
|
||||
if (isset($ui->post['oldrcon']) and $cvar=="rcon_password" and $ui->post[$cvar] != $ui->post['oldrcon'] and $configname=="server.cfg" and (($anticheat==2 or $anticheat==3 or $anticheat==4 or $anticheat==5)) and ($gamebinary == 'srcds_run' or $gamebinary == 'hlds_run') and $eacallowed == 'Y') {
|
||||
eacchange('change',$id,$ui->post[$cvar],$reseller_id);
|
||||
}
|
||||
$newconfig .= $cvar." \"".$ui->post[$cvar]."\""."\r\n";
|
||||
} else if (isset($ui->post['oldrcon']) and $cvar=="rcon_password" and $value != $ui->post['oldrcon'] and $configname=="server.cfg" and (($anticheat==2 or $anticheat==3 or $anticheat==4 or $anticheat==5)) and ($qstat=="a2s" or $qstat=="hla2s") and $eacallowed == 'Y') {
|
||||
} else if (isset($ui->post['oldrcon']) and $cvar=="rcon_password" and $value != $ui->post['oldrcon'] and $configname=="server.cfg" and (($anticheat==2 or $anticheat==3 or $anticheat==4 or $anticheat==5)) and ($gamebinary == 'srcds_run' or $gamebinary == 'hlds_run') and $eacallowed == 'Y') {
|
||||
eacchange('change',$id,$value,$reseller_id);
|
||||
} else {
|
||||
$newconfig .= $singeline."\r\n";
|
||||
@ -575,11 +673,11 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
}
|
||||
if ($cvar!="exec") {
|
||||
if (isset($ui->post[$cvar])) {
|
||||
if (isset($ui->post['oldrcon']) and $cvar=="rcon_password" and $ui->post[$cvar] != $ui->post['oldrcon'] and $configname=="server.cfg" and (($anticheat==2 or $anticheat==3 or $anticheat==4 or $anticheat==5)) and ($qstat=="a2s" or $qstat=="hla2s") and $eacallowed == 'Y') {
|
||||
if (isset($ui->post['oldrcon']) and $cvar=="rcon_password" and $ui->post[$cvar] != $ui->post['oldrcon'] and $configname=="server.cfg" and (($anticheat==2 or $anticheat==3 or $anticheat==4 or $anticheat==5)) and ($gamebinary == 'srcds_run' or $gamebinary == 'hlds_run') and $eacallowed == 'Y') {
|
||||
eacchange('change',$id,$ui->post[$cvar],$reseller_id);
|
||||
}
|
||||
$newconfig .= $cvar." \"".$ui->post[$cvar]."\""."\r\n";
|
||||
} else if (isset($ui->post['oldrcon']) and $cvar=="rcon_password" and $value != $ui->post['oldrcon'] and $configname=="server.cfg" and (($anticheat==2 or $anticheat==3 or $anticheat==4 or $anticheat==5)) and ($qstat=="a2s" or $qstat=="hla2s") and $eacallowed == 'Y') {
|
||||
} else if (isset($ui->post['oldrcon']) and $cvar=="rcon_password" and $value != $ui->post['oldrcon'] and $configname=="server.cfg" and (($anticheat==2 or $anticheat==3 or $anticheat==4 or $anticheat==5)) and ($gamebinary == 'srcds_run' or $gamebinary == 'hlds_run') and $eacallowed == 'Y') {
|
||||
eacchange('change',$id,$value,$reseller_id);
|
||||
} else {
|
||||
$newconfig .= $singeline."\r\n";
|
||||
@ -594,7 +692,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
$newconfig .= $singeline."\r\n";
|
||||
}
|
||||
}
|
||||
if ($ui->smallletters('type',4, 'get')=="easy") {
|
||||
if ($ui->smallletters('type', 4, 'get')=="easy") {
|
||||
foreach ($general_cvar as $check_cvar) {
|
||||
if (!in_array($check_cvar, $setarray)) {
|
||||
$newconfig .= $check_cvar." \"".$ui->post[$check_cvar]."\""."\r\n";
|
||||
@ -607,9 +705,9 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
}
|
||||
}
|
||||
$temp = tmpfile();
|
||||
if ($ui->smallletters('type',4, 'get')=="easy") {
|
||||
if ($ui->smallletters('type', 4, 'get')=="easy") {
|
||||
fwrite($temp, $newconfig);
|
||||
} else if ($ui->smallletters('type',4, 'get')=="full") {
|
||||
} else if ($ui->smallletters('type', 4, 'get')=="full") {
|
||||
if (mb_strlen($ui->post['cleanedconfig'], 'UTF-8')<=16384) {
|
||||
fwrite($temp, stripslashes($ui->post['cleanedconfig']),16384);
|
||||
} else {
|
||||
@ -693,10 +791,10 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
}
|
||||
}
|
||||
$array_keys=array_keys($unknownarray);
|
||||
if ($configname=="server.cfg" and (($anticheat==2 or $anticheat==3 or $anticheat==4 or $anticheat==5)) and ($qstat=="a2s" or $qstat=="hla2s") and $eacallowed == 'Y') $oldrcon=(array_key_exists('rcon_password', $linearray)) ? $linearray['rcon_password'] : 'unset';
|
||||
if ($ui->smallletters('type',4, 'get')=="easy") {
|
||||
if ($configname=="server.cfg" and (($anticheat==2 or $anticheat==3 or $anticheat==4 or $anticheat==5)) and ($gamebinary == 'srcds_run' or $gamebinary == 'hlds_run') and $eacallowed == 'Y') $oldrcon=(array_key_exists('rcon_password', $linearray)) ? $linearray['rcon_password'] : 'unset';
|
||||
if ($ui->smallletters('type', 4, 'get')=="easy") {
|
||||
$template_file = 'userpanel_gserver_config_edit_easy.tpl';
|
||||
} else if ($ui->smallletters('type',4, 'get')=="full") {
|
||||
} else if ($ui->smallletters('type', 4, 'get')=="full") {
|
||||
$template_file = 'userpanel_gserver_config_edit_full.tpl';
|
||||
}
|
||||
}
|
||||
@ -706,10 +804,11 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
} else {
|
||||
$template_file = 'userpanel_gserver_config_edit.tpl';
|
||||
}
|
||||
|
||||
} else {
|
||||
$table = array();
|
||||
if (isset($admin_id) and $reseller_id != 0 and $admin_id != $reseller_id) $reseller_id = $admin_id;
|
||||
$query = $sql->prepare("SELECT AES_DECRYPT(`ftppassword`,?) AS `cftppass`,g.*,s.`servertemplate`,s.`upload`,t.`id` AS `tid`,t.`ramLimited`,t.`shorten`,t.`qstatpassparam`,t.`protected` AS `tp`,u.`cname` FROM `gsswitch` g INNER JOIN `serverlist` s ON g.`serverid`=s.`id` INNER JOIN `servertypes` t ON s.`servertype`=t.`id` INNER JOIN `userdata` u ON g.`userid`=u.`id` WHERE g.`active`='Y' AND g.`userid`=? AND g.`resellerid`=? ORDER BY g.`serverip`,g.`port`");
|
||||
$query = $sql->prepare("SELECT AES_DECRYPT(`ftppassword`,?) AS `cftppass`,g.*,s.`servertemplate`,s.`upload`,t.`id` AS `tid`,t.`ramLimited`,t.`shorten`,t.`protected` AS `tp`,u.`cname` FROM `gsswitch` g INNER JOIN `serverlist` s ON g.`serverid`=s.`id` INNER JOIN `servertypes` t ON s.`servertype`=t.`id` INNER JOIN `userdata` u ON g.`userid`=u.`id` WHERE g.`active`='Y' AND g.`userid`=? AND g.`resellerid`=? ORDER BY g.`serverip`,g.`port`");
|
||||
$query2 = $sql->prepare("SELECT `ftpport` FROM `rserverdata` WHERE `id`=? LIMIT 1");
|
||||
$query3 = $sql->prepare("SELECT 1 FROM `servertypes` WHERE `id`=? AND `ftpAccess`='N' LIMIT 1");
|
||||
$query->execute(array($aeskey,$user_id,$reseller_id));
|
||||
@ -723,7 +822,6 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
$pallowed = $row['pallowed'];
|
||||
$cname = $row['cname'];
|
||||
$shorten = $row['shorten'];
|
||||
$qstatpassparam = $row['qstatpassparam'];
|
||||
$gameserverid = $row['id'];
|
||||
$name = $row['queryName'];
|
||||
$ip = $row['serverip'];
|
||||
@ -736,7 +834,6 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
$cftppass = $row['cftppass'];
|
||||
$servertemplate = $row['servertemplate'];
|
||||
|
||||
$passparams = explode(':', $qstatpassparam);
|
||||
$address = $ip . ':' . $port;
|
||||
$map = (in_array($row['queryMap'], array(false, null, ''))) ? 'Unknown' : $row['queryMap'];
|
||||
$updatetime=($user_language == 'de') ? ($row['queryUpdatetime'] != '') ? date('d.m.Y H:m:s',strtotime($row['queryUpdatetime'])) : $sprache->never : $row['queryUpdatetime'];
|
||||
|
@ -53,12 +53,12 @@
|
||||
<div class="controls">
|
||||
<select id="servertemplate_<?php echo $table_row['id'];?>" name="servertemplate_<?php echo $table_row['id'];?>">
|
||||
<option value="1"><?php echo $table_row['shorten'];?></option>
|
||||
<option value="2" <?php if($table_row['servertemplate']=="2") echo "selected";?>><?php echo $table_row['shorten'];?>-2</option>
|
||||
<option value="3" <?php if($table_row['servertemplate']=="3") echo "selected";?>><?php echo $table_row['shorten'];?>-3</option>
|
||||
<option value="2" <?php if($table_row['servertemplate']==2) echo "selected";?>><?php echo $table_row['shorten'];?>-2</option>
|
||||
<option value="3" <?php if($table_row['servertemplate']==3) echo "selected";?>><?php echo $table_row['shorten'];?>-3</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($table_row['qstat']=="a2s" or $table_row['qstat']=="hla2s") { ?>
|
||||
<?php if (in_array($table_row['gamebinary'],array('hlds_run','srcds_run','cod4_lnxded'))) { ?>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="anticheat_<?php echo $table_row['id'];?>"><?php echo $sprache->anticheat;?></label>
|
||||
<div class="controls">
|
||||
@ -101,29 +101,45 @@
|
||||
<input id="map_<?php echo $table_row['id'];?>" type="text" name="map_<?php echo $table_row['id'];?>" value="<?php echo $table_row['map'];?>">
|
||||
</div>
|
||||
</div>
|
||||
<?php if(!in_array($table_row['defaultMapGroup'],array('',null))){ ?>
|
||||
<?php if($table_row['workshopCollection']!==false){ ?>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="mapGroup_<?php echo $table_row['id'];?>"><?php echo $sprache->startmapgroup;?></label>
|
||||
<label class="control-label" for="workShop_<?php echo $table_row['id'];?>">Steam Workshop</label>
|
||||
<div class="controls">
|
||||
<input id="mapGroup_<?php echo $table_row['id'];?>" type="text" name="mapGroup_<?php echo $table_row['id'];?>" value="<?php echo $table_row['mapGroup'];?>">
|
||||
<select id="workShop_<?php echo $table_row['id'];?>" name="workShop_<?php echo $table_row['id'];?>" onchange="SwitchShowHideRows(this.value,'mapGroupWorkShop-<?php echo $table_row['id'];?>');">
|
||||
<option value="N"><?php echo $gsprache->no;?></option>
|
||||
<option value="Y" <?php if($table_row['workShop']=='Y') echo 'selected="selected"';?>><?php echo $gsprache->yes;?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php }; if($table_row['workshopCollection']!==false){ ?>
|
||||
<div class="control-group">
|
||||
<div class="Y <?php if($table_row['workShop']=='N') echo 'display_none';?> mapGroupWorkShop-<?php echo $table_row['id'];?> control-group">
|
||||
<label class="control-label" for="workshopCollection_<?php echo $table_row['id'];?>">Workshop Collection</label>
|
||||
<div class="controls">
|
||||
<input id="workshopCollection_<?php echo $table_row['id'];?>" type="text" name="workshopCollection_<?php echo $table_row['id'];?>" value="<?php echo $table_row['workshopCollection'];?>">
|
||||
<span class="help-block"><?php echo $sprache->collection_info;?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="Y <?php if($table_row['workShop']=='N') echo 'display_none';?> mapGroupWorkShop-<?php echo $table_row['id'];?> control-group">
|
||||
<label class="control-label" for="webapiAuthkey_<?php echo $table_row['id'];?>">Steam Webapi Authkey</label>
|
||||
<div class="controls">
|
||||
<input id="webapiAuthkey_<?php echo $table_row['id'];?>" type="text" name="webapiAuthkey_<?php echo $table_row['id'];?>" value="<?php echo $table_row['webapiAuthkey'];?>">
|
||||
<span class="help-block"><?php echo $sprache->authkey_info;?></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php }} ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if(!in_array($table_row['defaultMapGroup'],array('',null))){ ?>
|
||||
<div class="N <?php if($table_row['workShop']=='Y') echo 'display_none';?> mapGroupWorkShop-<?php echo $table_row['id'];?> control-group">
|
||||
<label class="control-label" for="mapGroup_<?php echo $table_row['id'];?>"><?php echo $sprache->startmapgroup;?></label>
|
||||
<div class="controls">
|
||||
<select id="mapGroup_<?php echo $table_row['id'];?>" name="mapGroup_<?php echo $table_row['id'];?>">
|
||||
<?php foreach($table_row['mapGroupsAvailable'] as $g){ ?>
|
||||
<option<?php if($g==$table_row['mapGroup']) echo 'selected="selected"';?>><?php echo $g;?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="control-group">
|
||||
|
Loading…
x
Reference in New Issue
Block a user