Ulrich Block 2013-10-03 16:48:54 +02:00
parent 446b4a5721
commit 2355ef0da8
59 changed files with 343 additions and 307 deletions

View File

@ -311,6 +311,12 @@ echo ' HideFiles (^\..+|\.ssh|\.bash_history|\.bash_logout|\.bashrc|\.profile)$
AllowAll
</Limit>
</Directory>
<Directory ~/server/*/teeworlds*/*>
Umask 077 077
<Limit RNFR RNTO STOR DELE MKD RMD>
AllowAll
</Limit>
</Directory>
<Directory ~/server/*/*/orangebox/*/*>
Umask 077 077
<Limit RNFR RNTO STOR DELE MKD RMD>

View File

@ -50,15 +50,15 @@ if ($ui->st('w','get') == 'ms' and $ui->username('shorten','50','get')) {
$query = $sql->prepare("SELECT r.`id`,r.`resellerid`,r.`installing`,r.`updating`,d.`resellerid` AS `userid`,s.`steamVersion`,r.`localVersion` FROM `rservermasterg` r INNER JOIN `rserverdata` d ON r.`serverid`=d.`id` INNER JOIN `servertypes` s ON r.`servertypeid`=s.`id` WHERE s.`shorten`=? AND (d.`ip`=? OR d.`altips` LIKE ?) LIMIT 1");
$query->execute(array($ui->username('shorten','50','get'),$ip,'%'.$ip.'%'));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
if ($row['installing'] == 'Y' or $row['updating'] == 'Y' or $row['installing']==null or $row['steamVersion']>$row['localVersion'] or $row['steamVersion']==null or $row['steamVersion'] == '') {
if ($row['steamVersion']==null) {
if ($row['installing'] == 'Y' or $row['updating'] == 'Y' or $row['installing'] == null or $row['steamVersion']>$row['localVersion'] or $row['steamVersion'] == null or $row['steamVersion'] == '') {
if ($row['steamVersion'] == null) {
$query = $sql->prepare("UPDATE `rservermasterg` SET `installing`='N',`updating`='N' WHERE `id`=? LIMIT 1");
$query->execute(array($row['id']));
} else {
$query = $sql->prepare("UPDATE `rservermasterg` SET `localVersion`=?,`installing`='N',`updating`='N' WHERE `id`=? LIMIT 1");
$query->execute(array($row['steamVersion'], $row['id']));
}
if ($row['installing'] == 'Y' or $row['installing']==null or $row['steamVersion']>$row['localVersion'] or $row['steamVersion']==null or $row['steamVersion'] == '') {
if ($row['installing'] == 'Y' or $row['installing'] == null or $row['steamVersion']>$row['localVersion'] or $row['steamVersion'] == null or $row['steamVersion'] == '') {
$query = $sql->prepare("SELECT `id` FROM `userdata` WHERE ((`resellerid`=? AND `accounttype`='a') OR (`id`=? AND `accounttype`='r')) AND `mail_gsupdate`='Y'");
$query->execute(array($row['resellerid'], $row['resellerid']));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row2) {

View File

@ -291,7 +291,7 @@ XML;
$query2 = $sql->prepare("SELECT v.`ip`,v.`port`,v.`dns`,m.`type`,m.`usedns` FROM `voice_server` v LEFT JOIN `voice_masterserver` m ON v.`masterserver`=m.`id` WHERE v.`id`=? AND v.`resellerid`=? LIMIT 1");
$query2->execute(array($serverid,$reseller_id));
foreach ($query2->fetchall(PDO::FETCH_ASSOC) as $row2) {
$server=($row2['usedns'] == 'N' or $row2['dns']==null or $row2['dns'] == '') ? $row2['ip'] . ':' . $row2['port'] : $row2['dns'];
$server=($row2['usedns'] == 'N' or $row2['dns'] == null or $row2['dns'] == '') ? $row2['ip'] . ':' . $row2['port'] : $row2['dns'];
$serverip=$row2['ip'];
$port=$row2['port'];
}

View File

@ -350,7 +350,7 @@ if (!isset($ip) or $_SERVER['SERVER_ADDR']==$ip) {
$ftppass=$row2['decryptedftppass'];
$decryptedftppass=$row2['decryptedppassword'];
$protected_old=$row2['protected'];
if ($row2['serverid']==null) {
if ($row2['serverid'] == null) {
$query3 = $sql->prepare("SELECT `id` FROM `serverlist` WHERE `switchID`=? LIMIT 1");
$query3->execute(array($gsswitchID));
$runID_old=$query3->fetchColumn();

View File

@ -346,7 +346,7 @@ if ($ui->smallletters('w',5,'get') == 'check') {
include(EASYWIDIR . '/stuff/ssh_exec.php');
include(EASYWIDIR . '/stuff/class_masterserver.php');
include(EASYWIDIR . '/stuff/keyphrasefile.php');
$rootServer=new masterServer($ui->id('id',10,'get'), $aeskey);
$rootServer=new masterServer($ui->id('id', 10, 'get'), $aeskey);
$games=explode("_", $ui->username('gamestring','50','get'));
$i = 1;
$gamelist = array();
@ -365,7 +365,7 @@ if ($ui->smallletters('w',5,'get') == 'check') {
if ($rootServer->sshcmd===null) {
echo 'Nothing to update/sync!';
} else {
if (ssh2_execute('gs', $ui->id('id',10,'get'), $rootServer->sshcmd)===false) {
if (ssh2_execute('gs', $ui->id('id', 10, 'get'), $rootServer->sshcmd)===false) {
echo $sprache->error_root_updatemaster." ( ".implode(", ", $gamelist)." ) ( $start )";
} else {
$rootServer->setUpdating();
@ -377,17 +377,17 @@ if ($ui->smallletters('w',5,'get') == 'check') {
$query = $sql->prepare("SELECT m.`maxserver`,COUNT(v.`id`) AS `installedserver`,m.`maxslots`,SUM(v.`slots`) AS `installedslots`,SUM(v.`usedslots`) AS `uslots` FROM `voice_masterserver` m LEFT JOIN `voice_server` v ON m.`id`=v.`masterserver` WHERE m.`id`=? AND m.`resellerid`=? LIMIT 1");
$query->execute(array($ui->id('id',19,'get'), $reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
if ($row['installedserver']==null) {
if ($row['installedserver'] == null) {
$installedserver = 0;
} else {
$installedserver=$row['installedserver'];
}
if ($row['installedslots']==null) {
if ($row['installedslots'] == null) {
$installedslots = 0;
} else {
$installedslots=$row['installedslots'];
}
if ($row['uslots']==null) {
if ($row['uslots'] == null) {
$uslots = 0;
} else {
$uslots=$row['uslots'];

View File

@ -277,13 +277,13 @@ if (!isset($ip) or $_SERVER['SERVER_ADDR'] == $ip) {
$port = $row['port'];
$server = $serverip . ':' . $port;
if (!in_array($qstat, array('', null, false))) {
if ($qstat != 'minecraft' and $qstat != 'tm' and $qstat != 'gtasamp'){
if (in_array($qstat, array('minecraft', 'tm', 'gtasamp', 'teeworlds'))) {
$other[] = array('qstat' => $qstat,'server' => $server, 'switchID' => $row['id']);
} else {
$queries[] = '-' . $qstat . ' ' . $server;
$i++;
} else if ($qstat == 'minecraft' or $qstat == 'tm' or $qstat == 'gtasamp') {
$other[] = array('qstat' => $qstat,'server' => $server, 'switchID' => $row['id']);
}
if ($i==50) {
if ($i == 50) {
$querry_array[] = implode(' ', $queries);
$queries = array();
$i = 1;
@ -502,16 +502,16 @@ if (!isset($ip) or $_SERVER['SERVER_ADDR'] == $ip) {
}
if (isset($userid) and isset($serverid)) {
$status = 'UP';
if ($qstat == 'gtasamp' or $qstat == 'minecraft') {
$query = ($qstat == 'gtasamp') ? GTASAMP($serverip, $port) : MineCraft($serverip, $port);
if ($qstat == 'gtasamp' or $qstat == 'minecraft' or $qstat == 'teeworlds') {
$query = serverQuery($serverip, $port, $qstat);
if (is_array($query)) {
$name = $query['hostname'];
$password=($query['password'] == '1') ? 'Y' : 'N';
$password = ($query['password'] == 1) ? 'Y' : 'N';
$numplayers = $query['players'];
$maxplayers = $query['slots'];
$map = $query['map'];
} else {
$status='DOWN';
$status = 'DOWN';
$name = $gametype . 'OFFLINE';
$numplayers = 0;
$maxplayers = 0;
@ -821,8 +821,8 @@ if (!isset($ip) or $_SERVER['SERVER_ADDR'] == $ip) {
$initialpassword = $vrow2['initialpassword'];
$maxtrafficmb = $vrow2['maxtraffic'];
$maxtraffic = $maxtrafficmb*1024;
$filetraffic=($vrow2['filetraffic']==null) ? 0 : $vrow2['filetraffic'];
$lastfiletraffic=($vrow2['lastfiletraffic']==null) ? 0 : $vrow2['lastfiletraffic'];
$filetraffic=($vrow2['filetraffic'] == null) ? 0 : $vrow2['filetraffic'];
$lastfiletraffic=($vrow2['lastfiletraffic'] == null) ? 0 : $vrow2['lastfiletraffic'];
$newtrafficdata = $lastfiletraffic;
$newtraffic = $filetraffic;
}

View File

@ -51,13 +51,13 @@ if ($reseller_id==0) {
$logreseller = 0;
}
if ($reseller_id != 0 and $admin_id != $reseller_id) $reseller_id=$admin_id;
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get') == 'ex' and $ui->id('id',10,'get')) {
} else if ($ui->st('d','get') == 'ex' and $ui->id('id', 10, 'get')) {
$xml=new DOMDocument('1.0','utf-8');
$element=$xml->createElement('addon');
$query = $sql->prepare("SELECT * FROM `addons` WHERE `id`=? AND `resellerid`=?");
$query->execute(array($ui->id('id',10,'get'),$reseller_id));
$query->execute(array($ui->id('id', 10, 'get'),$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$addon=$row['addon'];
foreach ($row as $k=>$v) {

View File

@ -66,7 +66,7 @@ if ($reseller_id==0) {
$lookupID=$admin_id;
}
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->smallletters('action',2,'post') == 'md'){
$query = $sql->prepare("SELECT COUNT(`active`) AS `amount` FROM `api_external_auth` LIMIT 1");

View File

@ -65,7 +65,7 @@ if ($reseller_id==0) {
$lookupID=$admin_id;
}
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if (in_array($ui->st('d','get'), array('md','ad'))){
if (!in_array($ui->smallletters('action',2,'post'), array('md','ad')) and $ui->st('d','get') == 'md') {

View File

@ -54,7 +54,7 @@ if ($reseller_id==0) {
$lookupID=($admin_id != $reseller_id) ? $reseller_id : $admin_id;
$logreseller = 0;
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->smallletters('action',2,'post') == 'md'){
$query = $sql->prepare("SELECT COUNT(`active`) AS `amount` FROM `api_settings` WHERE `resellerID`=? LIMIT 1");

View File

@ -1,4 +1,5 @@
<?php
/**
* File: class_masterserver.php.
* Author: Ulrich Block
@ -142,7 +143,7 @@ class masterServer {
// collect data regarding installed games
public function collectData ($all=true,$force=false) {
if ($this->rootOK!=true) {
if ($this->rootOK != true) {
return null;
}
@ -152,11 +153,11 @@ class masterServer {
if ($force==true) {
$extraSQL = '';
} else {
$extraSQL='AND t.`updates`!=3 AND s.`updates`!=3';
$extraSQL = 'AND t.`updates`!=3 AND s.`updates`!=3';
}
// if an ID is given collect only data for this ID, else collect all game data for this rootserver
if ($all===true) {
if ($all === true) {
$query = $sql->prepare("SELECT t.`shorten`,t.`qstat`,r.`localVersion`,t.`steamgame`,t.`appID`,t.`steamVersion`,t.`updates`,s.`updates` AS `supdates` FROM `rservermasterg` r INNER JOIN `servertypes` t ON r.`servertypeid`=t.`id` INNER JOIN `rserverdata` s ON r.`serverid`=s.`id` WHERE r.`serverid`=? ${extraSQL}");
$query->execute(array($this->rootID));
} else {
@ -184,7 +185,7 @@ class masterServer {
// steamCmd installations
if ($row['steamgame'] == 'S') {
$lookUpAppID=($row['appID']==90) ? $row['appID'] . '-' . $row['shorten'] : $row['appID'];
if ($row['localVersion']==null or ($row['localVersion'] != null and $row['localVersion']<$row['steamVersion'])) {
if ($row['localVersion'] == null or ($row['localVersion'] != null and $row['localVersion']<$row['steamVersion'])) {
if ($updateType==1) {
$this->steamCmdOutdated['sync'][$lookUpAppID]=$row['shorten'];
} else if ($updateType==2) {
@ -201,7 +202,7 @@ class masterServer {
// hlds installations
} else if ($row['steamgame'] == 'Y') {
if ($row['localVersion']==null or ($row['localVersion'] != null and $row['localVersion']<$row['steamVersion'])) {
if ($row['localVersion'] == null or ($row['localVersion'] != null and $row['localVersion']<$row['steamVersion'])) {
if ($updateType==1) {
$this->hldsOutdated['sync'][]=$row['shorten'];
} else if ($updateType==2) {
@ -251,11 +252,11 @@ class masterServer {
global $sql;
if ($this->rootOK!=true) {
if ($this->rootOK != true) {
$this->sshcmd=null;
}
// Update if needed
if ($update===true) {
if ($update === true) {
$steamCmdCount=count($this->steamCmdOutdated['sync'])+count($this->steamCmdOutdated['nosync']);
$hldsCount=count($this->hldsOutdated['sync'])+count($this->hldsOutdated['nosync']);
$steam='steamCmdOutdated';
@ -374,7 +375,7 @@ class masterServer {
$this->sshcmd=$sshcmd;
}
}
#die ($this->sshcmd);
#die ('Command: ' . $this->sshcmd);
return $this->sshcmd;
}
public function setUpdating () {

View File

@ -56,9 +56,9 @@ if ($reseller_id == 0) {
}
$logreseller = 0;
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if (!$ui->w('action',4,'post')) {
} else if (!$ui->w('action', 4, 'post')) {
$pselect=$sql->prepare("SELECT `active`,`ip`,AES_DECRYPT(`port`,:aeskey) AS `dport`,AES_DECRYPT(`user`,:aeskey) AS `duser`,AES_DECRYPT(`pass`,:aeskey) AS `dpass`,`publickey`,`keyname`,`cfgdir`,`normal_3`,`normal_4`,`hlds_3`,`hlds_4`,`hlds_5`,`hlds_6` FROM `eac` WHERE resellerid=:reseller_id LIMIT 1");
$pselect->execute(array(':aeskey'=>$aeskey,':reseller_id'=>$reseller_id));
foreach ($pselect->fetchAll() as $row) {
@ -78,7 +78,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
$eac_cfgdir=$row['cfgdir'];
}
$template_file = "admin_eac.tpl";
} else if ($ui->w('action',4,'post')=="md") {
} else if ($ui->w('action', 4, 'post')=="md") {
$fail = 0;
if (!active_check($ui->post['publickey'])) {
$fail = 1;

View File

@ -59,7 +59,7 @@ if ($reseller_id != 0 and $admin_id != $reseller_id) {
} else {
$lookUpID=$reseller_id;
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get') == 'se') {
if ($ui->smallletters('action',2,'post') == 'md'){

View File

@ -1245,20 +1245,20 @@ if (!function_exists('passwordgenerate')) {
global $ui, $_SESSION;
if ($check==false) {
$token=md5(mt_rand());
if ($ui->id('id',10,'get') and $ui->smallletters('d',10,'get')) $_SESSION[$ui->smallletters('w',10,'get')][$ui->smallletters('d',10,'get')][$ui->id('id',10,'get')]=array('t'=>$token,'d'=>strtotime("+40 minutes"));
else if (!$ui->id('id',10,'get') and $ui->smallletters('d',10,'get')) $_SESSION[$ui->smallletters('w',10,'get')][$ui->smallletters('d',10,'get')]=array('t'=>$token,'d'=>strtotime("+40 minutes"));
else if ($ui->id('id',10,'get') and !$ui->smallletters('d',10,'get')) $_SESSION[$ui->smallletters('w',10,'get')][$ui->id('id',10,'get')]=array('t'=>$token,'d'=>strtotime("+40 minutes"));
if ($ui->id('id', 10, 'get') and $ui->smallletters('d',10,'get')) $_SESSION[$ui->smallletters('w',10,'get')][$ui->smallletters('d',10,'get')][$ui->id('id', 10, 'get')]=array('t'=>$token,'d'=>strtotime("+40 minutes"));
else if (!$ui->id('id', 10, 'get') and $ui->smallletters('d',10,'get')) $_SESSION[$ui->smallletters('w',10,'get')][$ui->smallletters('d',10,'get')]=array('t'=>$token,'d'=>strtotime("+40 minutes"));
else if ($ui->id('id', 10, 'get') and !$ui->smallletters('d',10,'get')) $_SESSION[$ui->smallletters('w',10,'get')][$ui->id('id', 10, 'get')]=array('t'=>$token,'d'=>strtotime("+40 minutes"));
else $_SESSION[$ui->smallletters('w',10,'get')]=array('t'=>$token,'d'=>strtotime("+40 minutes"));
return $token;
} else {
if (isset($_SESSION[$ui->smallletters('w',10,'get')][$ui->smallletters('d',10,'get')][$ui->id('id',10,'get')]['t']) and $_SESSION[$ui->smallletters('w',10,'get')][$ui->smallletters('d',10,'get')][$ui->id('id',10,'get')]['t']==$ui->w('token',32,'post') and $_SESSION[$ui->smallletters('w',10,'get')][$ui->smallletters('d',10,'get')][$ui->id('id',10,'get')]['d']>=strtotime("now")) {
deleteOldToken($ui->smallletters('w',10,'get'), $ui->smallletters('d',10,'get'), $ui->id('id',10,'get'));
if (isset($_SESSION[$ui->smallletters('w',10,'get')][$ui->smallletters('d',10,'get')][$ui->id('id', 10, 'get')]['t']) and $_SESSION[$ui->smallletters('w',10,'get')][$ui->smallletters('d',10,'get')][$ui->id('id', 10, 'get')]['t']==$ui->w('token',32,'post') and $_SESSION[$ui->smallletters('w',10,'get')][$ui->smallletters('d',10,'get')][$ui->id('id', 10, 'get')]['d']>=strtotime("now")) {
deleteOldToken($ui->smallletters('w',10,'get'), $ui->smallletters('d',10,'get'), $ui->id('id', 10, 'get'));
return true;
} else if (isset($_SESSION[$ui->smallletters('w',10,'get')][$ui->smallletters('d',10,'get')]['t']) and $_SESSION[$ui->smallletters('w',10,'get')][$ui->smallletters('d',10,'get')]['t']==$ui->w('token',32,'post') and $_SESSION[$ui->smallletters('w',10,'get')][$ui->smallletters('d',10,'get')]['d']>=strtotime("now")) {
deleteOldToken($ui->smallletters('w',10,'get'), $ui->smallletters('d',10,'get'));
return true;
} else if (isset($_SESSION[$ui->smallletters('w',10,'get')][$ui->id('id',10,'get')]['t']) and $_SESSION[$ui->smallletters('w',10,'get')][$ui->id('id',10,'get')]['t']==$ui->w('token',32,'post') and $_SESSION[$ui->smallletters('w',10,'get')][$ui->id('id',10,'get')]['d']>=strtotime("now")) {
deleteOldToken($ui->smallletters('w',10,'get'),'', $ui->id('id',10,'get'));
} else if (isset($_SESSION[$ui->smallletters('w',10,'get')][$ui->id('id', 10, 'get')]['t']) and $_SESSION[$ui->smallletters('w',10,'get')][$ui->id('id', 10, 'get')]['t']==$ui->w('token',32,'post') and $_SESSION[$ui->smallletters('w',10,'get')][$ui->id('id', 10, 'get')]['d']>=strtotime("now")) {
deleteOldToken($ui->smallletters('w',10,'get'),'', $ui->id('id', 10, 'get'));
return true;
} else if (isset($_SESSION[$ui->smallletters('w',10,'get')]['t']) and $_SESSION[$ui->smallletters('w',10,'get')]['t']==$ui->w('token',32,'post') and $_SESSION[$ui->smallletters('w',10,'get')]['d']>=strtotime("now")) {
deleteOldToken($ui->smallletters('w',10,'get'));

View File

@ -57,7 +57,7 @@ if ($reseller_id != 0 and $admin_id != $reseller_id) {
}
if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lG']) and $licenceDetails['lG']>0 and $licenceDetails['left']>0 and !is_numeric($licenceDetails['left'])) {
$template_file = $gsprache->licence;
} else if ($ui->w('action',4,'post') and !token(true)) {
} else if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get') == 'ad' and (!is_numeric($licenceDetails['lG']) or $licenceDetails['lG']>0) and ($licenceDetails['left']>0 or !is_numeric($licenceDetails['left']))) {
if (!$ui->w('action',3,'post')) {
@ -508,8 +508,8 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lG']) and $licenc
} else {
$template_file = 'admin_404.tpl';
}
} else if ($ui->st('d','get') == 'dl' and $ui->id('id',10,'get')) {
$server_id = $ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'dl' and $ui->id('id', 10, 'get')) {
$server_id = $ui->id('id', 10, 'get');
if (!isset($action)) {
$table = array();
$query = $sql->prepare("SELECT `serverip`,`port`,`serverid` FROM `gsswitch` WHERE `id`=? AND `resellerid`=? LIMIT 1");
@ -625,8 +625,8 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lG']) and $licenc
} else {
$template_file = 'admin_404.tpl';
}
} else if ($ui->st('d','get') == 'md' and $ui->id('id',10,'get')) {
$server_id = $ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'md' and $ui->id('id', 10, 'get')) {
$server_id = $ui->id('id', 10, 'get');
if (!isset($action)) {
$table = array();
$query = $sql->prepare("SELECT *,AES_DECRYPT(`ftppassword`,?) AS `ftp` FROM `gsswitch` WHERE `id`=? AND `resellerid`=? LIMIT 1");
@ -957,8 +957,8 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lG']) and $licenc
} else {
$template_file = 'admin_404.tpl';
}
} else if ($ui->st('d','get') == 'ri' and $ui->id('id',10,'get')) {
$server_id = $ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'ri' and $ui->id('id', 10, 'get')) {
$server_id = $ui->id('id', 10, 'get');
if (!isset($action)) {
$table = array();
$query = $sql->prepare("SELECT `serverip`,`port`,`serverid` FROM `gsswitch` WHERE `id`=? AND `resellerid`=? LIMIT 1");
@ -1048,8 +1048,8 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lG']) and $licenc
} else {
$template_file = 'admin_404.tpl';
}
} else if (in_array($ui->st('d','get'), array('rs','st','du')) and $ui->id('id',10,'get')) {
$id = $ui->id('id',10,'get');
} else if (in_array($ui->st('d','get'), array('rs','st','du')) and $ui->id('id', 10, 'get')) {
$id = $ui->id('id', 10, 'get');
$query = $sql->prepare("SELECT `serverip`,`port`,`rootID` FROM `gsswitch` WHERE `id`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($id,$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {

View File

@ -56,7 +56,7 @@ if ($reseller_id == 0) {
if ($reseller_id != 0 and $admin_id != $reseller_id) {
$reseller_id = $admin_id;
}
if ($ui->w('action',4, 'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d', 'get') == 'ex' and $ui->id('id', 10, 'get')) {

View File

@ -43,9 +43,9 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['jobs'])) {
die('No acces');
}
$sprache = getlanguagefile('api', $user_language, $reseller_id);
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->w('action',4,'post') == 'dl' and !$ui->id('id', 19, 'get')) {
} else if ($ui->w('action', 4, 'post') == 'dl' and !$ui->id('id', 19, 'get')) {
$i = 0;
if ($ui->id('id',30,'post')) {
foreach ($ui->id('id',30,'post') as $id) {
@ -140,7 +140,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
} else {
$api=$gsprache->no;
}
if ($row['status']==null or $row['status']==4) {
if ($row['status'] == null or $row['status']==4) {
$imgName='16_ok';
$imgAlt='Running';
} else if ($row['status']==1) {

View File

@ -54,7 +54,7 @@ if ($reseller_id==0) {
$logsubuser=(isset($_SESSION['oldid'])) ? $_SESSION['oldid'] : 0;
$logreseller = 0;
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get')=="se" and $pa['lendserverSettings']) {
if ($ui->active('active','post')) {

View File

@ -57,12 +57,12 @@ if ($reseller_id==0) {
if ($reseller_id != 0 and $admin_id != $reseller_id) {
$reseller_id=$admin_id;
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get') == 'ad') {
if ($ui->smallletters('action',2,'post') == 'ad'){
include(EASYWIDIR . '/stuff/ssh_exec.php');
$serverid=$ui->id('id',10,'get');
$serverid=$ui->id('id', 10, 'get');
$rootServer=new masterServer($serverid,$aeskey);
if($ui->id('id',19,'post')) {
$template_file = '';

View File

@ -61,9 +61,9 @@ if ($reseller_id==0) {
if ($reseller_id != 0 and $admin_id != $reseller_id) {
$reseller_id=$admin_id;
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get') == 'ms' and !$ui->id('id',10,'get') and $pa['mysql_settings']) {
} else if ($ui->st('d','get') == 'ms' and !$ui->id('id', 10, 'get') and $pa['mysql_settings']) {
$o=$ui->st('o','get');
if ($ui->st('o','get') == 'ap') {
$orderby='`ip` ASC';
@ -121,9 +121,9 @@ if ($ui->w('action',4,'post') and !token(true)) {
}
$pages=implode(', ',$pages);
$template_file = "admin_mysql_server_list.tpl";
} else if ($ui->st('d','get') == 'ds' and $ui->id('id',10,'get') and $pa['mysql_settings']) {
} else if ($ui->st('d','get') == 'ds' and $ui->id('id', 10, 'get') and $pa['mysql_settings']) {
if ($ui->st('action','post') == 'dl') {
$id=$ui->id('id',10,'get');
$id=$ui->id('id', 10, 'get');
$pselect=$sql->prepare("SELECT `ip` FROM `mysql_external_servers` WHERE `id`=? AND `resellerid`=? LIMIT 1");
$pselect->execute(array($id,$reseller_id));
foreach ($pselect->fetchall(PDO::FETCH_ASSOC) as $row) {
@ -137,7 +137,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
$loguseraction="%del% MYSQL Server $ip";
$insertlog->execute();
} else {
$id=$ui->id('id',10,'get');
$id=$ui->id('id', 10, 'get');
$pselect=$sql->prepare("SELECT `ip`,`interface` FROM `mysql_external_servers` WHERE `id`=? AND `resellerid`=? LIMIT 1");
$pselect->execute(array($id,$reseller_id));
foreach ($pselect->fetchall(PDO::FETCH_ASSOC) as $row) {
@ -146,9 +146,9 @@ if ($ui->w('action',4,'post') and !token(true)) {
}
$template_file = "admin_mysql_server_dl.tpl";
}
} else if ($ui->st('d','get') == 'ms' and $ui->id('id',10,'get') and $pa['mysql_settings']) {
} else if ($ui->st('d','get') == 'ms' and $ui->id('id', 10, 'get') and $pa['mysql_settings']) {
if (!$ui->st('action','post')) {
$id=$ui->id('id',10,'get');
$id=$ui->id('id', 10, 'get');
$pselect=$sql->prepare("SELECT `active`,`ip`,`port`,`user`,AES_DECRYPT(`password`,?) AS `decryptedpassword`,`max_databases`,`interface`,`max_queries_per_hour`,`max_updates_per_hour`,`max_connections_per_hour`,`max_userconnections_per_hour` FROM `mysql_external_servers` WHERE `id`=? AND `resellerid`=? LIMIT 1");
$pselect->execute(array($aeskey,$id,$reseller_id));
foreach ($pselect->fetchall(PDO::FETCH_ASSOC) as $row) {
@ -174,7 +174,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
if (count($errors)>0) {
$template_file = 'Error(s): '.implode(', '.$errors);
} else {
$id=$ui->id('id',10,'get');
$id=$ui->id('id', 10, 'get');
$active=$ui->active('active','post');
$ip=$ui->ip('ip','post');
$port=$ui->port('port','post');
@ -205,7 +205,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
if (count($errors)>0) {
$template_file = 'Error(s): '.implode(', '.$errors);
} else {
$id=$ui->id('id',10,'get');
$id=$ui->id('id', 10, 'get');
$active=$ui->active('active','post');
$ip=$ui->ip('ip','post');
$port=$ui->port('port','post');
@ -313,9 +313,9 @@ if ($ui->w('action',4,'post') and !token(true)) {
} else {
$template_file = 'userpanel_404.tpl';
}
} else if ($ui->st('d','get') == 'md' and $ui->id('id',10,'get') and $pa['mysql']) {
} else if ($ui->st('d','get') == 'md' and $ui->id('id', 10, 'get') and $pa['mysql']) {
if (!$ui->st('action','post')) {
$id=$ui->id('id',10,'get');
$id=$ui->id('id', 10, 'get');
$query = $sql->prepare("SELECT e.*,AES_DECRYPT(e.`password`,?) AS `decryptedpassword`,s.`ip`,u.`cname` FROM `mysql_external_dbs` e LEFT JOIN `mysql_external_servers` s ON e.`sid`=s.`id` LEFT JOIN `userdata` u ON e.`uid`=u.`id` WHERE e.`id`=? AND e.`resellerid`=? LIMIT 1");
$query->execute(array($aeskey,$id,$reseller_id));
foreach ($query->fetchall(PDO::FETCH_ASSOC) as $row) {
@ -353,7 +353,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
if (count($errors)>0) {
$template_file = "Error: ".implode('<br>',$errors);
} else {
$id=$ui->id('id',10,'get');
$id=$ui->id('id', 10, 'get');
$active=$ui->active('active','post');
$password=$ui->password('password',40,'post');
$ips=$ui->ips('ips','post');
@ -401,9 +401,9 @@ if ($ui->w('action',4,'post') and !token(true)) {
} else {
$template_file = 'admin_404.tpl';
}
} else if ($ui->st('d','get') == 'dd' and $ui->id('id',10,'get') and $pa['mysql']) {
} else if ($ui->st('d','get') == 'dd' and $ui->id('id', 10, 'get') and $pa['mysql']) {
if (!$ui->st('action','post')) {
$id=$ui->id('id',10,'get');
$id=$ui->id('id', 10, 'get');
$query = $sql->prepare("SELECT e.`dbname`,s.`ip`,u.`cname` FROM `mysql_external_dbs` e LEFT JOIN `mysql_external_servers` s ON e.`sid`=s.`id` LEFT JOIN `userdata` u ON e.`uid`=u.`id` WHERE e.`id`=? AND e.`resellerid`=? LIMIT 1");
$query->execute(array($id,$reseller_id));
foreach ($query->fetchall(PDO::FETCH_ASSOC) as $row) {
@ -413,7 +413,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
}
$template_file = (isset($cname)) ? 'admin_mysql_db_dl.tpl' : 'userpanel_404.tpl';
} else if ($ui->st('action','post') == 'dl') {
$id=$ui->id('id',10,'get');
$id=$ui->id('id', 10, 'get');
$query = $sql->prepare("SELECT e.`sid`,e.`uid`,e.`dbname`,s.`ip`,AES_DECRYPT(s.`password`,?) AS `decryptedpassword2`,s.`port`,s.`user`,u.`cname` FROM `mysql_external_dbs` e LEFT JOIN `mysql_external_servers` s ON e.`sid`=s.`id` LEFT JOIN `userdata` u ON e.`uid`=u.`id` WHERE e.`id`=? AND e.`resellerid`=? LIMIT 1");
$query->execute(array($aeskey,$id,$reseller_id));
foreach ($query->fetchall(PDO::FETCH_ASSOC) as $row) {

View File

@ -48,7 +48,7 @@ $logreseller = 0;
$logsubuser = 0;
$logsubuser = 0;
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if($ui->st('d','get') == 'md' and $ui->id('id',19,'get') and $ui->smallletters('action',2,'post') == 'md'){
$id=$ui->id('id',19,'get');

View File

@ -46,8 +46,8 @@ if (isset($page_name) and isid($page_name,10)) {
$downloadID=(int)$page_name;
} else if (isset($page_count) and isid($page_count,10)) {
$downloadID=(int)$page_count;
} else if ($ui->id('id',10,'get')) {
$downloadID=$ui->id('id',10,'get');
} else if ($ui->id('id', 10, 'get')) {
$downloadID=$ui->id('id', 10, 'get');
}
if (!isset($user_language) or $user_language == '') $user_language=(isset($page_detect_language)) ? $page_detect_language : $rSA['language'];
if ((isset($page_name) and $page_name == 'get') or $ui->smallletters('action',3,'get') == 'get') $startDownload = true;

View File

@ -48,10 +48,10 @@ $logusertype = 'admin';
$logreseller = 0;
$logsubuser = 0;
$logsubuser = 0;
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->id('id',10,'get') or $ui->st('d','get') == 'ad') {
$id=$ui->id('id',10,'get');
} else if ($ui->id('id', 10, 'get') or $ui->st('d','get') == 'ad') {
$id=$ui->id('id', 10, 'get');
$template_file = 'uadmin_404.tpl';
$foundLanguages = array();
$query = $sql->prepare("SELECT `lang`,`text` FROM `translations` WHERE `type`='pd' AND `transID`=? AND `lang`=? AND `resellerID`=? LIMIT 1");
@ -59,14 +59,14 @@ if ($ui->w('action',4,'post') and !token(true)) {
if (small_letters_check($row,2)) {
$description = '';
unset($lang);
if($ui->id('id',10,'get')) {
if($ui->id('id', 10, 'get')) {
$query->execute(array($id, $row,$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row2) {
$lang=$row2['lang'];
$description=$row2['text'];
}
}
if ((!$ui->id('id',10,'get') and $row==$rSA['language']) or isset($lang)) {
if ((!$ui->id('id', 10, 'get') and $row==$rSA['language']) or isset($lang)) {
$style = '';
$displayNone = '';
$checkbox='<input type="checkbox" name="language[]" value="'.$row.'" onclick="textdrop('."'".$row."'".');" checked /> ';
@ -80,7 +80,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
}
if (!$ui->st('action','post') and $ui->st('d','get') == 'ad') {
$template_file = 'admin_page_downloads_add.tpl';
} else if (!$ui->st('action','post') and $ui->id('id',10,'get') and ($ui->st('d','get') == 'md' or $ui->st('d','get') == 'dl')) {
} else if (!$ui->st('action','post') and $ui->id('id', 10, 'get') and ($ui->st('d','get') == 'md' or $ui->st('d','get') == 'dl')) {
$query = $sql->prepare("SELECT * FROM `page_downloads` WHERE `fileID`=? AND `resellerID`=? LIMIT 1");
$query->execute(array($id,$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
@ -93,8 +93,8 @@ if ($ui->w('action',4,'post') and !token(true)) {
$date=$row['date'];
$template_file = ($ui->st('d','get') == 'md') ? 'admin_page_downloads_mod.tpl' : 'admin_page_downloads_del.tpl';
}
} else if ($ui->st('action','post') == 'ad' or ($ui->st('action','post') == 'md' and $ui->id('id',10,'get'))) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('action','post') == 'ad' or ($ui->st('action','post') == 'md' and $ui->id('id', 10, 'get'))) {
$id=$ui->id('id', 10, 'get');
if ($ui->st('action','post') == 'ad') {
$query = $sql->prepare("SELECT 1 FROM `page_downloads` WHERE `fileName`=? LIMIT 1");
$query->execute(array($ui->names('fileName',255,'post')));
@ -107,7 +107,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
$template_file = $spracheResponse->table_add;
$id=$sql->lastInsertId();
}
} else if ($ui->st('action','post') == 'md' and $ui->id('id',10,'get')) {
} else if ($ui->st('action','post') == 'md' and $ui->id('id', 10, 'get')) {
$query = $sql->prepare("UPDATE `page_downloads` SET `show`=?,`description`=?,`fileName`=? WHERE `fileID`=? AND `resellerID`=? LIMIT 1");
$query->execute(array($ui->w('show',1,'post'),$ui->names('description',255,'post'),$ui->names('fileName',255,'post'),$id,$reseller_id));
if ($query->rowCount()>0) $changed = true;
@ -170,7 +170,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
} else {
$template_file = $spracheResponse->error_table;
}
} else if ($ui->st('action','post') == 'dl' and $ui->id('id',10,'get')) {
} else if ($ui->st('action','post') == 'dl' and $ui->id('id', 10, 'get')) {
$query = $sql->prepare("DELETE FROM `page_downloads` WHERE `fileID`=? AND `resellerID`=? LIMIT 1");
$query->execute(array($id,$reseller_id));
$template_file = ($query->rowCount()>0) ? $spracheResponse->table_del : 'admin_404.tpl';

View File

@ -46,7 +46,7 @@ $logusertype = 'admin';
$logreseller = 0;
$logsubuser = 0;
$logsubuser = 0;
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get')=="ad") {
if (!$ui->smallletters('action',2,'post')) {
@ -81,7 +81,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
$query = $sql->prepare("SELECT `cname`,`name`,`vname` FROM `userdata` WHERE `id`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($admin_id,$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$author=(($row['name'] == '' or $row['name']==null) and ($row['vname'] == '' or $row['vname']==null)) ? $row['cname'] : $row['vname'] . ' ' . $row['name'];
$author=(($row['name'] == '' or $row['name'] == null) and ($row['vname'] == '' or $row['vname'] == null)) ? $row['cname'] : $row['vname'] . ' ' . $row['name'];
}
$query = $sql->prepare("INSERT INTO `page_pages` (`released`,`subpage`,`authorid`,`authorname`,`date`,`type`,`comments`,`resellerid`) VALUES (?,?,?,?,NOW(),'news',?,?)");
$query->execute(array($ui->id('released','1','post'),$ui->id('subpage',19,'post'),$admin_id,$author,$ui->active('comments','post'),$reseller_id));
@ -153,13 +153,13 @@ if ($ui->w('action',4,'post') and !token(true)) {
$p_languages[]=$row2['language'];
}
$page_title=$row['title'];
if (($row['title']==null or $row['title'] == '') and isset($p_languages)) {
if (($row['title'] == null or $row['title'] == '') and isset($p_languages)) {
$query3 = $sql->prepare("SELECT `title` FROM `page_pages_text` WHERE `pageid`=? AND `language`=? AND `resellerid`=? ORDER BY `language` LIMIT 1");
$query3->execute(array($row['id'],$p_languages[0],$reseller_id));
foreach ($query3->fetchAll(PDO::FETCH_ASSOC) as $row3) {
$page_title=$row3['title'];
}
} else if ($row['title']==null or $row['title'] == '') {
} else if ($row['title'] == null or $row['title'] == '') {
$page_title = '';
$p_languages = array();
}
@ -226,7 +226,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
foreach ($query4->fetchAll(PDO::FETCH_ASSOC) as $row4) {
if ($row4['id'] != $id) {
$page_title=$row4['title'];
if ($row4['title']==null or $row4['title'] == '') {
if ($row4['title'] == null or $row4['title'] == '') {
$query5 = $sql->prepare("SELECT `title` FROM `page_pages_text` WHERE `pageid`=? AND `resellerid`=? ORDER BY `language` LIMIT 1");
$query5->execute(array($row4['id'],$reseller_id));
foreach ($query5->fetchAll(PDO::FETCH_ASSOC) as $row5) {
@ -437,7 +437,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
$author=$row['authorname'];
$query2->execute(array($row['authorid'],$reseller_id));
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) {
if (($row2['name'] == '' or $row2['name']==null) and ($row2['vname'] == '' or $row2['vname']==null)) {
if (($row2['name'] == '' or $row2['name'] == null) and ($row2['vname'] == '' or $row2['vname'] == null)) {
$author=$row2['cname'];
} else {
$author=$row2['vname'] . ' ' . $row2['name'];
@ -449,12 +449,12 @@ if ($ui->w('action',4,'post') and !token(true)) {
$p_languages[]=$row3['language'];
}
$page_title=$row['title'];
if (($row['title']==null or $row['title'] == '') and isset($p_languages[0])) {
if (($row['title'] == null or $row['title'] == '') and isset($p_languages[0])) {
$query4->execute(array($row['id'],$p_languages[0],$reseller_id));
foreach ($query4->fetchAll(PDO::FETCH_ASSOC) as $row4) {
$page_title=$row4['title'];
}
} else if ($row['title']==null or $row['title'] == '') {
} else if ($row['title'] == null or $row['title'] == '') {
$page_title = '';
$p_languages = array();
}

View File

@ -46,7 +46,7 @@ $logusertype = 'admin';
$logreseller = 0;
$logsubuser = 0;
$logsubuser = 0;
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get')=="ad") {
if (!$ui->smallletters('action',2,'post')) {
@ -56,7 +56,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
$subpage = array();
foreach ($query->fetchall(PDO::FETCH_ASSOC) as $row) {
$page_title=$row['title'];
if ($row['title']==null or $row['title'] == '') {
if ($row['title'] == null or $row['title'] == '') {
$query2 = $sql->prepare("SELECT `title` FROM `page_pages_text` WHERE `pageid`=? AND `resellerid`=? ORDER BY `language` LIMIT 1");
$query2->execute(array($row['id'],$reseller_id));
foreach ($query2->fetchall(PDO::FETCH_ASSOC) as $row2) {
@ -88,7 +88,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
$query = $sql->prepare("SELECT `cname`,`name`,`vname` FROM `userdata` WHERE `id`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($admin_id,$reseller_id));
foreach ($query->fetchall(PDO::FETCH_ASSOC) as $row) {
if (($row['name'] == '' or $row['name']==null) and ($row['vname'] == '' or $row['vname']==null)) {
if (($row['name'] == '' or $row['name'] == null) and ($row['vname'] == '' or $row['vname'] == null)) {
$author=$row['cname'];
} else {
$author=$row['vname'] . ' ' . $row['name'];
@ -231,7 +231,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
foreach ($query->fetchall(PDO::FETCH_ASSOC) as $row) {
if ($row['id'] != $id) {
$page_title=$row['title'];
if ($row['title']==null or $row['title'] == '') {
if ($row['title'] == null or $row['title'] == '') {
$query2->execute(array($row['id'],$reseller_id));
foreach ($query2->fetchall(PDO::FETCH_ASSOC) as $row2) {
$page_title=$row2['title'];
@ -415,7 +415,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
$query2 = $sql->prepare("SELECT `cname`,`name`,`vname` FROM `userdata` WHERE `id`=? AND `resellerid`=? LIMIT 1");
$query2->execute(array($row['authorid'],$reseller_id));
foreach ($query2->fetchall(PDO::FETCH_ASSOC) as $row2) {
if (($row2['name'] == '' or $row2['name']==null) and ($row2['vname'] == '' or $row2['vname']==null)) {
if (($row2['name'] == '' or $row2['name'] == null) and ($row2['vname'] == '' or $row2['vname'] == null)) {
$author=$row2['cname'];
} else {
$author=$row2['vname'] . ' ' . $row2['name'];
@ -428,13 +428,13 @@ if ($ui->w('action',4,'post') and !token(true)) {
$p_languages[]=$row3['language'];
}
$page_title=$row['title'];
if (($row['title']==null or $row['title'] == '') and isset($p_languages[0])) {
if (($row['title'] == null or $row['title'] == '') and isset($p_languages[0])) {
$query4 = $sql->prepare("SELECT `title` FROM `page_pages_text` WHERE `pageid`=? AND `language`=? AND `resellerid`=? ORDER BY `language` LIMIT 1");
$query4->execute(array($row['id'],$p_languages[0],$reseller_id));
foreach ($query4->fetchall(PDO::FETCH_ASSOC) as $row4) {
$page_title=$row4['title'];
}
} else if ($row['title']==null or $row['title'] == '') {
} else if ($row['title'] == null or $row['title'] == '') {
$page_title = '';
$p_languages = array();
}

View File

@ -46,7 +46,7 @@ $logusertype = 'admin';
$logreseller = 0;
$logsubuser = 0;
$logsubuser = 0;
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->smallletters('action',2,'post') == 'md' and $ui->id('maxnews',19,'post')) {
if ($ui->smallletters('defaultpage','255','post')) {
@ -177,7 +177,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
$query->execute(array($user_language,$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$page_title=$row['title'];
if ($row['title']==null or $row['title'] == '') {
if ($row['title'] == null or $row['title'] == '') {
$query2->execute(array($row['id'],$reseller_id));
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) $page_title=$row2['title'];
}

View File

@ -59,7 +59,7 @@ if ($reseller_id != 0 and $admin_id != $reseller_id) {
$reseller_id=$admin_id;
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('action','post') == 'md') {
$fail = 0;

View File

@ -46,10 +46,10 @@ $logusertype = 'admin';
$logreseller = 0;
$logsubuser = 0;
$sprache = getlanguagefile('columns',$user_language,$reseller_id);
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if(in_array($ui->st('d','get'), array('ad','md'))) {
$id=$ui->id('id',10,'get');
$id=$ui->id('id', 10, 'get');
if (in_array($ui->st('action','post'), array('ad','md'))) {
$error = array();
if (!$ui->active('active','post')) {
@ -76,7 +76,7 @@ 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));
$id=$sql->lastInsertId();
$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->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}";
@ -122,7 +122,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
}
}
$template_file = 'admin_settings_columns_add.tpl';
} 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("SELECT * FROM `custom_columns_settings` WHERE `customID`=? LIMIT 1");
$query->execute(array($id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
@ -154,8 +154,8 @@ if ($ui->w('action',4,'post') and !token(true)) {
}
$template_file = (isset($active)) ? 'admin_settings_columns_md.tpl' : 'admin_404.tpl';
}
} else if ($ui->id('id',10,'get') and $ui->st('d','get') == 'dl') {
$id=$ui->id('id',10,'get');
} else if ($ui->id('id', 10, 'get') and $ui->st('d','get') == 'dl') {
$id=$ui->id('id', 10, 'get');
$query = $sql->prepare("SELECT `name` FROM `custom_columns_settings` WHERE `customID`=? LIMIT 1");
$query->execute(array($id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {

View File

@ -58,7 +58,7 @@ if ($reseller_id==0) {
if ($reseller_id != 0 and $admin_id != $reseller_id) {
$reseller_id=$admin_id;
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('action','post') == 'md') {
$changeCount = 0;

View File

@ -35,65 +35,94 @@
* Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
* Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
*/
function GTASAMP ($ip,$port) {
function serverQuery ($ip, $port, $type) {
$socket = @fsockopen('udp://' . $ip, (int) $port, $errnum, $errstr, 5);
if ($errnum == 111) {
return $errstr;
} else if ($socket==false) {
usleep(250000);
$socket = @fsockopen('udp://' . $ip, (int) $port, $errnum, $errstr, 5);
}
if($socket === false) {
return $errstr;
} else {
$ex = explode('.', $ip);
$packet = 'SAMP' . chr($ex[0]) . chr($ex[1]) . chr($ex[2]) . chr($ex[3]) . chr($port & 0xFF) . chr($port >> 8 & 0xFF) . 'i';
if (@fwrite($socket, $packet)) {
@fread($socket, 11);
$return = array('password'=>ord(fread($socket,1)), 'players'=>ord(fread($socket,2)), 'slots'=>ord(fread($socket,2)), 'hostname'=>htmlentities(fread($socket,ord(fread($socket,4)))), 'mode'=>htmlentities(fread($socket,ord(fread($socket,4)))), 'map'=>htmlentities(fread($socket,ord(fread($socket,4)))));
} else {
$return = 'Error: can not write to the socket';
}
}
if (is_resource($socket)) {
fclose($socket);
}
return $return;
}
function MineCraft ($ip,$port) {
$socket=@fsockopen($ip,(int)$port,$errnum,$errstr,5);
if ($errnum==111) {
return $errstr;
} else if ($socket==false) {
usleep(250000);
$socket=@fsockopen($ip,(int)$port,$errnum,$errstr,5);
}
if($socket === false) {
return $errstr;
} else {
$string="\xFE";
$length=strlen($string);
if (@fwrite($socket,$string,$length)) {
$mc_reply=@fread($socket,4096);
$mc_reply=substr($mc_reply,3);
$mc_reply=iconv('UTF-16BE', 'UTF-8',$mc_reply);
if($mc_reply[1] === "\xA7" and $mc_reply[2] === "\x31") {
print "New\r\n";
$exploded=explode("\x00",$mc_reply);
$return=array('hostname'=>$exploded[3], 'players'=>intval($exploded[4]), 'slots'=>intval($exploded[5]));
if ($type == 'gtasamp') {
$ex = explode('.', $ip);
$packet = 'SAMP' . chr($ex[0]) . chr($ex[1]) . chr($ex[2]) . chr($ex[3]) . chr($port & 0xFF) . chr($port >> 8 & 0xFF) . 'i';
if (@fwrite($socket, $packet)) {
@fread($socket, 11);
return array('password'=>ord(fread($socket,1)), 'players'=>ord(fread($socket,2)), 'slots'=>ord(fread($socket,2)), 'hostname'=>htmlentities(fread($socket,ord(fread($socket,4)))), 'mode'=>htmlentities(fread($socket,ord(fread($socket,4)))), 'map'=>htmlentities(fread($socket,ord(fread($socket,4)))));
} else {
$exploded=explode("\xA7",$mc_reply);
$hostname=substr($exploded[0],0,-1);
print "Oldname: $hostname\r\n";
$return=array('hostname'=>$hostname, 'players'=>(int)$exploded[1], 'slots'=>(int)$exploded[2]);
return 'Error: can not write to the socket';
}
if (!isset($exploded[1]) and !isset($exploded[2])) {
$return='Error: Can not retrieve data from MC Server';
} else if ($type == 'minecraft') {
$string="\xFE";
$length=strlen($string);
if (@fwrite($socket, $string, $length)) {
$reply = @fread($socket, 4096);
if (is_resource($socket)) {
fclose($socket);
}
$reply = substr($reply,3);
$reply = iconv('UTF-16BE', 'UTF-8', $reply);
if ($reply[1] === "\xA7" and $reply[2] === "\x31") {
$exploded = explode("\x00", $reply);
if (!isset($exploded[3]) and !isset($exploded[4])) {
return 'Error: Can not retrieve data from MC Server';
}
return array('hostname' => $exploded[3], 'players' => intval($exploded[4]), 'slots' => intval($exploded[5]));
} else {
$exploded = explode("\xA7", $reply);
if (!isset($exploded[1]) and !isset($exploded[2])) {
return 'Error: Can not retrieve data from MC Server';
}
return array('hostname' => substr($exploded[0], 0, -1), 'players' => (int) $exploded[1], 'slots' => (int) $exploded[2], 'password' => 1, 'map' => '');
}
} else {
return 'Error: can not write to the socket';
}
} else if ($type == 'teeworlds') {
if (@fwrite($socket, "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x67\x69\x65\x33\x05")) {
$reply = @fread($socket, 2048);
if (is_resource($socket)) {
fclose($socket);
}
$exploded = explode("\x00", $reply);
if (!isset($exploded[2]) and !isset($exploded[3])) {
return 'Error: Can not retrieve data from Teeworlds Server';
}
return array('hostname' => $exploded[2], 'players' => (int) $exploded[8], 'slots' => (int) $exploded[9], 'password' => 1, 'map' => $exploded[3]);
} else {
return 'Error: can not write to the socket';
}
} else {
$return='Error: can not write to the socket';
}
}
if (is_resource($socket)) fclose($socket);
return $return;
return '';
}

View File

@ -57,7 +57,7 @@ if ($reseller_id==0) {
}
if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lDs']) and $licenceDetails['lDs']>0 and $licenceDetails['left']>0 and !is_numeric($licenceDetails['left'])) {
$template_file = $gsprache->licence;
} else if ($ui->w('action',4,'post') and !token(true)) {
} else if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if (in_array($ui->st('d','get'), array('md','ad'))){
$query = $sql->prepare("SELECT COUNT(`id`) AS `a` FROM `rootsDHCP` WHERE `active`='Y' LIMIT 1");
@ -74,7 +74,7 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lDs']) and $licen
$type=($row['accounttype'] == 'u') ? $gsprache->user : $gsprache->reseller;
$table[$row['id']]=$type . ' ' . trim($row['cname'] . ' ' . $row['vname'] . ' ' . $row['name']);
}
$id=$ui->id('id',10,'get');
$id=$ui->id('id', 10, 'get');
$query = $sql->prepare("SELECT * FROM `rootsDedicated` WHERE `dedicatedID`=? AND `resellerID`=? LIMIT 1");
$query->execute(array($id,$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
@ -126,7 +126,7 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lDs']) and $licen
if (count($error)>0) {
$template_file = 'Error: '.implode('<br />',$error);
} else {
$id=$ui->id('id',10,'get');
$id=$ui->id('id', 10, 'get');
$active=yesNo('active');
$https=yesNo('https');
$useDHCP=yesNo('useDHCP');
@ -144,7 +144,7 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lDs']) and $licen
$userID=$ui->id('userID',19,'post');
$query = $sql->prepare("UPDATE `jobs` SET `status`='2' WHERE `type`='de' AND (`status` IS NULL OR `status`='1') AND `affectedID`=? and `resellerID`=?");
$query->execute(array($id,$reseller_id));
if ($ui->st('d','get') == 'md' and $ui->id('id',10,'get')) {
if ($ui->st('d','get') == 'md' and $ui->id('id', 10, 'get')) {
$query = $sql->prepare("SELECT `active`,`ip`,`mac`,`useDHCP`,`usePXE` FROM `rootsDedicated` WHERE `dedicatedID`=? AND `resellerID`=? LIMIT 1");
$query->execute(array($id,$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
@ -172,8 +172,8 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lDs']) and $licen
}
}
}
} else if ($ui->st('d','get') == 'dl' and $ui->id('id',10,'get') and $reseller_id==0) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'dl' and $ui->id('id', 10, 'get') and $reseller_id==0) {
$id=$ui->id('id', 10, 'get');
$query = $sql->prepare("SELECT `ip`,`description`,`restart`,`useDHCP`,`usePXE` FROM `rootsDedicated` WHERE `dedicatedID`=? AND `resellerID`=? LIMIT 1");
$query->execute(array($id,$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
@ -221,8 +221,8 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lDs']) and $licen
} else {
$template_file = 'admin_404.tpl';
}
} else if ($ui->st('d','get') == 'ri' and $ui->id('id',10,'get')) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'ri' and $ui->id('id', 10, 'get')) {
$id=$ui->id('id', 10, 'get');
if (!$ui->st('action','post')) {
$option = array();
$query = $sql->prepare("SELECT COUNT(`id`) AS `a` FROM `rootsDHCP` WHERE `active`='Y' LIMIT 1");
@ -236,14 +236,14 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lDs']) and $licen
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$ip=$row['ip'];
$showImages = false;
if ($row['userID']==null) {
if ($row['userID'] == null) {
$error=$sprache->userAdd;
} else if ($dhcp == 'N' or $pxe == 'N') {
$option[] = '<option value="rs">'.$sprache->restart.'</option>';
$option[] = '<option value="st">'.$sprache->stop.'</option>';
} else {
$showImages = true;
if ($row['status']==null or $row['status']==2) {
if ($row['status'] == null or $row['status']==2) {
$option[] = '<option value="rc">'.$sprache->rescue_start.'</option>';
$option[] = '<option value="ri">'.$sprache->reinstall.'</option>';
} else if ($row['status']==0) {

View File

@ -55,7 +55,7 @@ if ($reseller_id==0) {
$logsubuser=(isset($_SESSION['oldid'])) ? $_SESSION['oldid'] : 0;
$logreseller = 0;
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if (in_array($ui->st('d','get'), array('md','ad'))){
if (!in_array($ui->smallletters('action',2,'post'), array('md','ad')) and $ui->st('d','get') == 'md') {

View File

@ -59,7 +59,7 @@ if ($reseller_id==0) {
}
$logreseller = 0;
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get') == 'ad') {
if (!$ui->smallletters('action',2,'post')) {
@ -158,8 +158,8 @@ if ($ui->w('action',4,'post') and !token(true)) {
} else {
$template_file = 'admin_404.tpl';
}
} else if ($ui->st('d','get') == 'dl' and $ui->id('id',10,'get')) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'dl' and $ui->id('id', 10, 'get')) {
$id=$ui->id('id', 10, 'get');
if (!$ui->smallletters('action',2,'post')) {
$query = $sql->prepare("SELECT `ip`,`description` FROM `virtualhosts` WHERE `id`=? LIMIT 1");
$query->execute(array($id));
@ -193,8 +193,8 @@ if ($ui->w('action',4,'post') and !token(true)) {
} else {
$template_file = 'admin_404.tpl';
}
} else if ($ui->st('d','get') == 'md' and $ui->id('id',10,'get')) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'md' and $ui->id('id', 10, 'get')) {
$id=$ui->id('id', 10, 'get');
if (!$ui->smallletters('action',2,'post')) {
$query = $sql->prepare("SELECT `active`,`esxi`,`ip`,AES_DECRYPT(`port`,:aeskey) AS `decryptedport`,AES_DECRYPT(`user`,:aeskey) AS `decrypteduser`,AES_DECRYPT(`pass`,:aeskey) AS `decryptedpass`,`os`,`description`,`publickey`,`keyname`,`cpu`,`cores`,`mhz`,`hdd`,`ram`,`maxserver`,`thin`,`thinquota`,`resellerid` FROM `virtualhosts` WHERE `id`=:id LIMIT 1");
$query->execute(array(':id'=>$id,':aeskey'=>$aeskey));

View File

@ -55,7 +55,7 @@ if ($reseller_id != 0) {
}
if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lVs']) and $licenceDetails['lVs']>0 and $licenceDetails['left']>0 and !is_numeric($licenceDetails['left'])) {
$template_file = $gsprache->licence;
} else if ($ui->w('action',4,'post') and !token(true)) {
} else if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get') == 'ad' and ($reseller_id==0 or $admin_id==$reseller_id) and $pa['addvserver'] and (!is_numeric($licenceDetails['lVs']) or $licenceDetails['lVs']>0) and ($licenceDetails['left']>0 or !is_numeric($licenceDetails['left']))) {
if (!$ui->smallletters('action',2,'post')) {
@ -539,8 +539,8 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lVs']) and $licen
} else {
$template_file = 'admin_404.tpl';
}
} else if ($ui->st('d','get') == 'dl' and $ui->id('id',10,'get') and $pa['delvserver']) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'dl' and $ui->id('id', 10, 'get') and $pa['delvserver']) {
$id=$ui->id('id', 10, 'get');
if ($reseller_id==0) {
$query = $sql->prepare("SELECT c.`ip`,c.`hostid`,c.`userid`,r.`description`,r.`bitversion` FROM `virtualcontainer` c LEFT JOIN `resellerimages` r ON c.`imageid`=r.`id` WHERE c.`id`=? LIMIT 1");
$query->execute(array($id));
@ -576,8 +576,8 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lVs']) and $licen
} else {
$template_file = 'admin_404.tpl';
}
} else if ($ui->st('d','get') == 'md' and $ui->id('id',10,'get') and $pa['modvserver']) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'md' and $ui->id('id', 10, 'get') and $pa['modvserver']) {
$id=$ui->id('id', 10, 'get');
if (!$ui->smallletters('action',2,'post')) {
if ($reseller_id==0) {
$query = $sql->prepare("SELECT c.`active`,c.`ip`,c.`ips`,c.`mac`,c.`cores`,c.`minmhz`,c.`maxmhz`,c.`hddsize`,c.`mountpoint`,c.`ram`,c.`minram`,c.`maxram`,AES_DECRYPT(c.`pass`, :aeskey) AS `decryptedpass`,r.`description`,r.`bitversion`,u.`cname`,h.`cores` AS `hcore`,h.`esxi`,u.`id` AS `userid` FROM `virtualcontainer` c LEFT JOIN `resellerimages` r ON c.`imageid`=r.`id` LEFT JOIN `userdata` u ON c.`userid`=u.`id` LEFT JOIN `virtualhosts` h ON c.`hostid`=h.`id` WHERE c.`id`=:id LIMIT 1");
@ -783,8 +783,8 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lVs']) and $licen
} else {
$template_file = 'admin_404.tpl';
}
} else if ($ui->st('d','get') == 'va' and $ui->id('id',10,'get') and $pa['usevserver']) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'va' and $ui->id('id', 10, 'get') and $pa['usevserver']) {
$id=$ui->id('id', 10, 'get');
if (!$ui->smallletters('action',2,'post')) {
$option = array();
if ($reseller_id==0) {
@ -799,7 +799,7 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lVs']) and $licen
}
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$ip=$row['ip'];
if ($row['status']==null or $row['status']==2) {
if ($row['status'] == null or $row['status']==2) {
$option[] = '<option value="rc">'.$sprache->rescue_start.'</option>';
$option[] = '<option value="ri">'.$sprache->reinstall.'</option>';
} else if ($row['status']==0) {

View File

@ -58,7 +58,7 @@ if ($reseller_id == 0) {
if ($reseller_id != 0 and $admin_id != $reseller_id) {
$reseller_id = $admin_id;
}
if ($ui->w('action',4, 'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d', 'get') == 'ad' or $ui->st('d', 'get') == 'md') {

View File

@ -59,11 +59,11 @@ if ($reseller_id==0) {
}
$logreseller = 0;
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if (in_array($ui->st('d','get'), array('md','ad'))){
if (!in_array($ui->smallletters('action',2,'post'), array('md','ad')) and $ui->st('d','get') == 'md') {
$id=$ui->id('id',10,'get');
$id=$ui->id('id', 10, 'get');
$query = $sql->prepare("SELECT * FROM `resellerimages` WHERE `id`=? LIMIT 1");
$query->execute(array($id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
@ -86,9 +86,9 @@ if ($ui->w('action',4,'post') and !token(true)) {
$distro=$ui->names('distro',255,'post');
$description=$ui->description('description','post');
$pxelinux=$ui->escaped('pxelinux','post');
if ($ui->st('d','get') == 'md' and $ui->id('id',10,'get')) {
if ($ui->st('d','get') == 'md' and $ui->id('id', 10, 'get')) {
$query = $sql->prepare("UPDATE `resellerimages` SET `active`=?,`description`=?,`distro`=?,`bitversion`=?,`pxelinux`=? WHERE `id`=? LIMIT 1");
$query->execute(array($active,$description,$distro,$bitversion,$pxelinux,$ui->id('id',10,'get')));
$query->execute(array($active,$description,$distro,$bitversion,$pxelinux,$ui->id('id', 10, 'get')));
$loguseraction="%mod% %virtualimage% $description";
} else if ($ui->st('d','get') == 'ad') {
$query = $sql->prepare("INSERT INTO `resellerimages` (`active`,`description`,`distro`,`bitversion`,`pxelinux`) VALUES (?,?,?,?,?)");
@ -104,8 +104,8 @@ if ($ui->w('action',4,'post') and !token(true)) {
$template_file = $spracheResponse->error_table;
}
}
} else if ($ui->st('d','get') == 'dl' and $ui->id('id',10,'get')) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'dl' and $ui->id('id', 10, 'get')) {
$id=$ui->id('id', 10, 'get');
if (!$ui->smallletters('action',2,'post')) {
$query = $sql->prepare("SELECT `description` FROM `resellerimages` WHERE `id`=? LIMIT 1");
$query->execute(array($id));

View File

@ -258,8 +258,8 @@ if($ui->st('r', 'get')) {
$rsprache = getlanguagefile('redirect', $user_language, 0);
$text = $rsprache->refresh;
}
if ($ui->w('action',4,'post')) {
$action=$ui->w('action',4,'post');
if ($ui->w('action', 4, 'post')) {
$action=$ui->w('action', 4, 'post');
}
if($ui->smallletters('site','50', 'get')) {
$s = $ui->smallletters('site','50', 'get');
@ -369,7 +369,7 @@ if ($w=="ma" and $d=="ud" and isset($action) and $action=="ud" and $ui->descript
}
if ($i>0) {
$posted_gamestring = $i . $gamestring_buf;
$ajaxonload .= "onloaddata('serverallocation.php?gamestring=$posted_gamestring&id = ','$id','$id');";
$ajaxonload .= "onloaddata('serverallocation.php?gamestring=$posted_gamestring&id=','$id','$id');";
}
}
$ajaxonload .='}</script>';

View File

@ -50,7 +50,7 @@ if ($reseller_id==0) {
$logreseller = 0;
}
if ($reseller_id != 0 and $admin_id != $reseller_id) $reseller_id=$admin_id;
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get') == 'at') {
if (!$ui->smallletters('action',2,'post')) {

View File

@ -43,9 +43,9 @@ if ($d== 'se' and $reseller_id==0) {
include(EASYWIDIR . '/stuff/keyphrasefile.php');
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if (isset($ui->post['type']) and $ui->w('action',4,'post') == 'md') {
} else if (isset($ui->post['type']) and $ui->w('action', 4, 'post') == 'md') {
$error = 0;
if (!isset($ui->post['type']) or (!small_letters_check($ui->post['type'],'30'))) $error = 1;
if (!isset($ui->post['statip']) or (!isip($ui->post['statip'],'all') and !isurl($ui->post['statip']))) $error = 1;

View File

@ -51,7 +51,7 @@ if ($reseller_id==0) {
$logsubuser=(isset($_SESSION['oldid'])) ? $_SESSION['oldid'] : 0;
$logreseller = 0;
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get') == 'ad') {
if ($ui->smallletters('action',2,'post') == 'ad') {
@ -319,8 +319,8 @@ if ($ui->w('action',4,'post') and !token(true)) {
$selectlanguages=getlanguages($template_to_use);
$template_file = 'admin_user_add.tpl';
}
} else if ($ui->st('d','get') == 'dl' and $ui->id('id',10,'get') != $admin_id and ($pa['user'] or $pa['user_users'])) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'dl' and $ui->id('id', 10, 'get') != $admin_id and ($pa['user'] or $pa['user_users'])) {
$id=$ui->id('id', 10, 'get');
if (!$ui->smallletters('action',2,'post')) {
if($reseller_id==0) {
$query = $sql->prepare("SELECT `cname`,`name`,`accounttype` FROM `userdata` WHERE `id`=? AND (`resellerid`=? OR `id`=`resellerid`) LIMIT 1");
@ -372,8 +372,8 @@ if ($ui->w('action',4,'post') and !token(true)) {
} else {
$template_file = 'admin_404.tpl';
}
} else if ($ui->st('d','get') == 'md' and $ui->id('id',10,'get')) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'md' and $ui->id('id', 10, 'get')) {
$id=$ui->id('id', 10, 'get');
$resellerid=($reseller_id != 0 and $admin_id != $reseller_id) ? $admin_id : $reseller_id;
if (!$ui->smallletters('action',2,'post')) {
$query=($reseller_id==0) ? $sql->prepare("SELECT * FROM `userdata` WHERE id=? AND (`resellerid`=? OR `id`=resellerid) LIMIT 1") : $sql->prepare("SELECT * FROM `userdata` WHERE id=? AND `resellerid`=? LIMIT 1");
@ -602,8 +602,8 @@ if ($ui->w('action',4,'post') and !token(true)) {
} else {
$template_file = 'admin_404.tpl';
}
} else if ($ui->st('d','get') == 'pw' and $ui->id('id',10,'get') and $pa['userPassword']) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'pw' and $ui->id('id', 10, 'get') and $pa['userPassword']) {
$id=$ui->id('id', 10, 'get');
$query=($reseller_id==0) ? $sql->prepare("SELECT `cname`,`accounttype` FROM `userdata` WHERE `id`=? AND (`resellerid`=? OR `id`=`resellerid`) LIMIT 1") : $sql->prepare("SELECT `cname`,`accounttype` FROM `userdata` WHERE `id`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($id,$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {

View File

@ -61,7 +61,7 @@ $lookIpID=$reseller_id;
if ($reseller_id != 0 and $admin_id != $reseller_id) {
$lookIpID=$admin_id;
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if (in_array($ui->st('d','get'), array('md','ad'))){
if (!in_array($ui->smallletters('action',2,'post'), array('md','ad')) and $ui->st('d','get') == 'md') {

View File

@ -60,7 +60,7 @@ if (isset($admin_id)) {
} else {
$logsubuser = 0;
}
if ($ui->id('id',10,'get') and $ui->id('adid',10,'get') and in_array($ui->smallletters('action',2,'get'), array('ad','dl')) and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'),$substituteAccess['gs']))) {
if ($ui->id('id', 10, 'get') and $ui->id('adid',10,'get') and in_array($ui->smallletters('action',2,'get'), array('ad','dl')) and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'),$substituteAccess['gs']))) {
include(EASYWIDIR . '/stuff/ssh_exec.php');
include(EASYWIDIR . '/stuff/keyphrasefile.php');
$gameserverid=$ui->id('id',19,'get');
@ -165,7 +165,7 @@ if ($ui->id('id',10,'get') and $ui->id('adid',10,'get') and in_array($ui->smalll
} else {
$template_file = $sprache->failed;
}
} else if ($ui->id('id',19,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'),$substituteAccess['gs']))) {
} else if ($ui->id('id',19,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'),$substituteAccess['gs']))) {
$username=getusername($user_id);
$switchID=$ui->id('id',19,'get');
$table = array();

View File

@ -45,8 +45,8 @@ if (isset($admin_id) and $reseller_id != 0 and $admin_id != $reseller_id) {
}
$customer=getusername($user_id);
include(EASYWIDIR . '/stuff/keyphrasefile.php');
if ($ui->id('id',10,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'),$substituteAccess['gs']))) {
$id=(int)$ui->id('id',10,'get');
if ($ui->id('id', 10, 'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'),$substituteAccess['gs']))) {
$id=(int)$ui->id('id', 10, 'get');
$query = $sql->prepare("SELECT g.`serverip`,g.`port`,g.`rootID`,g.`newlayout`,s.`map`,t.`shorten`,AES_DECRYPT(g.`ftppassword`,?) AS `dftppassword`,u.`cname`,AES_DECRYPT(u.`ftpbackup`,?) AS `ftp` FROM `gsswitch` g LEFT JOIN `serverlist` s ON g.`serverid`=s.`id` LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` LEFT 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) {

View File

@ -53,10 +53,10 @@ $logsubuser = 0;
if (isset($admin_id)) $logsubuser=$admin_id;
else if (isset($subuser_id)) $logsubuser=$subuser_id;
if (isset($admin_id) and $reseller_id != 0) $reseller_id=$admin_id;
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get') == 'ri'and $ui->id('id',10,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'),$substituteAccess['ro']))) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'ri'and $ui->id('id', 10, 'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'),$substituteAccess['ro']))) {
$id=$ui->id('id', 10, 'get');
if (!$ui->st('action','post')) {
$option = array();
$query = $sql->prepare("SELECT COUNT(`id`) AS `a` FROM `rootsDHCP` WHERE `active`='Y' LIMIT 1");
@ -79,14 +79,14 @@ if ($ui->w('action',4,'post') and !token(true)) {
} else {
$status=$sprache->ok;
}
if ($row['userID']==null) {
if ($row['userID'] == null) {
$error=$sprache->userAdd;
} else if ($dhcp == 'N' or $pxe == 'N') {
$option[] = '<option value="rs">'.$sprache->restart.'</option>';
$option[] = '<option value="st">'.$sprache->stop.'</option>';
} else {
$showImages = true;
if ($row['status']==null or $row['status']==2) {
if ($row['status'] == null or $row['status']==2) {
$option[] = '<option value="rc">'.$sprache->rescue_start.'</option>';
$option[] = '<option value="ri">'.$sprache->reinstall.'</option>';
} else if ($row['status']==0) {

View File

@ -54,7 +54,7 @@ if (isset($admin_id)) {
$logsubuser = 0;
}
if ($ui->st('d','get') == 'ud' and $ui->id('id',19,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'),$substituteAccess['gs']))) {
if ($ui->st('d','get') == 'ud' and $ui->id('id',19,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'),$substituteAccess['gs']))) {
$serverid=(int)$ui->id('id',19,'get');
require_once(EASYWIDIR . '/stuff/keyphrasefile.php');
$query = $sql->prepare("SELECT g.`rootID`,g.`masterfdl`,g.`mfdldata`,g.`serverip`,g.`port`,g.`newlayout`,s.`servertemplate`,t.`modfolder`,t.`shorten`,u.`fdlpath`,u.`cname` FROM `gsswitch` g LEFT JOIN `serverlist` s ON g.`serverid`=s.`id` LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` LEFT JOIN `userdata` u ON g.`userid`=u.`id` WHERE g.`active`='Y' AND g.`id`=? AND g.`resellerid`=? LIMIT 1");
@ -81,7 +81,7 @@ if ($ui->st('d','get') == 'ud' and $ui->id('id',19,'get') and (!isset($_SESSION[
$actionstatus="fail";
}
}
} else if ($ui->st('d','get') == 'es' and $ui->id('id',19,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'),$substituteAccess['gs']))) {
} else if ($ui->st('d','get') == 'es' and $ui->id('id',19,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'),$substituteAccess['gs']))) {
$id=$ui->id('id',19,'get');
if (!$ui->smallletters('action',2,'post')) {
$query = $sql->prepare("SELECT `serverip`,`port`,`mfdldata`,`masterfdl` FROM `gsswitch` WHERE `active`='Y' AND `id`=? AND `resellerid`=? LIMIT 1");

View File

@ -58,17 +58,17 @@ if (isset($admin_id)) {
if (isset($admin_id) and $reseller_id != 0) {
$reseller_id=$admin_id;
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get') == 'ri' and !$ui->id('id',10,'get')) {
} else if ($ui->st('d','get') == 'ri' and !$ui->id('id', 10, 'get')) {
$template_file = $sprache->error_id;
} else if ($ui->st('d','get') == 'ri' 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');
} else if ($ui->st('d','get') == 'ri' 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');
if ($ui->st('action','post') == 'ri') {
$i = 0;
$gamestring = array();
$query = $sql->prepare("SELECT AES_DECRYPT(g.`ftppassword`,?) AS `cftppass`,AES_DECRYPT(g.`ppassword`,?) AS `pftppass`,g.`id`,g.`newlayout`,g.`rootID`,g.`serverip`,g.`port`,g.`pallowed`,g.`protected`,u.`cname` FROM `gsswitch` g 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,$ui->id('id',10,'get'),$user_id,$reseller_id));
$query->execute(array($aeskey,$aeskey,$ui->id('id', 10, 'get'),$user_id,$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$customer=$row['cname'];
$ftppass=($row['pallowed'] == 'Y' and $row['protected'] == 'Y') ? $row['pftppass'] : $row['cftppass'];
@ -135,8 +135,8 @@ if ($ui->w('action',4,'post') and !token(true)) {
$template_file = 'userpanel_404.tpl';
}
}
} else if (($ui->st('d','get') == 'rs' or $ui->st('d','get') == 'st' or $ui->st('d','get') == 'du') 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');
} else if (($ui->st('d','get') == 'rs' or $ui->st('d','get') == 'st' or $ui->st('d','get') == 'du') 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');
$query = $sql->prepare("SELECT `serverip`,`port`,`rootID` FROM `gsswitch` WHERE `id`=? AND `resellerid`=? AND `active`='Y' LIMIT 1");
$query->execute(array($id,$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
@ -161,8 +161,8 @@ if ($ui->w('action',4,'post') and !token(true)) {
if (!isset($gsip)) {
$template_file = 'userpanel_404.tpl';
}
} else if ($ui->st('d','get') == 'md' 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');
} else if ($ui->st('d','get') == 'md' 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');
if (!$ui->smallletters('action',2,'post')) {
$table = array();
$query = $sql->prepare("SELECT `id`,`normal_3`,`normal_4`,`hlds_3`,`hlds_4`,`hlds_5`,`hlds_6` FROM `eac` WHERE active='Y' AND `resellerid`=? LIMIT 1");
@ -372,8 +372,8 @@ if ($ui->w('action',4,'post') and !token(true)) {
} else {
$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');
} 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));

View File

@ -89,7 +89,7 @@ foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$table[$row['id']]=array('id'=>$row['id'],'address'=>$row['serverip'] . ':' . $row['port'],'games'=>$temp,'rootID'=>$row['rootID'],'gsfolder'=>$row['serverip'] . '_' . $row['port'],'customer'=>$customer,'cftppass'=>$row['cftppass']);
}
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->smallletters('action',2,'post') == 'ms') {
function checkFolders ($dir,$searchFor,$maxDepth=false,$currentDepth=0) {

View File

@ -53,10 +53,10 @@ if (isset($admin_id)) {
} else {
$logsubuser = 0;
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->id('id',10,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'),$substituteAccess['db']))) {
$id=$ui->id('id',10,'get');
} else if ($ui->id('id', 10, 'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'),$substituteAccess['db']))) {
$id=$ui->id('id', 10, 'get');
if (!$ui->smallletters('action',2,'post')) {
#https://github.com/easy-wi/developer/issues/42 column description added

View File

@ -34,7 +34,7 @@
* Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
* Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
*/
if ((!isset($user_id) or $main!=1) or (isset($user_id) and !$pa['restart']) or !$ui->id('id',10,'get')) {
if ((!isset($user_id) or $main!=1) or (isset($user_id) and !$pa['restart']) or !$ui->id('id', 10, 'get')) {
header('Location: userpanel.php');
die;
}
@ -56,7 +56,7 @@ if (isset($admin_id)) {
if (isset($admin_id) and $reseller_id != 0 and $admin_id != $reseller_id) $reseller_id=$admin_id;
$files = array();
$query = $sql->prepare("SELECT g.*,AES_DECRYPT(g.`ftppassword`,?) AS `dftppassword`,AES_DECRYPT(g.`ppassword`,?) AS `dpftppassword`,t.`protected` AS `tpallowed`,t.`shorten`,t.`protectedSaveCFGs`,t.`gamebinary`,t.`binarydir`,t.`modfolder`,u.`cname`,s.`servertemplate` 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 s.`resellerid`=? LIMIT 1");
$query->execute(array($aeskey,$aeskey,$ui->id('id',10,'get'),$user_id,$reseller_id));
$query->execute(array($aeskey,$aeskey,$ui->id('id', 10, 'get'),$user_id,$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$currentID=$row['serverid'];
$serverip=$row['serverip'];
@ -66,7 +66,7 @@ foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$protected=$row['protected'];
$pallowed=($row['pallowed'] == 'Y' and $row['tpallowed'] == 'Y') ? 'Y' : 'N';
$rootid=$row['rootID'];
$customer=($row['newlayout'] == 'Y') ? $row['cname'] . '-' . $ui->id('id',10,'get') : $row['cname'];
$customer=($row['newlayout'] == 'Y') ? $row['cname'] . '-' . $ui->id('id', 10, 'get') : $row['cname'];
$customerp=$customer.'-p';
$ftppass=$row['dftppassword'];
$ftppassProtected=$row['dpftppassword'];
@ -79,7 +79,7 @@ foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$gamePath=str_replace(array('//','///','////'),'/',$gamePath);
}
if ($query->rowCount()==0 or (isset($pallowed) and $pallowed== 'N') or (isset($_SESSION['sID']) and !in_array($ui->id('id',10,'get'),$substituteAccess['gs']))) {
if ($query->rowCount()==0 or (isset($pallowed) and $pallowed== 'N') or (isset($_SESSION['sID']) and !in_array($ui->id('id', 10, 'get'),$substituteAccess['gs']))) {
redirect('userpanel.php');
} else if (isset($rootid)) {
include(EASYWIDIR . '/stuff/ssh_exec.php');
@ -131,20 +131,20 @@ if ($query->rowCount()==0 or (isset($pallowed) and $pallowed== 'N') or (isset($_
$query = $sql->prepare("UPDATE `serverlist` SET `anticheat`='1' WHERE `id`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($currentID,$reseller_id));
$query = $sql->prepare("UPDATE `gsswitch` SET `protected`='N' WHERE `id`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($ui->id('id',10,'get'),$reseller_id));
$query->execute(array($ui->id('id', 10, 'get'),$reseller_id));
cfgTransfer('',$customerp,$ftppassProtected,$shorten,'server/',$customer,$ftppass,$serverTemplate);
$cmds=gsrestart($ui->id('id',10,'get'),'re',$aeskey,$reseller_id);
$cmds=gsrestart($ui->id('id', 10, 'get'),'re',$aeskey,$reseller_id);
ssh2_execute('gs',$rootid,$cmds);
$loguseraction="%stop% %pmode% $serverip:$port";
$insertlog->execute();
$template_file = $sprache->protect.' off';
} else if (isset($protected,$serverip,$port,$rootid,$customer,$ftppass) and $protected== 'N') {
$cmds=gsrestart($ui->id('id',10,'get'),'sp',$aeskey,$reseller_id);
$cmds=gsrestart($ui->id('id', 10, 'get'),'sp',$aeskey,$reseller_id);
$randompass=passwordgenerate(10);
$cmds[] = './control.sh mod '.$customer . ' ' . $ftppass . ' ' . $randompass;
$cmds[]="sudo -u ${customer}-p ./control.sh reinstserver ${customer}-p ${gamestring} ${gsfolder} protected";
$query = $sql->prepare("UPDATE `gsswitch` SET `ppassword`=AES_ENCRYPT(?,?),`protected`='Y',`psince`=NOW() WHERE `id`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($randompass,$aeskey,$ui->id('id',10,'get'),$reseller_id));
$query->execute(array($randompass,$aeskey,$ui->id('id', 10, 'get'),$reseller_id));
cfgTransfer('server/',$customer,$ftppass,$serverTemplate,'',$customerp,$randompass,$shorten);
ssh2_execute('gs',$rootid,$cmds);
$loguseraction="%restart% %pmode% $serverip:$port";

View File

@ -47,11 +47,11 @@ if (!isset($main) or $main!=1 or !isset($user_id) or !isset($user_language) or !
include(EASYWIDIR . '/stuff/keyphrasefile.php');
$sprache = getlanguagefile('user',$user_language,$reseller_id);
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->id('id',10,'get') or $ui->st('d','get') == 'ad') {
} else if ($ui->id('id', 10, 'get') or $ui->st('d','get') == 'ad') {
$template_file = 'userpanel_404.tpl';
$id=$ui->id('id',10,'get');
$id=$ui->id('id', 10, 'get');
if ($ui->st('d','get') == 'ad' or $ui->st('d','get') == 'md') {
$db = array();
$gs = array();
@ -81,7 +81,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
if (!$ui->st('action','post') and $ui->st('d','get') == 'ad') {
$randompass=passwordgenerate(10);
$template_file = 'userpanel_substitutes_add.tpl';
} else if (!$ui->st('action','post') and $ui->id('id',10,'get') and ($ui->st('d','get') == 'md' or $ui->st('d','get') == 'dl')) {
} else if (!$ui->st('action','post') and $ui->id('id', 10, 'get') and ($ui->st('d','get') == 'md' or $ui->st('d','get') == 'dl')) {
$query = $sql->prepare("SELECT `loginName`,`active`,`name`,`vname` FROM `userdata_substitutes` WHERE `sID`=? AND `resellerID`=? LIMIT 1");
$query->execute(array($id,$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
@ -99,8 +99,8 @@ if ($ui->w('action',4,'post') and !token(true)) {
$as[$row['oType']][$row['oID']] = true;
}
}
} else if ($ui->st('action','post') == 'ad' or ($ui->st('action','post') == 'md' and $ui->id('id',10,'get'))) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('action','post') == 'ad' or ($ui->st('action','post') == 'md' and $ui->id('id', 10, 'get'))) {
$id=$ui->id('id', 10, 'get');
if ($ui->st('action','post') == 'ad') {
if (!$ui->names('loginName',255,'post') or ($rSA['prefix1'] == 'Y' and $rSA['prefix2'] != '' and preg_match('/^'.$rSA['prefix2'].'[0-9]{0,}+$/',$ui->names('loginName',255,'post')))) $template_file = $spracheResponse->errorUsername;
$query = $sql->prepare("SELECT 1 FROM `userdata_substitutes` WHERE `loginName`=? LIMIT 1");
@ -120,7 +120,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
}
$id=$sql->lastInsertId();
}
} else if ($ui->st('action','post') == 'md' and $ui->id('id',10,'get')) {
} else if ($ui->st('action','post') == 'md' and $ui->id('id', 10, 'get')) {
if ($ui->password('security',255,'post') != '(encrypted)') {
$salt=md5(mt_rand().date('Y-m-d H:i:s:u'));
$query = $sql->prepare("SELECT `loginName` FROM `userdata_substitutes` WHERE `sID`=? AND `resellerID`=? LIMIT 1");
@ -157,7 +157,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
}
$template_file = (isset($changed)) ? $spracheResponse->table_add : $spracheResponse->error_table;
}
} else if ($ui->st('action','post') == 'dl' and $ui->id('id',10,'get')) {
} else if ($ui->st('action','post') == 'dl' and $ui->id('id', 10, 'get')) {
$query = $sql->prepare("DELETE FROM `userdata_substitutes` WHERE `sID`=? AND `resellerID`=? LIMIT 1");
$query->execute(array($id,$reseller_id));
$template_file = ($query->rowCount()>0) ? $spracheResponse->table_del : 'userpanel_404.tpl';

View File

@ -47,7 +47,7 @@ $logsubuser = 0;
if (isset($admin_id) and $reseller_id != 0 ) {
$reseller_id=$admin_id;
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get') == 'ad') {
if (!$ui->smallletters('action',2,'post')) {

View File

@ -54,10 +54,10 @@ $logsubuser = 0;
if (isset($admin_id)) $logsubuser=$admin_id;
else if (isset($subuser_id)) $logsubuser=$subuser_id;
if (isset($admin_id) and $reseller_id != 0) $reseller_id=$admin_id;
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get') == 'ri'and $ui->id('id',10,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'),$substituteAccess['vs']))) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'ri'and $ui->id('id', 10, 'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'),$substituteAccess['vs']))) {
$id=$ui->id('id', 10, 'get');
if (!$ui->st('action','post')) {
$option = array();
$query = $sql->prepare("SELECT COUNT(`id`) AS `a` FROM `rootsDHCP` WHERE `active`='Y' LIMIT 1");
@ -80,14 +80,14 @@ if ($ui->w('action',4,'post') and !token(true)) {
} else {
$status=$sprache->ok;
}
if ($row['userid']==null) {
if ($row['userid'] == null) {
$error=$sprache->userAdd;
} else if ($dhcp == 'N' or $pxe == 'N') {
$option[] = '<option value="rs">'.$sprache->restart.'</option>';
$option[] = '<option value="st">'.$sprache->stop.'</option>';
} else {
$showImages = true;
if ($row['status']==null or $row['status']==2) {
if ($row['status'] == null or $row['status']==2) {
$option[] = '<option value="rc">'.$sprache->rescue_start.'</option>';
$option[] = '<option value="ri">'.$sprache->reinstall.'</option>';
} else if ($row['status']==0) {

View File

@ -53,8 +53,8 @@ if (isset($admin_id)) {
}
include(EASYWIDIR . '/stuff/keyphrasefile.php');
include(EASYWIDIR . '/stuff/class_voice.php');
if ($ui->st('d','get') == 'bu' and $ui->id('id',10,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'), $substituteAccess['vo']))) {
$id=$ui->id('id',10,'get');
if ($ui->st('d','get') == 'bu' and $ui->id('id', 10, 'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'), $substituteAccess['vo']))) {
$id=$ui->id('id', 10, 'get');
$query = $sql->prepare("SELECT v.`id`,v.`ip`,v.`port`,v.`dns`,v.`localserverid`,m.`type`,m.`queryport`,AES_DECRYPT(m.`querypassword`,:aeskey) AS `decryptedquerypassword`,m.`rootid`,m.`addedby`,m.`ssh2ip`,m.`type`,m.`usedns`,m.`publickey`,m.`ssh2ip`,AES_DECRYPT(m.`ssh2port`,:aeskey) AS `decryptedssh2port`,AES_DECRYPT(m.`ssh2user`,:aeskey) AS `decryptedssh2user`,AES_DECRYPT(m.`ssh2password`,:aeskey) AS `decryptedssh2password`,m.`serverdir`,m.`keyname`,m.`notified` FROM `voice_server` v LEFT JOIN `voice_masterserver` m ON v.`masterserver`=m.`id` WHERE v.`active`='Y' AND m.`active`='Y' AND v.`backup`='Y' AND v.`id`=:server_id AND v.`userid`=:user_id AND v.`resellerid`=:reseller_id LIMIT 1");
$query->execute(array(':aeskey'=>$aeskey,':server_id'=>$id,':user_id'=>$user_id,':reseller_id'=>$reseller_id));
foreach ($query->fetchall(PDO::FETCH_ASSOC) as $row) {
@ -187,8 +187,8 @@ if ($ui->st('d','get') == 'bu' and $ui->id('id',10,'get') and (!isset($_SESSION[
} else {
$template_file = $spracheResponse->token;
}
} else if ($ui->st('d','get') == 'pk' and $ui->id('id',10,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'), $substituteAccess['vo']))) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'pk' and $ui->id('id', 10, 'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'), $substituteAccess['vo']))) {
$id=$ui->id('id', 10, 'get');
$query = $sql->prepare("SELECT `masterserver`,`localserverid`,CONCAT(`ip`,':',`port`) AS `address` FROM `voice_server` WHERE `id`=? AND `userid`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($id, $user_id, $reseller_id));
foreach ($query->fetchall(PDO::FETCH_ASSOC) as $row) {
@ -252,8 +252,8 @@ if ($ui->st('d','get') == 'bu' and $ui->id('id',10,'get') and (!isset($_SESSION[
} else {
$template_file = 'userpanel_404.tpl';
}
} else if ($ui->st('d','get') == 'rs' and $ui->id('id',10,'get') and $ui->smallletters('action',2,'post') == 'rs' and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'), $substituteAccess['vo']))) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'rs' and $ui->id('id', 10, 'get') and $ui->smallletters('action',2,'post') == 'rs' and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'), $substituteAccess['vo']))) {
$id=$ui->id('id', 10, 'get');
$query = $sql->prepare("SELECT v.*,m.`type`,m.`queryport`,AES_DECRYPT(m.`querypassword`,?) AS `decryptedquerypassword`,m.`rootid`,m.`addedby`,m.`ssh2ip`,m.`defaultname`,m.`defaultwelcome`,m.`defaulthostbanner_url`,m.`defaulthostbanner_gfx_url`,m.`defaulthostbutton_tooltip`,m.`defaulthostbutton_url`,m.`defaulthostbutton_gfx_url`,m.`usedns` FROM `voice_server` v LEFT JOIN `voice_masterserver` m ON v.`masterserver`=m.`id` WHERE v.`active`='Y' AND m.`active`='Y' AND v.`id`=? AND v.`userid`=? AND v.`resellerid`=? LIMIT 1");
$query->execute(array($aeskey, $id, $user_id, $reseller_id));
foreach ($query->fetchall(PDO::FETCH_ASSOC) as $row) {
@ -336,8 +336,8 @@ if ($ui->st('d','get') == 'bu' and $ui->id('id',10,'get') and (!isset($_SESSION[
} else {
$template_file = 'userpanel_404.tpl';
}
} else if ($ui->st('d','get') == 'md' and $ui->id('id',10,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'), $substituteAccess['vo']))) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'md' and $ui->id('id', 10, 'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'), $substituteAccess['vo']))) {
$id=$ui->id('id', 10, 'get');
if (!$ui->smallletters('action',2,'post')) {
$query = $sql->prepare("SELECT * FROM `voice_server` WHERE `id`=? AND `userid`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($id, $user_id, $reseller_id));
@ -550,8 +550,8 @@ if ($ui->st('d','get') == 'bu' and $ui->id('id',10,'get') and (!isset($_SESSION[
} else {
$template_file = $spracheResponse->token;
}
} else if ($ui->st('d','get') == 'st' and $ui->id('id',10,'get') and $ui->smallletters('action',2,'post') and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'), $substituteAccess['vo']))) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'st' and $ui->id('id', 10, 'get') and $ui->smallletters('action',2,'post') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'), $substituteAccess['vo']))) {
$id=$ui->id('id', 10, 'get');
$query = $sql->prepare("SELECT v.`ip`,v.`port`,v.`localserverid`,m.`type`,m.`queryport`,AES_DECRYPT(m.`querypassword`,?) AS `decryptedquerypassword`,m.`rootid`,m.`addedby`,m.`ssh2ip` FROM `voice_server` v LEFT JOIN `voice_masterserver` m ON v.`masterserver`=m.`id` WHERE v.`active`='Y' AND m.`active`='Y' AND v.`id`=? AND v.`userid`=? AND v.`resellerid`=? LIMIT 1");
$query->execute(array($aeskey, $id, $user_id, $reseller_id));
foreach ($query->fetchall(PDO::FETCH_ASSOC) as $row) {
@ -638,11 +638,11 @@ if ($ui->st('d','get') == 'bu' and $ui->id('id',10,'get') and (!isset($_SESSION[
$password = '';
}
$usedSlots=$row['usedslots'];
if ($row['usedslots']==null) {
if ($row['usedslots'] == null) {
$usedSlots = 0;
}
$flexSlots = '';
if ($row['flexSlots'] == 'Y' and $row['flexSlotsCurrent']==null) {
if ($row['flexSlots'] == 'Y' and $row['flexSlotsCurrent'] == null) {
$flexSlots=$row['slots'].'/';
} else if ($row['flexSlots'] == 'Y') {
$flexSlots=$row['flexSlotsCurrent'].'/';

View File

@ -49,9 +49,9 @@ if (isset($admin_id)) {
$logsubuser = 0;
}
include(EASYWIDIR . '/stuff/class_voice.php');
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if($ui->st('d','get') == 'md' and $ui->id('id',19,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'),$substituteAccess['vd']))) {
} else if($ui->st('d','get') == 'md' and $ui->id('id',19,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'),$substituteAccess['vd']))) {
$id=$ui->id('id',19,'get');
if (!$ui->smallletters('action',2,'post')) {
$query = $sql->prepare("SELECT d.`dnsID`,d.`dns`,d.`ip`,d.`port`,t.`defaultdns` FROM `voice_dns` d LEFT JOIN `voice_tsdns` t ON d.`tsdnsID`=t.`id` WHERE d.`active`='Y' AND d.`dnsID`=? AND d.`resellerID`=? LIMIT 1");

View File

@ -59,7 +59,7 @@ if ($reseller_id != 0 and $admin_id != $reseller_id) {
}
if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lVo']) and $licenceDetails['lVo']>0 and $licenceDetails['left']>0 and !is_numeric($licenceDetails['left'])) {
$template_file = $gsprache->licence;
} else if ($ui->w('action',4,'post') and !token(true)) {
} else if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get') == 'ad' and (!is_numeric($licenceDetails['lVo']) or $licenceDetails['lVo']>0) and ($licenceDetails['left']>0 or !is_numeric($licenceDetails['left']))) {
if (!$ui->w('action',3,'post')) {
@ -74,9 +74,9 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lVo']) and $licen
$ips[]=$row['ssh2ip'];
foreach (ipstoarray($row['ips']) as $ip) $ips[]=$ip;
if ($row['type'] == 'ts3') $type=$sprache->ts3;
$installedserver=($row['installedserver']==null) ? 0 : $row['installedserver'];
$installedslots=($row['installedslots']==null) ? 0 : $row['installedslots'];
$uslots=($row['uslots']==null) ? 0 : $row['uslots'];
$installedserver=($row['installedserver'] == null) ? 0 : $row['installedserver'];
$installedslots=($row['installedslots'] == null) ? 0 : $row['installedslots'];
$uslots=($row['uslots'] == null) ? 0 : $row['uslots'];
$table2[]=array('id'=>$row['id'],'server'=>implode('/', array_unique($ips)),'type'=>$type,'maxserver'=>$row['maxserver'],'maxslots'=>$row['maxslots'],'installedserver'=>$installedserver,'uslots'=>$uslots,'installedslots'=>$installedslots);
}
$template_file = "admin_voiceserver_add.tpl";
@ -89,8 +89,8 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lVo']) and $licen
$query2 = $sql->prepare("SELECT m.*,COUNT(v.`id`) AS `installedserver`,SUM(v.`slots`) AS `installedslots` FROM `voice_masterserver` m LEFT JOIN `voice_server` v ON m.`id`=v.`masterserver` WHERE m.`id`=? AND (m.`resellerid`=? OR m.`managedForID`=?) LIMIT 1");
$query2->execute(array($masterserver,$reseller_id,$admin_id));
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) {
$installedserver=($row2['installedserver']==null) ? 0 : $row2['installedserver'];
$installedslots=($row2['installedslots']==null) ? 0 : $row2['installedslots'];
$installedserver=($row2['installedserver'] == null) ? 0 : $row2['installedserver'];
$installedslots=($row2['installedslots'] == null) ? 0 : $row2['installedslots'];
if ($row2['usedns'] == 'Y') {
$dns=strtolower($cname.'.'.$row2['defaultdns']);
if ($row2['externalDefaultDNS'] == 'Y' and isid($row2['tsdnsServerID'],19)) {
@ -258,8 +258,8 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lVo']) and $licen
$query = $sql->prepare("SELECT COUNT(`id`) AS `installedserver`,SUM(`slots`) AS `installedslots` FROM `voice_server` WHERE `masterserver`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($masterserver,$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$installedserver=($row['installedserver']==null) ? 0 : $row['installedserver'];
$installedslots=($row['installedslots']==null) ? 0 : $row['installedslots'];
$installedserver=($row['installedserver'] == null) ? 0 : $row['installedserver'];
$installedslots=($row['installedslots'] == null) ? 0 : $row['installedslots'];
if (($installedslots+$slots)>$maxslots) $errors[]=$gsprache->licence.' ('.$sprache->slots.')';
if ($installedserver>=$maxserver) $errors[]=$gsprache->licence;
}
@ -321,12 +321,12 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lVo']) and $licen
} else {
$template_file = "Error: No User or Server selected";
}
} else if ($ui->st('d','get') == 'dl' and $ui->id('id',10,'get')) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'dl' and $ui->id('id', 10, 'get')) {
$id=$ui->id('id', 10, 'get');
$query = $sql->prepare("SELECT `ip`,`port`,`dns`,`masterserver`,`localserverid` FROM `voice_server` WHERE `id`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($id,$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$server=($row['dns']==null or $row['dns'] == '') ? $row['ip'] . ':' . $row['port'] : $row['dns'].' ('.$row['ip'] . ':' . $row['port'].')';
$server=($row['dns'] == null or $row['dns'] == '') ? $row['ip'] . ':' . $row['port'] : $row['dns'].' ('.$row['ip'] . ':' . $row['port'].')';
$dns=$row['dns'];
$ip=$row['ip'];
$port=$row['port'];
@ -410,8 +410,8 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lVo']) and $licen
} else {
$template_file = 'admin_404.tpl';
}
} else if ($ui->st('d','get') == 'md' and $ui->id('id',10,'get')) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'md' and $ui->id('id', 10, 'get')) {
$id=$ui->id('id', 10, 'get');
if (!$ui->w('action',2,'post')) {
$ips = array();
$query = $sql->prepare("SELECT v.*,u.`cname` FROM `voice_server` v INNER JOIN `userdata` u ON v.`userid`=u.`id` WHERE v.`id`=? AND v.`resellerid`=? LIMIT 1");
@ -446,8 +446,8 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lVo']) and $licen
$query2 = $sql->prepare("SELECT m.`ssh2ip`,m.`ips`,m.`rootid`,m.`addedby`,m.`queryport`,AES_DECRYPT(m.`querypassword`,?) AS `decryptedquerypassword`,m.`maxserver`,m.`maxslots`,COUNT(v.`id`) AS `installedserver`,SUM(v.`slots`) AS `installedslots` FROM `voice_masterserver` m LEFT JOIN `voice_server` v ON m.`id`=v.`masterserver` WHERE m.`id`=? AND (m.`resellerid`=? OR m.`managedForID`=?) LIMIT 1");
$query2->execute(array($aeskey, $row['masterserver'],$reseller_id,$admin_id));
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) {
$installedserver=($row2['installedserver']==null) ? 0 : $row2['installedserver'];
$installedslots=($row2['installedslots']==null) ? 0 : $row2['installedslots'];
$installedserver=($row2['installedserver'] == null) ? 0 : $row2['installedserver'];
$installedslots=($row2['installedslots'] == null) ? 0 : $row2['installedslots'];
$queryport=$row2['queryport'];
$querypassword=$row2['decryptedquerypassword'];
$maxserver=$row2['maxserver'];
@ -512,7 +512,7 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lVo']) and $licen
$ip=$ui->ip('ip','post');
if (!$ui->id('slots',30,'post')) $errors[]=$sprache->slots;
if (!$ui->ip('ip','post')) $errors[]=$sprache->ip;
if ($ui->password('initialpassword',50,'post') or (isset($ui->post['initialpassword']) and ($ui->post['initialpassword'] == '' or $ui->post['initialpassword']==null))) $initialpassword=$ui->post['initialpassword'];
if ($ui->password('initialpassword',50,'post') or (isset($ui->post['initialpassword']) and ($ui->post['initialpassword'] == '' or $ui->post['initialpassword'] == null))) $initialpassword=$ui->post['initialpassword'];
else $errors[]=$sprache->password;
$query = $sql->prepare("SELECT * FROM `voice_server` WHERE `id`=? AND `resellerid`=? LIMIT 1");
@ -741,9 +741,9 @@ if ($ui->st('d','get') == 'ad' and is_numeric($licenceDetails['lVo']) and $licen
$server=($row['usedns'] == 'Y' and $dns != null or $dns != '') ? '<a href="ts3server://'.$row['dns'].$password.'">'.$row['ip'] . ':' . $row['port'].'</a><br />( '.$row['dns'].' )' : '<a href="ts3server://'.$row['ip'] . ':' . $row['port'].$password.'">'.$row['ip'] . ':' . $row['port'].'</a>';
}
$usedSlots=$row['usedslots'];
if ($row['usedslots']==null) $usedSlots = 0;
if ($row['usedslots'] == null) $usedSlots = 0;
$flexSlots = '';
if ($row['flexSlots'] == 'Y' and $row['flexSlotsCurrent']==null) $flexSlots=$row['slots'].'/';
if ($row['flexSlots'] == 'Y' and $row['flexSlotsCurrent'] == null) $flexSlots=$row['slots'].'/';
else if ($row['flexSlots'] == 'Y') $flexSlots=$row['flexSlotsCurrent'].'/';
$usage=$usedSlots. '/' . $flexSlots.$row['slots'];
$days=floor($row['uptime']/86400);

View File

@ -54,9 +54,9 @@ if ($reseller_id==0) {
if ($reseller_id != 0 and $admin_id != $reseller_id) $reseller_id=$admin_id;
include(EASYWIDIR . '/stuff/keyphrasefile.php');
include(EASYWIDIR . '/stuff/class_voice.php');
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get') == 'ad' or (($ui->st('d','get') == 'ri' or $ui->st('d','get') == 'md')and $id=$ui->id('id',10,'get'))) {
} else if ($ui->st('d','get') == 'ad' or (($ui->st('d','get') == 'ri' or $ui->st('d','get') == 'md')and $id=$ui->id('id', 10, 'get'))) {
// https://github.com/easy-wi/developer/issues/36 managedServer,managedForID added
if(!$ui->w('action',3,'post') and ($ui->st('d','get') == 'ad' or $ui->st('d','get') == 'md')) {
@ -96,7 +96,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) $externalDNS[$row['id']]=$row['ssh2ip'].': '.$row['description'];
$template_file = 'admin_voicemasterserver_add.tpl';
} else if ($ui->st('d','get') == 'md' and !$ui->w('action',3,'post') and $ui->id('id',19,'get')) {
$id=$ui->id('id',10,'get');
$id=$ui->id('id', 10, 'get');
$query = $sql->prepare("SELECT *,AES_DECRYPT(`querypassword`,:aeskey) AS `decryptedquerypassword`,AES_DECRYPT(`ssh2port`,:aeskey) AS `decryptedssh2port`,AES_DECRYPT(`ssh2user`,:aeskey) AS `decryptedssh2user`,AES_DECRYPT(`ssh2password`,:aeskey) AS `decryptedssh2password` FROM `voice_masterserver` WHERE `id`=:id AND `resellerid`=:reseller_id LIMIT 1");
$query->execute(array(':aeskey'=>$aeskey,':id'=>$id,':reseller_id'=>$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
@ -159,7 +159,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
} else {
$template_file = 'admin_404.tpl';
}
} else if ($ui->w('action',3,'post') == 'ad' or $ui->w('action',3,'post') == 'md' or ($ui->st('d','get') == 'ri' and $id=$ui->id('id',10,'get')) and $ui->w('action',3,'post') != 'ad2') {
} else if ($ui->w('action',3,'post') == 'ad' or $ui->w('action',3,'post') == 'md' or ($ui->st('d','get') == 'ri' and $id=$ui->id('id', 10, 'get')) and $ui->w('action',3,'post') != 'ad2') {
$error = array();
if ($ui->st('d','get') == 'ad' or $ui->st('d','get') == 'md') {
if ($ui->active('active','post')) {
@ -291,8 +291,8 @@ if ($ui->w('action',4,'post') and !token(true)) {
$usedns = 'N';
$fail = 1;
}
} else if ($ui->st('d','get') == 'ri' and $id=$ui->id('id',10,'get')) {
$masterid=$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'ri' and $id=$ui->id('id', 10, 'get')) {
$masterid=$id=$ui->id('id', 10, 'get');
$query = $sql->prepare("SELECT *,AES_DECRYPT(`querypassword`,:aeskey) AS `decryptedquerypassword`,AES_DECRYPT(`ssh2port`,:aeskey) AS `decryptedssh2port`,AES_DECRYPT(`ssh2user`,:aeskey) AS `decryptedssh2user`,AES_DECRYPT(`ssh2password`,:aeskey) AS `decryptedssh2password` FROM `voice_masterserver` WHERE `id`=:id AND `resellerid`=:reseller_id LIMIT 1");
$query->execute(array(':aeskey'=>$aeskey,':id'=>$masterid,':reseller_id'=>$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
@ -350,7 +350,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
if (count($error)>0) {
$template_file = 'Error: '.implode('<br />',$error);
} else {
if ($ui->w('action',3,'post') == 'ad' or ($ui->st('d','get') == 'ri' and $id=$ui->id('id',10,'get') and $ui->w('action',3,'post') != 'ad2')) {
if ($ui->w('action',3,'post') == 'ad' or ($ui->st('d','get') == 'ri' and $id=$ui->id('id', 10, 'get') and $ui->w('action',3,'post') != 'ad2')) {
$usprache = getlanguagefile('user',$user_language,$reseller_id);
$connected = false;
if ($addtype==2) {
@ -524,8 +524,8 @@ if ($ui->w('action',4,'post') and !token(true)) {
}
}
} else if ($ui->w('action',3,'post') == 'ad2') {
if ($ui->id('id',10,'get')) {
$masterid=$ui->id('id',10,'get');
if ($ui->id('id', 10, 'get')) {
$masterid=$ui->id('id', 10, 'get');
$query = $sql->prepare("SELECT *,AES_DECRYPT(`querypassword`,:aeskey) AS `decryptedquerypassword`,AES_DECRYPT(`ssh2port`,:aeskey) AS `decryptedssh2port`,AES_DECRYPT(`ssh2user`,:aeskey) AS `decryptedssh2user`,AES_DECRYPT(`ssh2password`,:aeskey) AS `decryptedssh2password` FROM `voice_masterserver` WHERE `id`=:id AND `resellerid`=:reseller_id LIMIT 1");
$query->execute(array(':aeskey'=>$aeskey,':id'=>$masterid,':reseller_id'=>$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
@ -755,7 +755,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
$template_file = 'Unknown Error 4';
}
} else if ($ui->st('d','get') == 'dl' and $ui->id('id',19,'get')) {
$id=$ui->id('id',10,'get');
$id=$ui->id('id', 10, 'get');
if (!$ui->w('action',2,'post')) {
$query = $sql->prepare("SELECT `ssh2ip`,`rootid`,`type` FROM `voice_masterserver` WHERE `id`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($id,$reseller_id));
@ -859,15 +859,15 @@ if ($ui->w('action',4,'post') and !token(true)) {
$imgName='16_bad';
$imgAlt='inactive';
}
if ($row['ssh2ip']==null) {
if ($row['ssh2ip'] == null) {
$query2->execute(array($row['rootid'], $row['resellerid']));
$ip=$query2->fetchColumn();
} else {
$ip=$row['ssh2ip'];
}
$defaultdns=($row['usedns'] == 'Y') ? $row['defaultdns'] : null;
$installedslots=($row['installedslots']==null) ? 0 : $row['installedslots'];
$uslots=($row['uslots']==null) ? 0 : $row['uslots'];
$installedslots=($row['installedslots'] == null) ? 0 : $row['installedslots'];
$uslots=($row['uslots'] == null) ? 0 : $row['uslots'];
$vs = array();
$query3->execute(array($id, $row['resellerid']));
foreach ($query3->fetchAll(PDO::FETCH_ASSOC) as $row3) {

View File

@ -62,7 +62,7 @@ if ($reseller_id==0) {
if ($reseller_id != 0 and $admin_id != $reseller_id) {
$reseller_id=$admin_id;
}
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get') == 'ad' or $ui->st('d','get') == 'md') {
if ($ui->st('d','get') == 'ad' and !$ui->smallletters('action',2,'post')) {

View File

@ -56,7 +56,7 @@ if ($reseller_id==0) {
$logreseller = 0;
}
if ($reseller_id != 0 and $admin_id != $reseller_id) $reseller_id=$admin_id;
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($ui->st('d','get') == 'ad' or $ui->st('d','get') == 'md') {
if ($ui->st('d','get') == 'ad' and !$ui->w('action',3,'post')) {
@ -114,8 +114,8 @@ if ($ui->w('action',4,'post') and !token(true)) {
} else {
$template_file = 'admin_voice_dns_add2.tpl';
}
} else if ($ui->st('d','get') == 'md' and !$ui->smallletters('action',2,'post') and $ui->id('id',10,'get')) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'md' and !$ui->smallletters('action',2,'post') and $ui->id('id', 10, 'get')) {
$id=$ui->id('id', 10, 'get');
$query = $sql->prepare("SELECT d.*,t.`ssh2ip`,t.`description`,u.`cname`,u.`vname`,u.`name` FROM `voice_dns` d INNER JOIN `voice_tsdns` t ON d.`tsdnsID`=t.`id` INNER JOIN `userdata` u ON d.`userID`=u.`id` WHERE d.`dnsID`=? AND d.`resellerID`=? LIMIT 1");
$query->execute(array($id,$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
@ -185,7 +185,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
$error[] = 'tsdnsID';
}
} else {
$id=$ui->id('id',10,'get');
$id=$ui->id('id', 10, 'get');
$query = $sql->prepare("SELECT `active`,`dns`,`ip`,`port`,`tsdnsID` FROM `voice_dns` WHERE `dnsID`=? AND `resellerID`=? LIMIT 1");
$query->execute(array($id,$reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
@ -274,8 +274,8 @@ if ($ui->w('action',4,'post') and !token(true)) {
} else {
$template_file = 'admin_404.tpl';
}
} else if ($ui->st('d','get') == 'dl' and $ui->id('id',10,'get')) {
$id=$ui->id('id',10,'get');
} else if ($ui->st('d','get') == 'dl' and $ui->id('id', 10, 'get')) {
$id=$ui->id('id', 10, 'get');
if (!$ui->smallletters('action',2,'post')) {
$query = $sql->prepare("SELECT `dns`,`ip`,`port` FROM `voice_dns` WHERE `dnsID`=? AND `resellerID`=? LIMIT 1");
$query->execute(array($id,$reseller_id));

View File

@ -40,10 +40,10 @@ if(!isset($admin_id) or $main!=1 or (isset($admin_id) and !$pa['voiceserver'] an
die;
}
$sprache = getlanguagefile('traffic',$user_language,$reseller_id);
if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->w('action', 4, 'post') and !token(true)) {
$template_file = $spracheResponse->token;
} else if ($d== 'se' and $pa['voiceserverSettings']) {
if (isset($ui->post['text_colour_1']) and $ui->w('action',4,'post') == 'md') {
if (isset($ui->post['text_colour_1']) and $ui->w('action', 4, 'post') == 'md') {
$error = 0;
if (!validate_int($ui->post['text_colour_1'], 0 , 255) and $ui->post['text_colour_1'] != 0) $error = 1;
if (!validate_int($ui->post['text_colour_2'], 0 , 255) and $ui->post['text_colour_2'] != 0) $error = 1;