fix ${ (Deprecated)

This commit is contained in:
Alix 2023-05-18 23:00:47 +03:30
parent d690a5e196
commit 675e7aa0e9
22 changed files with 119 additions and 119 deletions

View File

@ -347,7 +347,7 @@ if (true or !isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_ar
} }
} else if ($autorestart == 'Y') { } else if ($autorestart == 'Y') {
print "<br><br>Do not restart TS3/TSDNS ${queryip} since failcount is only ${ts3masternotified} and ${down_checks} is required for restart \r\n"; print "<br><br>Do not restart TS3/TSDNS {$queryip} since failcount is only {$ts3masternotified} and {$down_checks} is required for restart \r\n";
} }
} }

View File

@ -80,7 +80,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
$currentHour = date('G'); $currentHour = date('G');
$currentMinute = (int) date('i'); $currentMinute = (int) date('i');
echo "Start Syncs and Updates. Hour is ${currentHour} and minute is ${currentMinute}\r\n"; echo "Start Syncs and Updates. Hour is {$currentHour} and minute is {$currentMinute}\r\n";
if ($allRoots) { if ($allRoots) {
@ -98,13 +98,13 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
$query = $sql->prepare("UPDATE `settings` SET `lastUpdateRun`=? WHERE `resellerid`=0 LIMIT 1"); $query = $sql->prepare("UPDATE `settings` SET `lastUpdateRun`=? WHERE `resellerid`=0 LIMIT 1");
$query->execute(array($currentMinute)); $query->execute(array($currentMinute));
echo "Checking for servers to be updated and or synced at hour ${currentHour} and between minutes ${lastUpdateRun} and ${currentMinute}\r\n"; echo "Checking for servers to be updated and or synced at hour {$currentHour} and between minutes {$lastUpdateRun} and {$currentMinute}\r\n";
// avoid less/more OR equal in SQL. We want only less/more to eliminate the OR comparison // avoid less/more OR equal in SQL. We want only less/more to eliminate the OR comparison
$currentMinute++; $currentMinute++;
$lastUpdateRun--; $lastUpdateRun--;
echo "Altered minutes for running a more efficient query will be updateMinute > ${lastUpdateRun} AND updateMinute < ${currentMinute}\r\n"; echo "Altered minutes for running a more efficient query will be updateMinute > {$lastUpdateRun} AND updateMinute < {$currentMinute}\r\n";
$query = $sql->prepare("SELECT `id`,`updates` FROM `rserverdata` WHERE (`alreadyStartedAt` IS NULL OR `alreadyStartedAt`!=?) AND `updateMinute`>? AND `updateMinute`<? AND `active`!='N'"); $query = $sql->prepare("SELECT `id`,`updates` FROM `rserverdata` WHERE (`alreadyStartedAt` IS NULL OR `alreadyStartedAt`!=?) AND `updateMinute`>? AND `updateMinute`<? AND `active`!='N'");
$query->execute(array($currentHour, $lastUpdateRun, $currentMinute)); $query->execute(array($currentHour, $lastUpdateRun, $currentMinute));

View File

@ -721,7 +721,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
} else { } else {
print "TSDNS ${row['ssh2ip']} is up and running\r\n"; print "TSDNS {$row['ssh2ip']} is up and running\r\n";
$query3 = $sql->prepare("UPDATE `voice_tsdns` SET `notified`=0 WHERE `id`=? LIMIT 1"); $query3 = $sql->prepare("UPDATE `voice_tsdns` SET `notified`=0 WHERE `id`=? LIMIT 1");
$query3->execute(array($row['id'])); $query3->execute(array($row['id']));
@ -1117,7 +1117,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
if (isset($ts3id, $lendserver) and (($lendserver == 'N' and $slots < $server['virtualserver_maxclients']) or ($lendserver == 'Y' and $lendslots < $server['virtualserver_maxclients']))) { if (isset($ts3id, $lendserver) and (($lendserver == 'N' and $slots < $server['virtualserver_maxclients']) or ($lendserver == 'Y' and $lendslots < $server['virtualserver_maxclients']))) {
$showSlots = ($lendserver == 'Y') ? $lendslots : $slots; $showSlots = ($lendserver == 'Y') ? $lendslots : $slots;
print $vrow['type'] . " server $address virtualserver_maxclients ${sd['virtualserver_maxclients']}!= " . $showSlots . ". The name converted to ISO-8859-1 is " . iconv('UTF-8','ISO-8859-1//TRANSLIT', $server['virtualserver_name']) . "\r\n"; print $vrow['type'] . " server $address virtualserver_maxclients {$sd['virtualserver_maxclients']}!= " . $showSlots . ". The name converted to ISO-8859-1 is " . iconv('UTF-8','ISO-8859-1//TRANSLIT', $server['virtualserver_name']) . "\r\n";
if (isset($rulebreak)) { if (isset($rulebreak)) {
$rulebreak .= '<br />virtualserver_maxclients ' . $vosprache->isnot . ' ' . $showSlots; $rulebreak .= '<br />virtualserver_maxclients ' . $vosprache->isnot . ' ' . $showSlots;
@ -1140,7 +1140,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
if (isset($changeSlots)) { if (isset($changeSlots)) {
print $vrow['type'] . " server $address Changing Flex Slots to ${changeSlots}. The name converted to ISO-8859-1 is " . iconv('UTF-8','ISO-8859-1//TRANSLIT', $server['virtualserver_name']) . "\r\n"; print $vrow['type'] . " server $address Changing Flex Slots to {$changeSlots}. The name converted to ISO-8859-1 is " . iconv('UTF-8','ISO-8859-1//TRANSLIT', $server['virtualserver_name']) . "\r\n";
$connection->ImportModServer($virtualserver_id, $changeSlots, $vrow2['ip'], $vrow2['port'], array()); $connection->ImportModServer($virtualserver_id, $changeSlots, $vrow2['ip'], $vrow2['port'], array());

View File

@ -90,7 +90,7 @@ if ($ui->w('action',4, 'post') and !token(true)) {
if (isset($addon)) { if (isset($addon)) {
header("Cache-Control: public"); header("Cache-Control: public");
header("Content-Description: File Transfer"); header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename = ${addon}.xml"); header("Content-Disposition: attachment; filename = {$addon}.xml");
header("Content-Type: text/xml; charset=UTF-8"); header("Content-Type: text/xml; charset=UTF-8");
header("Content-Transfer-Encoding: binary"); header("Content-Transfer-Encoding: binary");
$xml->formatOutput = true; $xml->formatOutput = true;

View File

@ -93,7 +93,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
header("Cache-Control: public"); header("Cache-Control: public");
header("Content-Description: File Transfer"); header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename = ${shorten}.xml"); header("Content-Disposition: attachment; filename = {$shorten}.xml");
header("Content-Type: text/xml; charset=UTF-8"); header("Content-Type: text/xml; charset=UTF-8");
header("Content-Transfer-Encoding: binary"); header("Content-Transfer-Encoding: binary");

View File

@ -253,7 +253,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$query = $sql->prepare("DELETE FROM `translations` WHERE `type`='pd' AND `transID`=? AND `resellerID`=?"); $query = $sql->prepare("DELETE FROM `translations` WHERE `type`='pd' AND `transID`=? AND `resellerID`=?");
$query->execute(array($id, $reseller_id)); $query->execute(array($id, $reseller_id));
@unlink(EASYWIDIR . "/downloads/${id}/${fileExtension}"); @unlink(EASYWIDIR . "/downloads/{$id}/{$fileExtension}");
$template_file = $spracheResponse->table_del; $template_file = $spracheResponse->table_del;
} else { } else {

View File

@ -95,14 +95,14 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$query->execute(array($ui->active('active', 'post'), $ui->w('item',1, 'post'), $ui->w('type',1, 'post'), $ui->id('length',10, 'post'), $name)); $query->execute(array($ui->active('active', 'post'), $ui->w('item',1, 'post'), $ui->w('type',1, 'post'), $ui->id('length',10, 'post'), $name));
$id = $sql->lastInsertId(); $id = $sql->lastInsertId();
$loguseraction = "%add% Custom Column ${name}"; $loguseraction = "%add% Custom Column {$name}";
} else if ($ui->id('id', 10, 'get') and $ui->st('d', 'get') == 'md') { } else if ($ui->id('id', 10, 'get') and $ui->st('d', 'get') == 'md') {
$query = $sql->prepare("UPDATE `custom_columns_settings` SET `active`=?,`item`=?,`type`=?,`length`=?,`name`=? WHERE `customID`=? LIMIT 1"); $query = $sql->prepare("UPDATE `custom_columns_settings` SET `active`=?,`item`=?,`type`=?,`length`=?,`name`=? WHERE `customID`=? LIMIT 1");
$query->execute(array($ui->active('active', 'post'), $ui->w('item',1, 'post'), $ui->w('type',1, 'post'), $ui->id('length',10, 'post'), $name, $id)); $query->execute(array($ui->active('active', 'post'), $ui->w('item',1, 'post'), $ui->w('type',1, 'post'), $ui->id('length',10, 'post'), $name, $id));
$loguseraction = "%mod% Custom Column ${name}"; $loguseraction = "%mod% Custom Column {$name}";
} else { } else {
$template_file = 'admin_404.tpl'; $template_file = 'admin_404.tpl';
@ -228,7 +228,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$query = $sql->prepare("DELETE FROM `translations` WHERE `type`='cc' AND `transID`=?"); $query = $sql->prepare("DELETE FROM `translations` WHERE `type`='cc' AND `transID`=?");
$query->execute(array($id)); $query->execute(array($id));
$loguseraction = "%del% Custom Column ${name}"; $loguseraction = "%del% Custom Column {$name}";
$insertlog->execute(); $insertlog->execute();
$template_file = $spracheResponse->table_del; $template_file = $spracheResponse->table_del;

View File

@ -520,8 +520,8 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$temp=' AND ('; $temp=' AND (';
$i = 0; $i = 0;
foreach ($selected as $get) { foreach ($selected as $get) {
if ($i==0) $temp.="`state`='${get}'"; if ($i==0) $temp.="`state`='{$get}'";
else $temp.=" OR `state`='${get}'"; else $temp.=" OR `state`='{$get}'";
if (!in_array($get,$selected)) $selected[] = $get; if (!in_array($get,$selected)) $selected[] = $get;
$i++; $i++;
} }

View File

@ -235,8 +235,8 @@ if ($ui->st('d', 'get') == 'ad') {
$temp=' AND ('; $temp=' AND (';
$i = 0; $i = 0;
foreach ($selected as $get) { foreach ($selected as $get) {
if ($i==0) $temp.="`state`='${get}'"; if ($i==0) $temp.="`state`='{$get}'";
else $temp.=" OR `state`='${get}'"; else $temp.=" OR `state`='{$get}'";
$selected[] = $get; $selected[] = $get;
$i++; $i++;
} }

View File

@ -342,43 +342,43 @@ if ($ui->w('action',4, 'post') and !token(true)) {
foreach ($dnsList as $dns) { foreach ($dnsList as $dns) {
$lookUp = str_replace('.', '_', $dns); $lookUp = str_replace('.', '_', $dns);
$ex = explode(':', $ui->ipport("${lookUp}-address", 'post')); $ex = explode(':', $ui->ipport("{$lookUp}-address", 'post'));
if ($ui->active("${lookUp}-import", 'post') == 'Y' and isset($ex[1]) and port($ex[1])) { if ($ui->active("{$lookUp}-import", 'post') == 'Y' and isset($ex[1]) and port($ex[1])) {
$ip = $ex[0]; $ip = $ex[0];
$port = $ex[1]; $port = $ex[1];
$customer = $ui->id("${lookUp}-customer", 19, 'post'); $customer = $ui->id("{$lookUp}-customer", 19, 'post');
if ($customer == 0 or $customer == false or $customer == null) { if ($customer == 0 or $customer == false or $customer == null) {
$usernew = true; $usernew = true;
if ($ui->username("${lookUp}-username",50, 'post') and $ui->ismail("${lookUp}-email", 'post')) { if ($ui->username("{$lookUp}-username",50, 'post') and $ui->ismail("{$lookUp}-email", 'post')) {
$query = $sql->prepare("SELECT `id` FROM `userdata` WHERE `cname`=? AND `mail`=? AND `resellerid`=? LIMIT 1"); $query = $sql->prepare("SELECT `id` FROM `userdata` WHERE `cname`=? AND `mail`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($ui->username("${lookUp}-username",50, 'post'), $ui->ismail("${lookUp}-email", 'post'), $reseller_id)); $query->execute(array($ui->username("{$lookUp}-username",50, 'post'), $ui->ismail("{$lookUp}-email", 'post'), $reseller_id));
while ($row = $query->fetch(PDO::FETCH_ASSOC)) { while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
$usernew = false; $usernew = false;
$customer = $row['id']; $customer = $row['id'];
$cnamenew = $ui->username("${lookUp}-username",50, 'post'); $cnamenew = $ui->username("{$lookUp}-username",50, 'post');
} }
if ($usernew == true) { if ($usernew == true) {
$newHash = passwordCreate($ui->username("${lookUp}-username",50, 'post'), passwordgenerate(10)); $newHash = passwordCreate($ui->username("{$lookUp}-username",50, 'post'), passwordgenerate(10));
if (is_array($newHash)) { if (is_array($newHash)) {
$query = $sql->prepare("INSERT INTO `userdata` (`cname`,`security`,`salt`,`mail`,`accounttype`,`resellerid`) VALUES (?,?,?,?,'u',?)"); $query = $sql->prepare("INSERT INTO `userdata` (`cname`,`security`,`salt`,`mail`,`accounttype`,`resellerid`) VALUES (?,?,?,?,'u',?)");
$query->execute(array($ui->username("${lookUp}-username",50, 'post'), $newHash['hash'], $newHash['salt'], $ui->ismail("${lookUp}-email", 'post'), $reseller_id)); $query->execute(array($ui->username("{$lookUp}-username",50, 'post'), $newHash['hash'], $newHash['salt'], $ui->ismail("{$lookUp}-email", 'post'), $reseller_id));
} else { } else {
$query = $sql->prepare("INSERT INTO `userdata` (`cname`,`security`,`mail`,`accounttype`,`resellerid`) VALUES (?,?,?,'u',?)"); $query = $sql->prepare("INSERT INTO `userdata` (`cname`,`security`,`mail`,`accounttype`,`resellerid`) VALUES (?,?,?,'u',?)");
$query->execute(array($ui->username("${lookUp}-username",50, 'post'), $newHash, $ui->ismail("${lookUp}-email", 'post'), $reseller_id)); $query->execute(array($ui->username("{$lookUp}-username",50, 'post'), $newHash, $ui->ismail("{$lookUp}-email", 'post'), $reseller_id));
} }
$query = $sql->prepare("SELECT `id` FROM `userdata` WHERE `cname`=? AND `mail`=? AND `resellerid`=? ORDER BY `id` DESC LIMIT 1"); $query = $sql->prepare("SELECT `id` FROM `userdata` WHERE `cname`=? AND `mail`=? AND `resellerid`=? ORDER BY `id` DESC LIMIT 1");
$query->execute(array($ui->username("${lookUp}-username",50, 'post'), $ui->ismail("${lookUp}-email", 'post'), $reseller_id)); $query->execute(array($ui->username("{$lookUp}-username",50, 'post'), $ui->ismail("{$lookUp}-email", 'post'), $reseller_id));
while ($row = $query->fetch(PDO::FETCH_ASSOC)) { while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
$customer = $row['id']; $customer = $row['id'];
$cnamenew = $ui->username("${lookUp}-username",50, 'post'); $cnamenew = $ui->username("{$lookUp}-username",50, 'post');
sendmail('emailuseradd', $customer, $cnamenew, $initialpassword); sendmail('emailuseradd', $customer, $cnamenew, $initialpassword);
} }
} }

View File

@ -63,7 +63,7 @@ if (isset($downloadID)) {
while ($row = $query->fetch(PDO::FETCH_ASSOC)) { while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
if (($row['show'] == 'E' or ($row['show'] == 'A' and isset($admin_id)) or ($row['show'] == 'R' and (isset($user_id) or isset($admin_id)))) and ($row['external'] == 'Y' or ($row['external'] == 'N' and file_exists(EASYWIDIR . "/downloads/${row['fileID']}.${row['fileExtension']}")))) { if (($row['show'] == 'E' or ($row['show'] == 'A' and isset($admin_id)) or ($row['show'] == 'R' and (isset($user_id) or isset($admin_id)))) and ($row['external'] == 'Y' or ($row['external'] == 'N' and file_exists(EASYWIDIR . "/downloads/{$row['fileID']}.{$row['fileExtension']}")))) {
if (isset($startDownload)) { if (isset($startDownload)) {
@ -74,26 +74,26 @@ if (isset($downloadID)) {
if ($row['external'] == 'N') { if ($row['external'] == 'N') {
$fileWithPath = EASYWIDIR . "/downloads/${row['fileID']}.${row['fileExtension']}"; $fileWithPath = EASYWIDIR . "/downloads/{$row['fileID']}.{$row['fileExtension']}";
$finfo = finfo_open(FILEINFO_MIME_TYPE); $finfo = finfo_open(FILEINFO_MIME_TYPE);
$contentType = finfo_file($finfo, $fileWithPath); $contentType = finfo_file($finfo, $fileWithPath);
finfo_close($finfo); finfo_close($finfo);
header("Content-Type: ${contentType}"); header("Content-Type: {$contentType}");
if (strpos(strtolower($ui->server['SERVER_SOFTWARE']),'nginx') !== false) { if (strpos(strtolower($ui->server['SERVER_SOFTWARE']),'nginx') !== false) {
header('Content-Length: ' . (string) (filesize($fileWithPath))); header('Content-Length: ' . (string) (filesize($fileWithPath)));
header('Cache-Control: public, must-revalidate'); header('Cache-Control: public, must-revalidate');
header('Pragma: no-cache'); header('Pragma: no-cache');
header("Content-Disposition: attachment; filename=\"${row['fileName']}.${row['fileExtension']}\""); header("Content-Disposition: attachment; filename=\"{$row['fileName']}.{$row['fileExtension']}\"");
header('Content-Transfer-Encoding: binary'); header('Content-Transfer-Encoding: binary');
header("X-Accel-Redirect: /downloads/${row['fileID']}.${row['fileExtension']}"); header("X-Accel-Redirect: /downloads/{$row['fileID']}.{$row['fileExtension']}");
} else { } else {
header("Content-Disposition: attachment; filename=\"${row['fileName']}.${row['fileExtension']}\""); header("Content-Disposition: attachment; filename=\"{$row['fileName']}.{$row['fileExtension']}\"");
set_time_limit(0); set_time_limit(0);
$fp = @fopen(EASYWIDIR . "/downloads/${row['fileID']}.${row['fileExtension']}","rb"); $fp = @fopen(EASYWIDIR . "/downloads/{$row['fileID']}.{$row['fileExtension']}","rb");
while(!feof($fp)) { while(!feof($fp)) {
print(@fread($fp, 1024)); print(@fread($fp, 1024));
ob_flush(); ob_flush();
@ -101,7 +101,7 @@ if (isset($downloadID)) {
} }
} }
} else { } else {
header("location: ${row['externalURL']}"); header("location: {$row['externalURL']}");
} }
die; die;
@ -123,7 +123,7 @@ if (isset($downloadID)) {
$query = $sql->prepare("SELECT d.*,t.`text` FROM `page_downloads` d LEFT JOIN `translations` t ON t.`type`='pd' AND t.`transID`=d.`fileID` AND t.`lang`=? ORDER BY d.`order`,d.`fileID`"); $query = $sql->prepare("SELECT d.*,t.`text` FROM `page_downloads` d LEFT JOIN `translations` t ON t.`type`='pd' AND t.`transID`=d.`fileID` AND t.`lang`=? ORDER BY d.`order`,d.`fileID`");
$query->execute(array($user_language)); $query->execute(array($user_language));
while ($row = $query->fetch(PDO::FETCH_ASSOC)) { while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
if (($row['show'] == 'E' or ($row['show'] == 'A' and isset($admin_id)) or ($row['show'] == 'R' and (isset($user_id) or isset($admin_id)))) and ($row['external'] == 'Y' or ($row['external'] == 'N' and file_exists(EASYWIDIR . "/downloads/${row['fileID']}.${row['fileExtension']}")))) { if (($row['show'] == 'E' or ($row['show'] == 'A' and isset($admin_id)) or ($row['show'] == 'R' and (isset($user_id) or isset($admin_id)))) and ($row['external'] == 'Y' or ($row['external'] == 'N' and file_exists(EASYWIDIR . "/downloads/{$row['fileID']}.{$row['fileExtension']}")))) {
$table[] = array('id' => $row['fileID'], 'description' => $row['description'], 'link' => (isset($seo) and $seo == 'Y') ? $page_data->pages['downloads']['link'].'get/'.$row['fileID'].'/' : $page_data->pages['downloads']['link'].'&amp;action=get&amp;id='.$row['fileID'], 'text' => $row['text']); $table[] = array('id' => $row['fileID'], 'description' => $row['description'], 'link' => (isset($seo) and $seo == 'Y') ? $page_data->pages['downloads']['link'].'get/'.$row['fileID'].'/' : $page_data->pages['downloads']['link'].'&amp;action=get&amp;id='.$row['fileID'], 'text' => $row['text']);
} }
} }

View File

@ -438,7 +438,7 @@ class AppServer {
$this->shellScripts['user'] .= 'CONFIGUSERID=' . $this->appMasterServerDetails['configUserID'] . "\n"; $this->shellScripts['user'] .= 'CONFIGUSERID=' . $this->appMasterServerDetails['configUserID'] . "\n";
$this->shellScripts['user'] .= 'USER=`ls -la /var/run/screen | grep S-' . $userName . ' | head -n 1 | awk \'{print $3}\'`' . "\n"; $this->shellScripts['user'] .= 'USER=`ls -la /var/run/screen | grep S-' . $userName . ' | head -n 1 | awk \'{print $3}\'`' . "\n";
$this->shellScripts['user'] .= 'if [ "$USER" != "" -a $USER -eq $USER 2> /dev/null ]; then CONFIGUSERID=$USER; fi' . "\n"; $this->shellScripts['user'] .= 'if [ "$USER" != "" -a $USER -eq $USER 2> /dev/null ]; then CONFIGUSERID=$USER; fi' . "\n";
$this->shellScripts['user'] .= 'USERID=`getent passwd | cut -f3 -d: | sort -un | awk \'BEGIN { id=\'${CONFIGUSERID}\' } $1 == id { id++ } $1 > id { print id; exit }\'`' . "\n"; $this->shellScripts['user'] .= 'USERID=`getent passwd | cut -f3 -d: | sort -un | awk \'BEGIN { id=\'{$CONFIGUSERID}\' } $1 == id { id++ } $1 > id { print id; exit }\'`' . "\n";
$this->shellScripts['user'] .= 'if [ "`ls -la /var/run/screen | awk \'{print $3}\' | grep $USERID`" == "" -a "`grep \"x:$USERID:\" /etc/passwd`" == "" ]; then' . "\n"; $this->shellScripts['user'] .= 'if [ "`ls -la /var/run/screen | awk \'{print $3}\' | grep $USERID`" == "" -a "`grep \"x:$USERID:\" /etc/passwd`" == "" ]; then' . "\n";
$this->shellScripts['user'] .= 'if [ "`lsb_release -i 2> /dev/null | grep \'Distributor\' | awk \'{print tolower($3)}\'`" == "centos" ] || [ "`grep \'\bNAME=\b\' /etc/os-release | sed -n \'s/^.*NAME=//p\' | sed -e \'s/\(.*\)/\L\1/\'`" == "slackware" ]; then' . "\n"; $this->shellScripts['user'] .= 'if [ "`lsb_release -i 2> /dev/null | grep \'Distributor\' | awk \'{print tolower($3)}\'`" == "centos" ] || [ "`grep \'\bNAME=\b\' /etc/os-release | sed -n \'s/^.*NAME=//p\' | sed -e \'s/\(.*\)/\L\1/\'`" == "slackware" ]; then' . "\n";
$this->shellScripts['user'] .= 'sudo /usr/sbin/useradd -m -p `perl -e \'print crypt("\'' . $password . '\'","Sa")\'` -d ' . $this->removeSlashes($this->appServerDetails['homeDir'] . '/' . $userNameHome) . ' -g ' . $this->appMasterServerDetails['ssh2User'] . ' -s /bin/false $USERID ' . $userName . ' 2>/dev/null' . "\n"; $this->shellScripts['user'] .= 'sudo /usr/sbin/useradd -m -p `perl -e \'print crypt("\'' . $password . '\'","Sa")\'` -d ' . $this->removeSlashes($this->appServerDetails['homeDir'] . '/' . $userNameHome) . ' -g ' . $this->appMasterServerDetails['ssh2User'] . ' -s /bin/false $USERID ' . $userName . ' 2>/dev/null' . "\n";
@ -481,7 +481,7 @@ class AppServer {
private function linuxDeleteUserGenerate ($userName) { private function linuxDeleteUserGenerate ($userName) {
$this->shellScripts['user'] .= 'sudo pkill -u ' . $userName . "\n"; $this->shellScripts['user'] .= 'sudo pkill -u ' . $userName . "\n";
$this->shellScripts['user'] .= 'if [ "`id ' . $userName . ' 2>/dev/null`" != "" ]; then' . "\n"; $this->shellScripts['user'] .= 'if [ "`id ' . $userName . ' 2>/dev/null`" != "" ]; then' . "\n";
$this->shellScripts['user'] .= '${IONICE}nice -n +19 sudo /usr/sbin/userdel -fr ' . $userName . ' > /dev/null 2>&1 ' . "\n"; $this->shellScripts['user'] .= '{$IONICE}nice -n +19 sudo /usr/sbin/userdel -fr ' . $userName . ' > /dev/null 2>&1 ' . "\n";
$this->addLogline('user.log', 'User ' . $userName . ' deleted'); $this->addLogline('user.log', 'User ' . $userName . ' deleted');
$this->shellScripts['user'] .= 'fi' . "\n"; $this->shellScripts['user'] .= 'fi' . "\n";
@ -605,7 +605,7 @@ class AppServer {
// Migrate old folder structure with ip_port as sub folder to structure without // Migrate old folder structure with ip_port as sub folder to structure without
$script .= 'if [ -d ' . $absolutePath . $this->appServerDetails['serverIP'] . '_' . $this->appServerDetails['port'] . ' ]; then' . "\n"; $script .= 'if [ -d ' . $absolutePath . $this->appServerDetails['serverIP'] . '_' . $this->appServerDetails['port'] . ' ]; then' . "\n";
$script .= 'mv ' . $absolutePath . $this->appServerDetails['serverIP'] . '_' . $this->appServerDetails['port'] . '/* ' . $absolutePath . "\n"; $script .= 'mv ' . $absolutePath . $this->appServerDetails['serverIP'] . '_' . $this->appServerDetails['port'] . '/* ' . $absolutePath . "\n";
$script .= '${IONICE}nice -n +19 rm -rf ' . $absolutePath . $this->appServerDetails['serverIP'] . '_' . $this->appServerDetails['port'] . "\n"; $script .= '{$IONICE}nice -n +19 rm -rf ' . $absolutePath . $this->appServerDetails['serverIP'] . '_' . $this->appServerDetails['port'] . "\n";
$script .= 'fi' . "\n"; $script .= 'fi' . "\n";
foreach ($templates as $template) { foreach ($templates as $template) {
@ -622,11 +622,11 @@ class AppServer {
} }
$script .= 'FILEFOUND=(`find -mindepth 1 -type f \( -iname "*.' . implode('" -or -iname "*.', $copyFileExtensions) . '" \) | grep -v -E "$PATTERN"`)' . "\n"; $script .= 'FILEFOUND=(`find -mindepth 1 -type f \( -iname "*.' . implode('" -or -iname "*.', $copyFileExtensions) . '" \) | grep -v -E "$PATTERN"`)' . "\n";
$script .= 'for FILTEREDFILES in ${FILEFOUND[@]}; do' . "\n"; $script .= 'for FILTEREDFILES in {$FILEFOUND[@]}; do' . "\n";
$script .= 'FOLDERNAME=`dirname "$FILTEREDFILES"`' . "\n"; $script .= 'FOLDERNAME=`dirname "$FILTEREDFILES"`' . "\n";
$script .= 'if ([[ `find "$FOLDERNAME" -maxdepth 0 -type d` ]] && [[ ! -d "' . $absoluteTargetTemplatePath . '$FOLDERNAME" ]]); then mkdir -p "' . $absoluteTargetTemplatePath . '$FOLDERNAME"; fi' . "\n"; $script .= 'if ([[ `find "$FOLDERNAME" -maxdepth 0 -type d` ]] && [[ ! -d "' . $absoluteTargetTemplatePath . '$FOLDERNAME" ]]); then mkdir -p "' . $absoluteTargetTemplatePath . '$FOLDERNAME"; fi' . "\n";
$script .= 'if [ -f "' . $absoluteTargetTemplatePath . '$FILTEREDFILES" ]; then find "' . $absoluteTargetTemplatePath . '$FILTEREDFILES" -maxdepth 1 -type l -delete; fi' . "\n"; $script .= 'if [ -f "' . $absoluteTargetTemplatePath . '$FILTEREDFILES" ]; then find "' . $absoluteTargetTemplatePath . '$FILTEREDFILES" -maxdepth 1 -type l -delete; fi' . "\n";
$script .= 'if [ ! -f "' . $absoluteTargetTemplatePath . '$FILTEREDFILES" ]; then ${IONICE}cp "' . $absoluteSourceTemplatePath . '$FILTEREDFILES" "' . $absoluteTargetTemplatePath . '$FILTEREDFILES"; fi' . "\n"; $script .= 'if [ ! -f "' . $absoluteTargetTemplatePath . '$FILTEREDFILES" ]; then {$IONICE}cp "' . $absoluteSourceTemplatePath . '$FILTEREDFILES" "' . $absoluteTargetTemplatePath . '$FILTEREDFILES"; fi' . "\n";
$script .= 'done' . "\n"; $script .= 'done' . "\n";
$script .= 'cp -sr ' . $absoluteSourceTemplatePath . '* ' . $absoluteTargetTemplatePath . ' > /dev/null 2>&1' . "\n"; $script .= 'cp -sr ' . $absoluteSourceTemplatePath . '* ' . $absoluteTargetTemplatePath . ' > /dev/null 2>&1' . "\n";
@ -640,15 +640,15 @@ class AppServer {
$dirChmod = 750; $dirChmod = 750;
$fileChmod = 640; $fileChmod = 640;
} }
$script .= '${IONICE}nice -n +19 find ' . $absolutePath . ' -type d -print0 | xargs -0 chmod ' . $dirChmod . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $absolutePath . ' -type d -print0 | xargs -0 chmod ' . $dirChmod . "\n";
if ($this->appServerDetails['template']['copyStartBinary'] == 'Y' and strlen($this->appServerDetails['template']['gameBinary']) > 0) { if ($this->appServerDetails['template']['copyStartBinary'] == 'Y' and strlen($this->appServerDetails['template']['gameBinary']) > 0) {
$script .= '${IONICE}nice -n +19 find ' . $absolutePath . ' -type f ! -name "' . $this->appServerDetails['template']['gameBinary'] . '" -print0 | xargs -0 chmod ' . $fileChmod . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $absolutePath . ' -type f ! -name "' . $this->appServerDetails['template']['gameBinary'] . '" -print0 | xargs -0 chmod ' . $fileChmod . "\n";
} else { } else {
$script .= '${IONICE}nice -n +19 find ' . $absolutePath . ' -type f -print0 | xargs -0 chmod ' . $fileChmod . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $absolutePath . ' -type f -print0 | xargs -0 chmod ' . $fileChmod . "\n";
} }
$script .= '${IONICE}nice -n +19 find -L ' . $absolutePath . ' -type l -delete' . "\n"; $script .= '{$IONICE}nice -n +19 find -L ' . $absolutePath . ' -type l -delete' . "\n";
if ($standalone and isset($scriptName)) { if ($standalone and isset($scriptName)) {
$this->addLinuxScript($scriptName, $script); $this->addLinuxScript($scriptName, $script);
@ -722,7 +722,7 @@ class AppServer {
$script .= 'TARGET_FOLDER="`dirname ' . $spareFile . '`"' . "\n"; $script .= 'TARGET_FOLDER="`dirname ' . $spareFile . '`"' . "\n";
$script .= 'if [ ! -d "../sparefiles/${TARGET_FOLDER}" ]; then mkdir -p "../sparefiles/${TARGET_FOLDER}"' . "\n"; $script .= 'if [ ! -d "../sparefiles/{$TARGET_FOLDER}" ]; then mkdir -p "../sparefiles/{$TARGET_FOLDER}"' . "\n";
$script .= 'cp "' . $spareFile . '" "../sparefiles/' . $spareFile . '"' . "\n"; $script .= 'cp "' . $spareFile . '" "../sparefiles/' . $spareFile . '"' . "\n";
} }
@ -756,7 +756,7 @@ class AppServer {
$script .= $this->backUpSpareFiles($template, $spareFiles); $script .= $this->backUpSpareFiles($template, $spareFiles);
$script .= 'if [ -d "' . $template . '" ]; then ${IONICE}rm -rf "' . $template . '"; fi' . "\n"; $script .= 'if [ -d "' . $template . '" ]; then {$IONICE}rm -rf "' . $template . '"; fi' . "\n";
$this->addLogline('app_server.log', 'Server template ' . $serverDir . $template . ' owned by user ' . $this->appServerDetails['userNameExecute'] . ' deleted'); $this->addLogline('app_server.log', 'Server template ' . $serverDir . $template . ' owned by user ' . $this->appServerDetails['userNameExecute'] . ' deleted');
$script .= $this->restoreSpareFiles($template); $script .= $this->restoreSpareFiles($template);
@ -1628,7 +1628,7 @@ class AppServer {
$startCommand = str_replace($replaceSettings['placeholder'], $replaceSettings['replacePlaceholderWith'], $startCommand); $startCommand = str_replace($replaceSettings['placeholder'], $replaceSettings['replacePlaceholderWith'], $startCommand);
foreach (customColumns('G', $this->appServerDetails['id']) as $customColumn) { foreach (customColumns('G', $this->appServerDetails['id']) as $customColumn) {
$startCommand = str_replace("%${customColumn['name']}%", $customColumn['value'], $startCommand); $startCommand = str_replace("%{$customColumn['name']}%", $customColumn['value'], $startCommand);
} }
//If a template is set up for both OS, we might need to alter the start of the command //If a template is set up for both OS, we might need to alter the start of the command
@ -1692,7 +1692,7 @@ class AppServer {
$script .= $this->linuxStopApp(false, $scriptName); $script .= $this->linuxStopApp(false, $scriptName);
$script .= '${IONICE}find -L ' . $serverDir . ' -type l -delete' . "\n"; $script .= '{$IONICE}find -L ' . $serverDir . ' -type l -delete' . "\n";
$dirChmod = 700; $dirChmod = 700;
$fileChmod = 600; $fileChmod = 600;
@ -1701,34 +1701,34 @@ class AppServer {
$dirChmod = 750; $dirChmod = 750;
$fileChmod = 640; $fileChmod = 640;
$script .= '${IONICE}nice -n +19 find ' . $serverDir . ' -type d -print0 | xargs -0 chmod ' . $dirChmod . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $serverDir . ' -type d -print0 | xargs -0 chmod ' . $dirChmod . "\n";
if ($this->appServerDetails['template']['copyStartBinary'] == 'Y' and strlen($this->appServerDetails['template']['gameBinary']) > 0) { if ($this->appServerDetails['template']['copyStartBinary'] == 'Y' and strlen($this->appServerDetails['template']['gameBinary']) > 0) {
$script .= '${IONICE}nice -n +19 find ' . $serverDir . ' -type f ! -name "' . $this->appServerDetails['template']['gameBinary'] . '" -print0 | xargs -0 chmod ' . $dirChmod . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $serverDir . ' -type f ! -name "' . $this->appServerDetails['template']['gameBinary'] . '" -print0 | xargs -0 chmod ' . $dirChmod . "\n";
} else { } else {
$script .= '${IONICE}nice -n +19 find ' . $serverDir . ' -type f ! -name "ShooterGameServer" -print0 | xargs -0 chmod ' . $fileChmod . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $serverDir . ' -type f ! -name "ShooterGameServer" -print0 | xargs -0 chmod ' . $fileChmod . "\n";
} }
} else { } else {
$script .= '${IONICE}nice -n +19 find ' . $serverDir . ' -type d -print0 | xargs -0 chmod ' . $dirChmod . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $serverDir . ' -type d -print0 | xargs -0 chmod ' . $dirChmod . "\n";
if ($this->appServerDetails['template']['copyStartBinary'] == 'Y' and strlen($this->appServerDetails['template']['gameBinary']) > 0) { if ($this->appServerDetails['template']['copyStartBinary'] == 'Y' and strlen($this->appServerDetails['template']['gameBinary']) > 0) {
$script .= '${IONICE}nice -n +19 find ' . $serverDir . ' -type f ! -name "' . $this->appServerDetails['template']['gameBinary'] . '" -print0 | xargs -0 chmod ' . $dirChmod . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $serverDir . ' -type f ! -name "' . $this->appServerDetails['template']['gameBinary'] . '" -print0 | xargs -0 chmod ' . $dirChmod . "\n";
} else { } else {
$script .= '${IONICE}nice -n +19 find ' . $serverDir . ' -type f ! -name "ShooterGameServer" -print0 | xargs -0 chmod ' . $fileChmod . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $serverDir . ' -type f ! -name "ShooterGameServer" -print0 | xargs -0 chmod ' . $fileChmod . "\n";
} }
// Remove files where they do not belong // Remove files where they do not belong
$script .= '${IONICE}nice -n +19 find ' . $serverDir . ' -mindepth 1 -maxdepth 1 \( -type f -or -type l \) -delete' . "\n"; $script .= '{$IONICE}nice -n +19 find ' . $serverDir . ' -mindepth 1 -maxdepth 1 \( -type f -or -type l \) -delete' . "\n";
$script .= '${IONICE}nice -n +19 find ' . $this->removeSlashes($this->appServerDetails['homeDir'] . '/' . $this->appServerDetails['userName']) . ' -mindepth 1 -maxdepth 1 \( -type f -or -type l \)'; $script .= '{$IONICE}nice -n +19 find ' . $this->removeSlashes($this->appServerDetails['homeDir'] . '/' . $this->appServerDetails['userName']) . ' -mindepth 1 -maxdepth 1 \( -type f -or -type l \)';
$script .= ' ! -name ".profile" ! -name ".bashrc" ! -name ".bash_logout" -delete' . "\n"; $script .= ' ! -name ".profile" ! -name ".bashrc" ! -name ".bash_logout" -delete' . "\n";
// Remove folders where they do not belong // Remove folders where they do not belong
$script .= '${IONICE}nice -n +19 find ' . $this->removeSlashes($this->appServerDetails['homeDir'] . '/' . $this->appServerDetails['userName']) . ' -mindepth 1 -maxdepth 1 -type d'; $script .= '{$IONICE}nice -n +19 find ' . $this->removeSlashes($this->appServerDetails['homeDir'] . '/' . $this->appServerDetails['userName']) . ' -mindepth 1 -maxdepth 1 -type d';
$script .= ' ! -name ".steam" ! -name "pserver" ! -name "backup" ! -name "fdl_data" ! -name "server" -print0 | xargs -0 rm -rf' . "\n"; $script .= ' ! -name ".steam" ! -name "pserver" ! -name "backup" ! -name "fdl_data" ! -name "server" -print0 | xargs -0 rm -rf' . "\n";
$script .= '${IONICE}nice -n +19 find /home/' . $this->appMasterServerDetails['ssh2User'] . '/fdl_data -type f -user `whoami` ! -name "*.bz2" -delete' . "\n"; $script .= '{$IONICE}nice -n +19 find /home/' . $this->appMasterServerDetails['ssh2User'] . '/fdl_data -type f -user `whoami` ! -name "*.bz2" -delete' . "\n";
} }
if ($this->appServerDetails['template']['steamgame'] == 'S') { if ($this->appServerDetails['template']['steamgame'] == 'S') {
@ -1753,7 +1753,7 @@ class AppServer {
$script .= '`)' . "\n"; $script .= '`)' . "\n";
$script .= 'for BADFILE in ${FILESFOUND[@]}; do' . "\n"; $script .= 'for BADFILE in {$FILESFOUND[@]}; do' . "\n";
$script .= 'chmod 666 $BADFILE > /dev/null 2>&1' . "\n"; $script .= 'chmod 666 $BADFILE > /dev/null 2>&1' . "\n";
$script .= 'rm -f $BADFILE > /dev/null 2>&1' . "\n"; $script .= 'rm -f $BADFILE > /dev/null 2>&1' . "\n";
$script .= 'if [ -f $BADFILE ]; then exit 0; fi' . "\n"; $script .= 'if [ -f $BADFILE ]; then exit 0; fi' . "\n";
@ -1761,19 +1761,19 @@ class AppServer {
} }
if ($this->appMasterServerDetails['configBadTime'] > 0 and count($this->appMasterServerDetails['configBadFiles']) > 0) { if ($this->appMasterServerDetails['configBadTime'] > 0 and count($this->appMasterServerDetails['configBadFiles']) > 0) {
$script .= '${IONICE}find ' . $serverDir . ' -type f \( -iname "*.' . implode('" -or -iname "*.', $this->appMasterServerDetails['configBadFiles']) . '" \) -mtime +' . $this->appMasterServerDetails['configBadTime'] . ' -delete' . "\n"; $script .= '{$IONICE}find ' . $serverDir . ' -type f \( -iname "*.' . implode('" -or -iname "*.', $this->appMasterServerDetails['configBadFiles']) . '" \) -mtime +' . $this->appMasterServerDetails['configBadTime'] . ' -delete' . "\n";
} }
if ($this->appMasterServerDetails['configDemoTime'] > 0) { if ($this->appMasterServerDetails['configDemoTime'] > 0) {
$script .= '${IONICE}find ' . $serverTemplateDir . ' -type f -name "*.dem" -mtime +' . $this->appMasterServerDetails['configDemoTime'] . ' -delete' . "\n"; $script .= '{$IONICE}find ' . $serverTemplateDir . ' -type f -name "*.dem" -mtime +' . $this->appMasterServerDetails['configDemoTime'] . ' -delete' . "\n";
} }
if ($this->appMasterServerDetails['configLogTime'] > 0) { if ($this->appMasterServerDetails['configLogTime'] > 0) {
$script .= '${IONICE}find ' . $serverTemplateDir . ' -type f -name "*.log" -mtime +' . $this->appMasterServerDetails['configLogTime'] . ' -delete' . "\n"; $script .= '{$IONICE}find ' . $serverTemplateDir . ' -type f -name "*.log" -mtime +' . $this->appMasterServerDetails['configLogTime'] . ' -delete' . "\n";
} }
if ($this->appMasterServerDetails['configZtmpTime'] > 0) { if ($this->appMasterServerDetails['configZtmpTime'] > 0) {
$script .= '${IONICE}find ' . $serverTemplateDir . ' -type f -name "*.ztmp" -mtime +' . $this->appMasterServerDetails['configZtmpTime'] . ' -delete' . "\n"; $script .= '{$IONICE}find ' . $serverTemplateDir . ' -type f -name "*.ztmp" -mtime +' . $this->appMasterServerDetails['configZtmpTime'] . ' -delete' . "\n";
} }
$script .= 'cd ' . $this->appServerDetails['absolutePath'] . "\n"; $script .= 'cd ' . $this->appServerDetails['absolutePath'] . "\n";
@ -1868,14 +1868,14 @@ class AppServer {
$uploadScript = 'if [[ `which zip` ]]; then' . "\n"; $uploadScript = 'if [[ `which zip` ]]; then' . "\n";
$uploadScript .= 'if [ "$KEEP" == "" ]; then KEEP="-m"; fi' . "\n"; $uploadScript .= 'if [ "$KEEP" == "" ]; then KEEP="-m"; fi' . "\n";
$uploadScript .= '${IONICE}nice -n +19 zip -q $KEEP $DEMOPATH/$DEMO.zip $DEMOPATH/$DEMO' . "\n"; $uploadScript .= '{$IONICE}nice -n +19 zip -q $KEEP $DEMOPATH/$DEMO.zip $DEMOPATH/$DEMO' . "\n";
$uploadScript .= 'ZIP="zip"' . "\n"; $uploadScript .= 'ZIP="zip"' . "\n";
$uploadScript .= 'elif [[ `which bzip2` ]]; then' . "\n"; $uploadScript .= 'elif [[ `which bzip2` ]]; then' . "\n";
$uploadScript .= '${IONICE}nice -n +19 bzip2 -s -q -9 $KEEP $DEMOPATH/$DEMO' . "\n"; $uploadScript .= '{$IONICE}nice -n +19 bzip2 -s -q -9 $KEEP $DEMOPATH/$DEMO' . "\n";
$uploadScript .= 'ZIP="bz2"' . "\n"; $uploadScript .= 'ZIP="bz2"' . "\n";
$uploadScript .= 'fi' . "\n"; $uploadScript .= 'fi' . "\n";
$uploadScript .= 'DEMOANDPATH="$DEMOPATH/$DEMO.$ZIP"' . "\n"; $uploadScript .= 'DEMOANDPATH="$DEMOPATH/$DEMO.$ZIP"' . "\n";
$uploadScript .= 'wput -q --limit-rate=1024K --remove-source-files --tries 3 --basename="${DEMOPATH/\/\///}" "${DEMOANDPATH/\/\///}" "' . $this->appServerDetails['app']['uploadDir'] . '"' . "\n"; $uploadScript .= 'wput -q --limit-rate=1024K --remove-source-files --tries 3 --basename="{$DEMOPATH/\/\///}" "{$DEMOANDPATH/\/\///}" "' . $this->appServerDetails['app']['uploadDir'] . '"' . "\n";
// 2 and 3 are one time run (manuel mode) // 2 and 3 are one time run (manuel mode)
if (in_array($this->appServerDetails['app']['upload'], array(2, 3))) { if (in_array($this->appServerDetails['app']['upload'], array(2, 3))) {
@ -2213,7 +2213,7 @@ class AppServer {
$script = $this->shellScriptHeader; $script = $this->shellScriptHeader;
$script .= 'rm -f ' . $scriptName . "\n"; $script .= 'rm -f ' . $scriptName . "\n";
$script .= 'if [ -d "' . $serverDir . '" ]; then ${IONICE}rm -rf "' . $serverDir . '"; fi' . "\n"; $script .= 'if [ -d "' . $serverDir . '" ]; then {$IONICE}rm -rf "' . $serverDir . '"; fi' . "\n";
$script .= $this->linuxAddApp(array($targetTemplate), false); $script .= $this->linuxAddApp(array($targetTemplate), false);
@ -2304,7 +2304,7 @@ class AppServer {
$script .= 'find usermaps/ mods/ -type l -or -type f \( -iname "*.ff" -or -iname "*.iwd" \) 2> /dev/null | grep -v "' . $excludePattern . '" | while read FOUNDFILE; do' . "\n"; $script .= 'find usermaps/ mods/ -type l -or -type f \( -iname "*.ff" -or -iname "*.iwd" \) 2> /dev/null | grep -v "' . $excludePattern . '" | while read FOUNDFILE; do' . "\n";
} }
$script .= 'FILTEREDFILE=${FOUNDFILE//\.\//}' . "\n"; $script .= 'FILTEREDFILE={$FOUNDFILE//\.\//}' . "\n";
$script .= 'if [[ ! `grep "$FILTEREDFILE" "' . $fdlFileList . '"` ]]; then' . "\n"; $script .= 'if [[ ! `grep "$FILTEREDFILE" "' . $fdlFileList . '"` ]]; then' . "\n";
$script .= 'FILENAME=`basename $FILTEREDFILE`' . "\n"; $script .= 'FILENAME=`basename $FILTEREDFILE`' . "\n";
@ -2315,14 +2315,14 @@ class AppServer {
$script .= 'FDLDATADIR=' . $fdlMasterFolder . '`dirname "$FILTEREDFILE"`' . "\n"; $script .= 'FDLDATADIR=' . $fdlMasterFolder . '`dirname "$FILTEREDFILE"`' . "\n";
$script .= 'if [ ! -d $FDLDATADIR ]; then mkdir -p $FDLDATADIR; chmod 770 $FDLDATADIR; fi' . "\n"; $script .= 'if [ ! -d $FDLDATADIR ]; then mkdir -p $FDLDATADIR; chmod 770 $FDLDATADIR; fi' . "\n";
$script .= 'FDLDATAFILENAME="$FDLDATADIR/$FILENAME"' . "\n"; $script .= 'FDLDATAFILENAME="$FDLDATADIR/$FILENAME"' . "\n";
$script .= 'CHECKSUMNEW=`${IONICE}nice -n +19 md5sum "$ABSOLUTEFILTEREDFILE" | awk \'{print $1}\'`' . "\n"; $script .= 'CHECKSUMNEW=`{$IONICE}nice -n +19 md5sum "$ABSOLUTEFILTEREDFILE" | awk \'{print $1}\'`' . "\n";
$script .= 'if [ -f "$FDLDATAFILENAME.stat" -a -f "$FDLDATAFILENAME.bz2" ]; then' . "\n"; $script .= 'if [ -f "$FDLDATAFILENAME.stat" -a -f "$FDLDATAFILENAME.bz2" ]; then' . "\n";
$script .= 'CHECKSUMOLD=`head -n 1 "$FDLDATAFILENAME.stat" 2> /dev/null`' . "\n"; $script .= 'CHECKSUMOLD=`head -n 1 "$FDLDATAFILENAME.stat" 2> /dev/null`' . "\n";
$script .= 'else' . "\n"; $script .= 'else' . "\n";
$script .= 'CHECKSUMOLD=""' . "\n"; $script .= 'CHECKSUMOLD=""' . "\n";
$script .= 'fi' . "\n"; $script .= 'fi' . "\n";
$script .= 'if [ "$CHECKSUMOLD" != "$CHECKSUMNEW" ]; then' . "\n"; $script .= 'if [ "$CHECKSUMOLD" != "$CHECKSUMNEW" ]; then' . "\n";
$script .= '${IONICE}nice -n +19 bzip2 -k -s -q -9 -f -c "$ABSOLUTEFILTEREDFILE" > "$FDLDATAFILENAME.bz2"' . "\n"; $script .= '{$IONICE}nice -n +19 bzip2 -k -s -q -9 -f -c "$ABSOLUTEFILTEREDFILE" > "$FDLDATAFILENAME.bz2"' . "\n";
$script .= 'echo $CHECKSUMNEW > "$FDLDATAFILENAME.stat"' . "\n"; $script .= 'echo $CHECKSUMNEW > "$FDLDATAFILENAME.stat"' . "\n";
$script .= 'chmod 660 "$FDLDATAFILENAME.stat" "$FDLDATAFILENAME.bz2"' . "\n"; $script .= 'chmod 660 "$FDLDATAFILENAME.stat" "$FDLDATAFILENAME.bz2"' . "\n";
$script .= 'fi' . "\n"; $script .= 'fi' . "\n";
@ -2394,7 +2394,7 @@ class AppServer {
$script .= 'if [[ `lsof -f -- "' . $backUpFile . '" 2>/dev/null` ]]; then continue; fi' . "\n"; $script .= 'if [[ `lsof -f -- "' . $backUpFile . '" 2>/dev/null` ]]; then continue; fi' . "\n";
$script .= 'if [ -f "' . $backUpFile . '" ]; then rm -f "' . $backUpFile . '"; fi' . "\n"; $script .= 'if [ -f "' . $backUpFile . '" ]; then rm -f "' . $backUpFile . '"; fi' . "\n";
$script .= 'cd "' . $serverDir . '/$GAMETEMPLATE"' . "\n"; $script .= 'cd "' . $serverDir . '/$GAMETEMPLATE"' . "\n";
$script .= '${IONICE}nice -n +19 tar cfj "' . $backUpFile . '" .' . "\n"; $script .= '{$IONICE}nice -n +19 tar cfj "' . $backUpFile . '" .' . "\n";
if (strlen($ftpUploadString) > 0) { if (strlen($ftpUploadString) > 0) {
$script .= 'wput -q --limit-rate=4098 --basename="' . $backupDir . '" "' . $backUpFile . '" "' . $ftpUploadString . '"' . "\n"; $script .= 'wput -q --limit-rate=4098 --basename="' . $backupDir . '" "' . $backUpFile . '" "' . $ftpUploadString . '"' . "\n";
@ -2445,7 +2445,7 @@ class AppServer {
$script .= 'if [ ! -d "' . $this->removeSlashes($serverDir . '/' . $template) . '" ]; then mkdir -p "' . $this->removeSlashes($serverDir . '/' . $template) . '"; fi' . "\n"; $script .= 'if [ ! -d "' . $this->removeSlashes($serverDir . '/' . $template) . '" ]; then mkdir -p "' . $this->removeSlashes($serverDir . '/' . $template) . '"; fi' . "\n";
$script .= '${IONICE}nice -n +19 tar -C "' . $this->removeSlashes($serverDir . '/' . $template) . '" -xjf "' . $this->removeSlashes($backupDir . '/' . $this->appServerDetails['serverIP'] . '_' . $this->appServerDetails['port'] . '-' . $template . '.tar.bz2"') . "\n"; $script .= '{$IONICE}nice -n +19 tar -C "' . $this->removeSlashes($serverDir . '/' . $template) . '" -xjf "' . $this->removeSlashes($backupDir . '/' . $this->appServerDetails['serverIP'] . '_' . $this->appServerDetails['port'] . '-' . $template . '.tar.bz2"') . "\n";
$script .= 'wget -q --no-check-certificate -O - ' . webhostdomain($resellerLockupID) . '/get_password.php?w=rb\\&shorten=`id -un`\\id=' . $this->appServerDetails['port'] . '\\&ip=' . $this->appServerDetails['serverIP'] . "\n"; $script .= 'wget -q --no-check-certificate -O - ' . webhostdomain($resellerLockupID) . '/get_password.php?w=rb\\&shorten=`id -un`\\id=' . $this->appServerDetails['port'] . '\\&ip=' . $this->appServerDetails['serverIP'] . "\n";
$this->addLinuxScript($scriptName, $script); $this->addLinuxScript($scriptName, $script);
@ -2515,7 +2515,7 @@ class AppServer {
// While we keep on counting up, the mail is send only once to prevent spam // While we keep on counting up, the mail is send only once to prevent spam
if (($this->appMasterServerDetails['notified'] + 1) == $rSA['down_checks']) { if (($this->appMasterServerDetails['notified'] + 1) == $rSA['down_checks']) {
$query = ($resellerLockupID == 0) ? $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE `resellerid`=0 AND `accounttype`='a'") : $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE (`id`=${$resellerLockupID} AND `id`=`resellerid`) OR `resellerid`=0 AND `accounttype`='a'"); $query = ($resellerLockupID == 0) ? $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE `resellerid`=0 AND `accounttype`='a'") : $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE (`id`={$$resellerLockupID} AND `id`=`resellerid`) OR `resellerid`=0 AND `accounttype`='a'");
$query->execute(); $query->execute();
while ($row = $query->fetch(PDO::FETCH_ASSOC)) { while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
if ($row['mail_serverdown'] == 'Y') { if ($row['mail_serverdown'] == 'Y') {

View File

@ -277,7 +277,7 @@ class masterServer {
$this->shellScript .= '$SYNCCMD/masterserver/' . $shorten . ' ' . $this->masterserverDir . ' > ' . $updateLog . "\n"; $this->shellScript .= '$SYNCCMD/masterserver/' . $shorten . ' ' . $this->masterserverDir . ' > ' . $updateLog . "\n";
$this->shellScript .= 'elif [ "$SYNCTOOL" == "wget" ]; then' . "\n"; $this->shellScript .= 'elif [ "$SYNCTOOL" == "wget" ]; then' . "\n";
$this->shellScript .= '$SYNCCMD/masterserver/' . $shorten . ' > ' . $updateLog . "\n"; $this->shellScript .= '$SYNCCMD/masterserver/' . $shorten . ' > ' . $updateLog . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $this->masterserverDir . $shorten . '/ -type f -name "*.listing" -delete' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $this->masterserverDir . $shorten . '/ -type f -name "*.listing" -delete' . "\n";
$this->shellScript .= 'fi' . "\n"; $this->shellScript .= 'fi' . "\n";
} else { } else {
@ -292,21 +292,21 @@ class masterServer {
private function houseKeeping ($absoluteGamePath) { private function houseKeeping ($absoluteGamePath) {
// Workaround for another valve chaos. If the files exist, mapgroups will not work properly // Workaround for another valve chaos. If the files exist, mapgroups will not work properly
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -maxdepth 2 -type f -name "subscribed_file_ids.txt" -o -name "subscribed_collection_ids.txt" -delete' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -maxdepth 2 -type f -name "subscribed_file_ids.txt" -o -name "subscribed_collection_ids.txt" -delete' . "\n";
// Chmods should be aligned or else the server install for customer will not work // Chmods should be aligned or else the server install for customer will not work
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.0" -or -iname "*.1" -or -iname "*.2" -or -iname "*.3" -or -iname "*.3ds" -or -iname "*.4" -or -iname "*.5" -or -iname "*.6" -or -iname "*.7" -or -iname "*.8" -or -iname "*.9" -or -iname "*.amx" -or -iname "*.asi" -or -iname "*.asm" -or -iname "*.bin" \) -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.0" -or -iname "*.1" -or -iname "*.2" -or -iname "*.3" -or -iname "*.3ds" -or -iname "*.4" -or -iname "*.5" -or -iname "*.6" -or -iname "*.7" -or -iname "*.8" -or -iname "*.9" -or -iname "*.amx" -or -iname "*.asi" -or -iname "*.asm" -or -iname "*.bin" \) -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.bmp" -or -iname "*.BMP" -or -iname "*.bsp" -or -iname "*.bz2" -or -iname "*.c" -or -iname "*.cab" -or -iname "*.cache" -or -iname "*.cfg" -or -iname "*.cmake" -or -iname "*.col" -or -iname "*.conf" -or -iname "*.cpp" -or -iname "*.css" -or -iname "*.csv" \) -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.bmp" -or -iname "*.BMP" -or -iname "*.bsp" -or -iname "*.bz2" -or -iname "*.c" -or -iname "*.cab" -or -iname "*.cache" -or -iname "*.cfg" -or -iname "*.cmake" -or -iname "*.col" -or -iname "*.conf" -or -iname "*.cpp" -or -iname "*.css" -or -iname "*.csv" \) -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.cur" -or -iname "*.dat" -or -iname "*.db" -or -iname "*.dds" -or -iname "*.def" -or -iname "*.dff" -or -iname "*.dll" -or -iname "*.doc" -or -iname "*.dsp" -or -iname "*.dxf" -or -iname "*.dylib" -or -iname "*.edf" -or -iname "*.ekv" -or -iname "*.example" \) -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.cur" -or -iname "*.dat" -or -iname "*.db" -or -iname "*.dds" -or -iname "*.def" -or -iname "*.dff" -or -iname "*.dll" -or -iname "*.doc" -or -iname "*.dsp" -or -iname "*.dxf" -or -iname "*.dylib" -or -iname "*.edf" -or -iname "*.ekv" -or -iname "*.example" \) -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.exe" -or -iname "*.exp" -or -iname "*.fgd" -or -iname "*.flt" -or -iname "*.fx" -or -iname "*.gam" -or -iname "*.Gbx" -or -iname "*.gif" -or -iname "*.h" -or -iname "*.hpp" -or -iname "*.htm" -or -iname "*.html" -or -iname "*.icns" -or -iname "*.ico" \) -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.exe" -or -iname "*.exp" -or -iname "*.fgd" -or -iname "*.flt" -or -iname "*.fx" -or -iname "*.gam" -or -iname "*.Gbx" -or -iname "*.gif" -or -iname "*.h" -or -iname "*.hpp" -or -iname "*.htm" -or -iname "*.html" -or -iname "*.icns" -or -iname "*.ico" \) -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.image" -or -iname "*.inc" -or -iname "*.inf" -or -iname "*.ini" -or -iname "*.installed" -or -iname "*.jpg" -or -iname "*.js" -or -iname "*.key" -or -iname "*.kv" -or -iname "*.lib" -or -iname "*.lmp" -or -iname "*.lst" -or -iname "*.lua" -or -iname "*.LUA" \) -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.image" -or -iname "*.inc" -or -iname "*.inf" -or -iname "*.ini" -or -iname "*.installed" -or -iname "*.jpg" -or -iname "*.js" -or -iname "*.key" -or -iname "*.kv" -or -iname "*.lib" -or -iname "*.lmp" -or -iname "*.lst" -or -iname "*.lua" -or -iname "*.LUA" \) -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.manifest" -or -iname "*.map" -or -iname "*.mapRACE" -or -iname "*.mdl" -or -iname "*.mix" -or -iname "*.mp3" -or -iname "*.nav" -or -iname "*.nod" -or -iname "*.nut" -or -iname "*.pak" -or -iname "*.pcx" -or -iname "*.pem" -or -iname "*.pl" \) -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.manifest" -or -iname "*.map" -or -iname "*.mapRACE" -or -iname "*.mdl" -or -iname "*.mix" -or -iname "*.mp3" -or -iname "*.nav" -or -iname "*.nod" -or -iname "*.nut" -or -iname "*.pak" -or -iname "*.pcx" -or -iname "*.pem" -or -iname "*.pl" \) -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.png" -or -iname "*.properties" -or -iname "*.psd" -or -iname "*.pwn" -or -iname "*.rad" -or -iname "*.raw" -or -iname "*.rc" -or -iname "*.rec" -or -iname "*.res" -or -iname "*.rules" -or -iname "*.sc" -or -iname "*.scr" -or -iname "*.sfk" \) -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.png" -or -iname "*.properties" -or -iname "*.psd" -or -iname "*.pwn" -or -iname "*.rad" -or -iname "*.raw" -or -iname "*.rc" -or -iname "*.rec" -or -iname "*.res" -or -iname "*.rules" -or -iname "*.sc" -or -iname "*.scr" -or -iname "*.sfk" \) -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.sln" -or -iname "*.so" -or -iname "*.spr" -or -iname "*.suo" -or -iname "*.swf" -or -iname "*.tar" -or -iname "*.tga" -or -iname "*.ttf" -or -iname "*.txd" -or -iname "*.txt" -or -iname "*.vbf" -or -iname "*.vcproj" -or -iname "*.vcs" -or -iname "*.vdf" \) -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.sln" -or -iname "*.so" -or -iname "*.spr" -or -iname "*.suo" -or -iname "*.swf" -or -iname "*.tar" -or -iname "*.tga" -or -iname "*.ttf" -or -iname "*.txd" -or -iname "*.txt" -or -iname "*.vbf" -or -iname "*.vcproj" -or -iname "*.vcs" -or -iname "*.vdf" \) -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.vfe" -or -iname "*.vfont" -or -iname "*.vmf" -or -iname "*.vmt" -or -iname "*.vpk" -or -iname "*.vtf" -or -iname "*.wad" -or -iname "*.wav" -or -iname "*.wv" -or -iname "*.xml" -or -iname "*.xsc" -or -iname "*.yml" -or -iname "*.zip" \) -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f \( -iname "*.vfe" -or -iname "*.vfont" -or -iname "*.vmf" -or -iname "*.vmt" -or -iname "*.vpk" -or -iname "*.vtf" -or -iname "*.wad" -or -iname "*.wav" -or -iname "*.wv" -or -iname "*.xml" -or -iname "*.xsc" -or -iname "*.yml" -or -iname "*.zip" \) -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f -name "srcds_*" -o -name "hlds_*" -o -name "*.run" -o -name "*.sh" -o -name "*.jar" -exec chmod 750 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f -name "srcds_*" -o -name "hlds_*" -o -name "*.run" -o -name "*.sh" -o -name "*.jar" -exec chmod 750 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f ! -perm -750 ! -perm -755 -exec chmod 640 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type f ! -perm -750 ! -perm -755 -exec chmod 640 {} \;' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type d -exec chmod 750 {} \;' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find ' . $absoluteGamePath . ' -type d -exec chmod 750 {} \;' . "\n";
// Check for temp files belonging to the steam updater // Check for temp files belonging to the steam updater
$this->shellScript .= 'ls ' . $absoluteGamePath . ' | while read dir; do' . "\n"; $this->shellScript .= 'ls ' . $absoluteGamePath . ' | while read dir; do' . "\n";
@ -338,7 +338,7 @@ class masterServer {
$this->shellScript .= 'SEARCH=1' . "\n"; $this->shellScript .= 'SEARCH=1' . "\n";
$this->shellScript .= 'fi' . "\n"; $this->shellScript .= 'fi' . "\n";
$this->shellScript .= 'if [ "$SEARCH" == "1" ]; then' . "\n"; $this->shellScript .= 'if [ "$SEARCH" == "1" ]; then' . "\n";
$this->shellScript .= '${IONICE}nice -n +19 find $SEARCHFOLDERS -type f 2> /dev/null | grep -v "$PATTERN" | sed \'s/\.\///g\' | while read FILTEREDFILES; do' . "\n"; $this->shellScript .= '{$IONICE}nice -n +19 find $SEARCHFOLDERS -type f 2> /dev/null | grep -v "$PATTERN" | sed \'s/\.\///g\' | while read FILTEREDFILES; do' . "\n";
$this->shellScript .= 'echo $FILTEREDFILES >> ' . $fastDownloadList . "\n"; $this->shellScript .= 'echo $FILTEREDFILES >> ' . $fastDownloadList . "\n";
$this->shellScript .= 'done' . "\n"; $this->shellScript .= 'done' . "\n";
$this->shellScript .= 'if [ -f ' . $fastDownloadList . ' ]; then chmod 640 ' . $fastDownloadList . '; fi' . "\n"; $this->shellScript .= 'if [ -f ' . $fastDownloadList . ' ]; then chmod 640 ' . $fastDownloadList . '; fi' . "\n";
@ -411,7 +411,7 @@ class masterServer {
$this->shellScript .= 'cd /home/' . $this->sshuser . '/masterserver/steamCMD/'. "\n"; $this->shellScript .= 'cd /home/' . $this->sshuser . '/masterserver/steamCMD/'. "\n";
$this->shellScript .= 'taskset -c 0 ${IONICE}nice -n +19 ./steamcmd.sh +force_install_dir ' . $absoluteGamePath . ' +login '; $this->shellScript .= 'taskset -c 0 {$IONICE}nice -n +19 ./steamcmd.sh +force_install_dir ' . $absoluteGamePath . ' +login ';
if (strlen($this->steamAccount) > 0) { if (strlen($this->steamAccount) > 0) {
$this->shellScript .= $this->steamAccount . ' ' . $this->steamPassword; $this->shellScript .= $this->steamAccount . ' ' . $this->steamPassword;
@ -642,7 +642,7 @@ class masterServer {
// While we keep on counting up, the mail is send only once to prevent spam // While we keep on counting up, the mail is send only once to prevent spam
if (($this->rootNotifiedCount + 1) == $rSA['down_checks']) { if (($this->rootNotifiedCount + 1) == $rSA['down_checks']) {
$query = ($resellerLockupID == 0) ? $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE `resellerid`=0 AND `accounttype`='a'") : $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE (`id`=${$resellerLockupID} AND `id`=`resellerid`) OR `resellerid`=0 AND `accounttype`='a'"); $query = ($resellerLockupID == 0) ? $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE `resellerid`=0 AND `accounttype`='a'") : $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE (`id`={$$resellerLockupID} AND `id`=`resellerid`) OR `resellerid`=0 AND `accounttype`='a'");
$query->execute(); $query->execute();
while ($row = $query->fetch(PDO::FETCH_ASSOC)) { while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
if ($row['mail_serverdown'] == 'Y') { if ($row['mail_serverdown'] == 'Y') {
@ -771,14 +771,14 @@ class masterServer {
// When the logfile is missing the update is still running // When the logfile is missing the update is still running
$this->shellScript .= 'if [ ! -f ' . $updateLog . ' ]; then' . "\n"; $this->shellScript .= 'if [ ! -f ' . $updateLog . ' ]; then' . "\n";
$this->shellScript .= 'UPDATESTATUS="${UPDATESTATUS};' . $shorten . '=1"' . "\n"; $this->shellScript .= 'UPDATESTATUS="{$UPDATESTATUS};' . $shorten . '=1"' . "\n";
$this->shellScript .= 'else' . "\n"; $this->shellScript .= 'else' . "\n";
// If it exists and the update is not running, the update is finished // If it exists and the update is not running, the update is finished
$this->shellScript .= 'if [ "`ps fx | grep \'masterserver/' . $shorten . '\' | grep -v grep | head -n 1`" ]; then' . "\n"; $this->shellScript .= 'if [ "`ps fx | grep \'masterserver/' . $shorten . '\' | grep -v grep | head -n 1`" ]; then' . "\n";
$this->shellScript .= 'UPDATESTATUS="${UPDATESTATUS};' . $shorten . '=1"' . "\n"; $this->shellScript .= 'UPDATESTATUS="{$UPDATESTATUS};' . $shorten . '=1"' . "\n";
$this->shellScript .= 'else' . "\n"; $this->shellScript .= 'else' . "\n";
$this->shellScript .= 'UPDATESTATUS="${UPDATESTATUS};' . $shorten . '=0"' . "\n"; $this->shellScript .= 'UPDATESTATUS="{$UPDATESTATUS};' . $shorten . '=0"' . "\n";
$this->shellScript .= 'fi' . "\n"; $this->shellScript .= 'fi' . "\n";
$this->shellScript .= 'fi' . "\n"; $this->shellScript .= 'fi' . "\n";

View File

@ -85,7 +85,7 @@ class TS3 {
$metaData = stream_get_meta_data($this->socket); $metaData = stream_get_meta_data($this->socket);
} }
if ($this->debug == true) { if ($this->debug == true) {
print "Raw query return: ${response}\r\n"; print "Raw query return: {$response}\r\n";
} }
@list($databody, $errorcode) = explode('error id=', str_replace(array("\r", "\n"), '', $response)); @list($databody, $errorcode) = explode('error id=', str_replace(array("\r", "\n"), '', $response));

View File

@ -85,7 +85,7 @@ if (isset($newsInclude) and $newsInclude == true) {
$theCount = 0; $theCount = 0;
if (isset($printToConsole)) { if (isset($printToConsole)) {
print "Getting Feed Updates for Steamgame with AppID ${lookUpAppID}\r\n"; print "Getting Feed Updates for Steamgame with AppID {$lookUpAppID}\r\n";
} }
foreach ($json->appnews->newsitems as $item) { foreach ($json->appnews->newsitems as $item) {
@ -108,7 +108,7 @@ if (isset($newsInclude) and $newsInclude == true) {
} else { } else {
if (isset($printToConsole)) { if (isset($printToConsole)) {
print "Failed getting Feed Updates for Steamgame with AppID ${lookUpAppID}\r\n"; print "Failed getting Feed Updates for Steamgame with AppID {$lookUpAppID}\r\n";
} }
} }
} }
@ -203,7 +203,7 @@ if (isset($newsInclude) and $newsInclude == true) {
if ($twitter == 'Y') { if ($twitter == 'Y') {
if (isset($printToConsole)) { if (isset($printToConsole)) {
print "Getting Updates for Twitter Feed ${row2['loginName']}\r\n"; print "Getting Updates for Twitter Feed {$row2['loginName']}\r\n";
} }
/** /**
* Twitter API 1.1 * Twitter API 1.1
@ -248,7 +248,7 @@ if (isset($newsInclude) and $newsInclude == true) {
} else { } else {
if (isset($printToConsole)) { if (isset($printToConsole)) {
print "Getting Feed Updates for Feed ${row2['feedUrl']}\r\n"; print "Getting Feed Updates for Feed {$row2['feedUrl']}\r\n";
} }
$port = 80; $port = 80;

View File

@ -1684,7 +1684,7 @@ $(function() {
* @return string * @return string
*/ */
function getLoginHeader($valueOfTitle){ function getLoginHeader($valueOfTitle){
return preg_replace('/(.+)[\s](.+)/i', '<b>${1}</b> $2', $valueOfTitle, -1, $count); return preg_replace('/(.+)[\s](.+)/i', '<b>{$1}</b> $2', $valueOfTitle, -1, $count);
} }
function parseHeaders($data) function parseHeaders($data)

View File

@ -118,7 +118,7 @@ if (!function_exists('ssh2_execute')) {
} }
if ($notified == $rSA['down_checks']) { if ($notified == $rSA['down_checks']) {
$query = ($resellerID == 0) ? $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE `resellerid`=0 AND `accounttype`='a'") : $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE (`id`=${resellerID} AND `id`=`resellerid`) OR `resellerid`=0 AND `accounttype`='a'"); $query = ($resellerID == 0) ? $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE `resellerid`=0 AND `accounttype`='a'") : $sql->prepare("SELECT `id`,`mail_serverdown` FROM `userdata` WHERE (`id`={$resellerID} AND `id`=`resellerid`) OR `resellerid`=0 AND `accounttype`='a'");
$query->execute(); $query->execute();
while ($row2 = $query->fetch(PDO::FETCH_ASSOC)) { while ($row2 = $query->fetch(PDO::FETCH_ASSOC)) {
if ($row2['mail_serverdown'] == 'Y') { if ($row2['mail_serverdown'] == 'Y') {

View File

@ -480,21 +480,21 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$oldServerTemplate = $row['servertemplate']; $oldServerTemplate = $row['servertemplate'];
$fps = ($row['userfps'] == 'Y' and $ui->id("fps_${switchID}", 4, 'post')) ? $ui->id("fps_${switchID}", 4, 'post') : $row['fps']; $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']; $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']; $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']; $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']; $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; $serverTemplate = ($ui->id("servertemplate_{$switchID}", 1, 'post')) ? $ui->id("servertemplate_{$switchID}", 1, 'post') : 1;
$modcmd = $ui->escaped("mod_${switchID}", 'post'); $modcmd = $ui->escaped("mod_{$switchID}", 'post');
$workShop = ($ui->active("workShop_${switchID}", 'post')) ? $ui->active("workShop_${switchID}", 'post') : 'Y'; $workShop = ($ui->active("workShop_{$switchID}", 'post')) ? $ui->active("workShop_{$switchID}", 'post') : 'Y';
$workshopCollection = $ui->id("workshopCollection_${switchID}", 10, 'post') ? $ui->id("workshopCollection_${switchID}", 10, 'post') : null; $workshopCollection = $ui->id("workshopCollection_{$switchID}", 10, 'post') ? $ui->id("workshopCollection_{$switchID}", 10, 'post') : null;
$webapiAuthkey = $ui->w("webapiAuthkey_${switchID}", 32, 'post'); $webapiAuthkey = $ui->w("webapiAuthkey_{$switchID}", 32, 'post');
$steamServerToken = $ui->w("steamServerToken_${switchID}", 32, 'post'); $steamServerToken = $ui->w("steamServerToken_{$switchID}", 32, 'post');
if ($ui->id("anticheat_${switchID}", 1, 'post')) { if ($ui->id("anticheat_{$switchID}", 1, 'post')) {
$anticheat=($ui->id("anticheat_${switchID}", 1, 'post')>0) ? $ui->id("anticheat_${switchID}", 1, 'post') : 1; $anticheat=($ui->id("anticheat_{$switchID}", 1, 'post')>0) ? $ui->id("anticheat_{$switchID}", 1, 'post') : 1;
if ($row['shorten'] == 'cstrike' or $row['shorten'] == 'czero') { if ($row['shorten'] == 'cstrike' or $row['shorten'] == 'czero') {

View File

@ -365,7 +365,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
foreach ($selected as $get) { foreach ($selected as $get) {
$temp .= ($i == 0) ? "`state`='${get}'" : " OR `state`='${get}'"; $temp .= ($i == 0) ? "`state`='{$get}'" : " OR `state`='{$get}'";
$selected[] = $get; $selected[] = $get;

View File

@ -735,7 +735,7 @@ class LightOpenID
$this->aliases[$alias] = 'http://axschema.org/' . $field; $this->aliases[$alias] = 'http://axschema.org/' . $field;
if (empty($counts[$alias])) $counts[$alias] = 0; if (empty($counts[$alias])) $counts[$alias] = 0;
$counts[$alias] += 1; $counts[$alias] += 1;
${$type}[] = $alias; {$$type}[] = $alias;
} }
} }
foreach ($this->aliases as $alias => $ns) { foreach ($this->aliases as $alias => $ns) {

View File

@ -925,7 +925,7 @@ class LightOpenID
$counts[$alias] = 0; $counts[$alias] = 0;
} }
$counts[$alias] += 1; $counts[$alias] += 1;
${$type}[] = $alias; {$$type}[] = $alias;
} }
} }
foreach ($this->aliases as $alias => $ns) { foreach ($this->aliases as $alias => $ns) {

View File

@ -179,7 +179,7 @@ class Stream
if ($host[0] == '$') { if ($host[0] == '$') {
$host = substr($host, 1); $host = substr($host, 1);
global ${$host}; global {$$host};
if (($$host instanceof SFTP) === false) { if (($$host instanceof SFTP) === false) {
return false; return false;
} }