From 2355ef0da820bca8c79b826e7c871d8ee5e7ad85 Mon Sep 17 00:00:00 2001 From: Ulrich Block Date: Thu, 3 Oct 2013 16:48:54 +0200 Subject: [PATCH] 17 + 88 + 89: Teeworlds https://github.com/easy-wi/developer/issues/17 https://github.com/easy-wi/developer/issues/88 https://github.com/easy-wi/developer/issues/89 --- server/control.sh | 6 ++ web/get_password.php | 6 +- web/lend.php | 2 +- web/reboot.php | 2 +- web/serverallocation.php | 10 +- web/statuscheck.php | 20 ++-- web/stuff/addons.php | 6 +- web/stuff/api_external_auth.php | 2 +- web/stuff/api_import_users.php | 2 +- web/stuff/api_settings.php | 2 +- web/stuff/class_masterserver.php | 17 ++-- web/stuff/eac.php | 6 +- web/stuff/feeds.php | 2 +- web/stuff/functions.php | 14 +-- web/stuff/gserver.php | 18 ++-- web/stuff/images.php | 2 +- web/stuff/jobs_list.php | 6 +- web/stuff/lendserver.php | 2 +- web/stuff/masterserver.php | 4 +- web/stuff/mysql_server.php | 30 +++--- web/stuff/page_comments.php | 2 +- web/stuff/page_download.php | 4 +- web/stuff/page_downloads.php | 20 ++-- web/stuff/page_news_edit.php | 16 ++-- web/stuff/page_pages.php | 14 +-- web/stuff/page_settings.php | 4 +- web/stuff/panel_settings.php | 2 +- web/stuff/panel_settings_columns.php | 12 +-- web/stuff/panel_settings_email.php | 2 +- web/stuff/queries.php | 121 +++++++++++++++---------- web/stuff/root_dedicated.php | 20 ++-- web/stuff/root_pxe.php | 2 +- web/stuff/root_virtual_hosts.php | 10 +- web/stuff/root_virtual_server.php | 16 ++-- web/stuff/roots.php | 2 +- web/stuff/roots_os_templates.php | 12 +-- web/stuff/settings.php | 6 +- web/stuff/tickets.php | 2 +- web/stuff/traffic.php | 4 +- web/stuff/user.php | 14 +-- web/stuff/user_groups.php | 2 +- web/stuff/userpanel_ao.php | 4 +- web/stuff/userpanel_backup.php | 4 +- web/stuff/userpanel_dedicated.php | 10 +- web/stuff/userpanel_fdl.php | 4 +- web/stuff/userpanel_gserver.php | 22 ++--- web/stuff/userpanel_migration.php | 2 +- web/stuff/userpanel_mysql.php | 6 +- web/stuff/userpanel_protectionmode.php | 16 ++-- web/stuff/userpanel_substitutes.php | 16 ++-- web/stuff/userpanel_tickets.php | 2 +- web/stuff/userpanel_virtual.php | 10 +- web/stuff/userpanel_voice.php | 24 ++--- web/stuff/userpanel_voice_dns.php | 4 +- web/stuff/voice.php | 36 ++++---- web/stuff/voice_master.php | 26 +++--- web/stuff/voice_tsdns.php | 2 +- web/stuff/voice_tsdnsrecords.php | 12 +-- web/stuff/voice_usage.php | 4 +- 59 files changed, 343 insertions(+), 307 deletions(-) diff --git a/server/control.sh b/server/control.sh index 6000b6df..31cd7b98 100644 --- a/server/control.sh +++ b/server/control.sh @@ -311,6 +311,12 @@ echo ' HideFiles (^\..+|\.ssh|\.bash_history|\.bash_logout|\.bashrc|\.profile)$ AllowAll + + Umask 077 077 + + AllowAll + + Umask 077 077 diff --git a/web/get_password.php b/web/get_password.php index a20fa08f..9fc126b8 100644 --- a/web/get_password.php +++ b/web/get_password.php @@ -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) { diff --git a/web/lend.php b/web/lend.php index 4faab3e7..aee05c0f 100644 --- a/web/lend.php +++ b/web/lend.php @@ -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']; } diff --git a/web/reboot.php b/web/reboot.php index f3935445..4cddb168 100644 --- a/web/reboot.php +++ b/web/reboot.php @@ -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(); diff --git a/web/serverallocation.php b/web/serverallocation.php index becde009..04f57c1c 100644 --- a/web/serverallocation.php +++ b/web/serverallocation.php @@ -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']; diff --git a/web/statuscheck.php b/web/statuscheck.php index 49afcf4a..c3be6d7a 100644 --- a/web/statuscheck.php +++ b/web/statuscheck.php @@ -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; } diff --git a/web/stuff/addons.php b/web/stuff/addons.php index 77e17e27..175a9b69 100644 --- a/web/stuff/addons.php +++ b/web/stuff/addons.php @@ -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) { diff --git a/web/stuff/api_external_auth.php b/web/stuff/api_external_auth.php index 93473bfa..2b04cdf4 100644 --- a/web/stuff/api_external_auth.php +++ b/web/stuff/api_external_auth.php @@ -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"); diff --git a/web/stuff/api_import_users.php b/web/stuff/api_import_users.php index 60d04a82..bd873b15 100644 --- a/web/stuff/api_import_users.php +++ b/web/stuff/api_import_users.php @@ -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') { diff --git a/web/stuff/api_settings.php b/web/stuff/api_settings.php index 7e28baaf..b5f11493 100644 --- a/web/stuff/api_settings.php +++ b/web/stuff/api_settings.php @@ -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"); diff --git a/web/stuff/class_masterserver.php b/web/stuff/class_masterserver.php index d6a2f189..f74b0046 100644 --- a/web/stuff/class_masterserver.php +++ b/web/stuff/class_masterserver.php @@ -1,4 +1,5 @@ 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 () { diff --git a/web/stuff/eac.php b/web/stuff/eac.php index d077fe25..1e652204 100644 --- a/web/stuff/eac.php +++ b/web/stuff/eac.php @@ -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; diff --git a/web/stuff/feeds.php b/web/stuff/feeds.php index 92032947..2d183c28 100644 --- a/web/stuff/feeds.php +++ b/web/stuff/feeds.php @@ -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'){ diff --git a/web/stuff/functions.php b/web/stuff/functions.php index 9388ae9e..c1b11aa9 100644 --- a/web/stuff/functions.php +++ b/web/stuff/functions.php @@ -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')); diff --git a/web/stuff/gserver.php b/web/stuff/gserver.php index 6b2cf0c0..adcd4f9b 100644 --- a/web/stuff/gserver.php +++ b/web/stuff/gserver.php @@ -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) { diff --git a/web/stuff/images.php b/web/stuff/images.php index e9abdf6b..8d6b6ff8 100644 --- a/web/stuff/images.php +++ b/web/stuff/images.php @@ -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')) { diff --git a/web/stuff/jobs_list.php b/web/stuff/jobs_list.php index 5f1d1eae..92708aef 100644 --- a/web/stuff/jobs_list.php +++ b/web/stuff/jobs_list.php @@ -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) { diff --git a/web/stuff/lendserver.php b/web/stuff/lendserver.php index 53410b61..70437470 100644 --- a/web/stuff/lendserver.php +++ b/web/stuff/lendserver.php @@ -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')) { diff --git a/web/stuff/masterserver.php b/web/stuff/masterserver.php index bf85041f..805a128c 100644 --- a/web/stuff/masterserver.php +++ b/web/stuff/masterserver.php @@ -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 = ''; diff --git a/web/stuff/mysql_server.php b/web/stuff/mysql_server.php index b73f8a11..2b3852f7 100644 --- a/web/stuff/mysql_server.php +++ b/web/stuff/mysql_server.php @@ -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('
',$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) { diff --git a/web/stuff/page_comments.php b/web/stuff/page_comments.php index 09842c40..7ffd7dee 100644 --- a/web/stuff/page_comments.php +++ b/web/stuff/page_comments.php @@ -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'); diff --git a/web/stuff/page_download.php b/web/stuff/page_download.php index d627917e..6a43dfc8 100644 --- a/web/stuff/page_download.php +++ b/web/stuff/page_download.php @@ -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; diff --git a/web/stuff/page_downloads.php b/web/stuff/page_downloads.php index f471e631..aebe818a 100644 --- a/web/stuff/page_downloads.php +++ b/web/stuff/page_downloads.php @@ -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=' '; @@ -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'; diff --git a/web/stuff/page_news_edit.php b/web/stuff/page_news_edit.php index f8ad3f54..4a425972 100644 --- a/web/stuff/page_news_edit.php +++ b/web/stuff/page_news_edit.php @@ -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(); } diff --git a/web/stuff/page_pages.php b/web/stuff/page_pages.php index 56c05f22..0450f97c 100644 --- a/web/stuff/page_pages.php +++ b/web/stuff/page_pages.php @@ -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(); } diff --git a/web/stuff/page_settings.php b/web/stuff/page_settings.php index 92ab7271..4840ae5c 100644 --- a/web/stuff/page_settings.php +++ b/web/stuff/page_settings.php @@ -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']; } diff --git a/web/stuff/panel_settings.php b/web/stuff/panel_settings.php index d21aca3e..9792d3b4 100644 --- a/web/stuff/panel_settings.php +++ b/web/stuff/panel_settings.php @@ -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; diff --git a/web/stuff/panel_settings_columns.php b/web/stuff/panel_settings_columns.php index e038daab..1272152d 100644 --- a/web/stuff/panel_settings_columns.php +++ b/web/stuff/panel_settings_columns.php @@ -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) { diff --git a/web/stuff/panel_settings_email.php b/web/stuff/panel_settings_email.php index 697aba5c..1bf23283 100644 --- a/web/stuff/panel_settings_email.php +++ b/web/stuff/panel_settings_email.php @@ -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; diff --git a/web/stuff/queries.php b/web/stuff/queries.php index 8aa5c77b..bc735c27 100644 --- a/web/stuff/queries.php +++ b/web/stuff/queries.php @@ -35,65 +35,94 @@ * Sie sollten eine Kopie der GNU General Public License zusammen mit diesem * Programm erhalten haben. Wenn nicht, siehe . */ -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 ''; } \ No newline at end of file diff --git a/web/stuff/root_dedicated.php b/web/stuff/root_dedicated.php index 03b10740..f867bd59 100644 --- a/web/stuff/root_dedicated.php +++ b/web/stuff/root_dedicated.php @@ -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('
',$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[] = ''; } else { $showImages = true; - if ($row['status']==null or $row['status']==2) { + if ($row['status'] == null or $row['status']==2) { $option[] = ''; $option[] = ''; } else if ($row['status']==0) { diff --git a/web/stuff/root_pxe.php b/web/stuff/root_pxe.php index 3ade96e5..421a7aa3 100644 --- a/web/stuff/root_pxe.php +++ b/web/stuff/root_pxe.php @@ -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') { diff --git a/web/stuff/root_virtual_hosts.php b/web/stuff/root_virtual_hosts.php index a6de1c98..ee80c9d9 100644 --- a/web/stuff/root_virtual_hosts.php +++ b/web/stuff/root_virtual_hosts.php @@ -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)); diff --git a/web/stuff/root_virtual_server.php b/web/stuff/root_virtual_server.php index 98e24c92..8b4a3b3d 100644 --- a/web/stuff/root_virtual_server.php +++ b/web/stuff/root_virtual_server.php @@ -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[] = ''; } else if ($row['status']==0) { diff --git a/web/stuff/roots.php b/web/stuff/roots.php index 644efb17..7d7fe4f6 100644 --- a/web/stuff/roots.php +++ b/web/stuff/roots.php @@ -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') { diff --git a/web/stuff/roots_os_templates.php b/web/stuff/roots_os_templates.php index 5080c6da..4854ce61 100644 --- a/web/stuff/roots_os_templates.php +++ b/web/stuff/roots_os_templates.php @@ -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)); diff --git a/web/stuff/settings.php b/web/stuff/settings.php index 85d23844..d819e941 100644 --- a/web/stuff/settings.php +++ b/web/stuff/settings.php @@ -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 .='}'; diff --git a/web/stuff/tickets.php b/web/stuff/tickets.php index 22911e27..f09561e0 100644 --- a/web/stuff/tickets.php +++ b/web/stuff/tickets.php @@ -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')) { diff --git a/web/stuff/traffic.php b/web/stuff/traffic.php index a11cec3b..ef2fc487 100644 --- a/web/stuff/traffic.php +++ b/web/stuff/traffic.php @@ -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; diff --git a/web/stuff/user.php b/web/stuff/user.php index f2b6bdf5..50d5505f 100644 --- a/web/stuff/user.php +++ b/web/stuff/user.php @@ -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) { diff --git a/web/stuff/user_groups.php b/web/stuff/user_groups.php index 4dc20a50..59211042 100644 --- a/web/stuff/user_groups.php +++ b/web/stuff/user_groups.php @@ -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') { diff --git a/web/stuff/userpanel_ao.php b/web/stuff/userpanel_ao.php index 2b2ea245..f5d15a3b 100644 --- a/web/stuff/userpanel_ao.php +++ b/web/stuff/userpanel_ao.php @@ -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(); diff --git a/web/stuff/userpanel_backup.php b/web/stuff/userpanel_backup.php index ea0a68f2..da7c42ce 100644 --- a/web/stuff/userpanel_backup.php +++ b/web/stuff/userpanel_backup.php @@ -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) { diff --git a/web/stuff/userpanel_dedicated.php b/web/stuff/userpanel_dedicated.php index e0af85ef..12a18acc 100644 --- a/web/stuff/userpanel_dedicated.php +++ b/web/stuff/userpanel_dedicated.php @@ -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[] = ''; } else { $showImages = true; - if ($row['status']==null or $row['status']==2) { + if ($row['status'] == null or $row['status']==2) { $option[] = ''; $option[] = ''; } else if ($row['status']==0) { diff --git a/web/stuff/userpanel_fdl.php b/web/stuff/userpanel_fdl.php index d2e773e3..2bc94c00 100644 --- a/web/stuff/userpanel_fdl.php +++ b/web/stuff/userpanel_fdl.php @@ -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"); diff --git a/web/stuff/userpanel_gserver.php b/web/stuff/userpanel_gserver.php index 203c0f13..fc219de8 100644 --- a/web/stuff/userpanel_gserver.php +++ b/web/stuff/userpanel_gserver.php @@ -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)); diff --git a/web/stuff/userpanel_migration.php b/web/stuff/userpanel_migration.php index bc9102dc..2ad1f0a4 100644 --- a/web/stuff/userpanel_migration.php +++ b/web/stuff/userpanel_migration.php @@ -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) { diff --git a/web/stuff/userpanel_mysql.php b/web/stuff/userpanel_mysql.php index de073521..74dca58c 100644 --- a/web/stuff/userpanel_mysql.php +++ b/web/stuff/userpanel_mysql.php @@ -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 diff --git a/web/stuff/userpanel_protectionmode.php b/web/stuff/userpanel_protectionmode.php index 4de2cfea..4a5c92ce 100644 --- a/web/stuff/userpanel_protectionmode.php +++ b/web/stuff/userpanel_protectionmode.php @@ -34,7 +34,7 @@ * Sie sollten eine Kopie der GNU General Public License zusammen mit diesem * Programm erhalten haben. Wenn nicht, siehe . */ -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"; diff --git a/web/stuff/userpanel_substitutes.php b/web/stuff/userpanel_substitutes.php index 9659e983..52b98b90 100644 --- a/web/stuff/userpanel_substitutes.php +++ b/web/stuff/userpanel_substitutes.php @@ -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'; diff --git a/web/stuff/userpanel_tickets.php b/web/stuff/userpanel_tickets.php index 1b860942..9e17bc2a 100644 --- a/web/stuff/userpanel_tickets.php +++ b/web/stuff/userpanel_tickets.php @@ -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')) { diff --git a/web/stuff/userpanel_virtual.php b/web/stuff/userpanel_virtual.php index 6406abb1..269bc92b 100644 --- a/web/stuff/userpanel_virtual.php +++ b/web/stuff/userpanel_virtual.php @@ -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[] = ''; } else { $showImages = true; - if ($row['status']==null or $row['status']==2) { + if ($row['status'] == null or $row['status']==2) { $option[] = ''; $option[] = ''; } else if ($row['status']==0) { diff --git a/web/stuff/userpanel_voice.php b/web/stuff/userpanel_voice.php index 0cf2b845..d6607182 100644 --- a/web/stuff/userpanel_voice.php +++ b/web/stuff/userpanel_voice.php @@ -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'].'/'; diff --git a/web/stuff/userpanel_voice_dns.php b/web/stuff/userpanel_voice_dns.php index 55f38fea..cc8234df 100644 --- a/web/stuff/userpanel_voice_dns.php +++ b/web/stuff/userpanel_voice_dns.php @@ -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"); diff --git a/web/stuff/voice.php b/web/stuff/voice.php index 8bbe016c..fb994e81 100644 --- a/web/stuff/voice.php +++ b/web/stuff/voice.php @@ -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 != '') ? ''.$row['ip'] . ':' . $row['port'].'
( '.$row['dns'].' )' : ''.$row['ip'] . ':' . $row['port'].''; } $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); diff --git a/web/stuff/voice_master.php b/web/stuff/voice_master.php index 80e8a11c..8d953d72 100644 --- a/web/stuff/voice_master.php +++ b/web/stuff/voice_master.php @@ -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('
',$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) { diff --git a/web/stuff/voice_tsdns.php b/web/stuff/voice_tsdns.php index a14e6f84..652f7433 100644 --- a/web/stuff/voice_tsdns.php +++ b/web/stuff/voice_tsdns.php @@ -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')) { diff --git a/web/stuff/voice_tsdnsrecords.php b/web/stuff/voice_tsdnsrecords.php index 627d82e0..e5c05689 100644 --- a/web/stuff/voice_tsdnsrecords.php +++ b/web/stuff/voice_tsdnsrecords.php @@ -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)); diff --git a/web/stuff/voice_usage.php b/web/stuff/voice_usage.php index d0a797bc..fdfc71d8 100644 --- a/web/stuff/voice_usage.php +++ b/web/stuff/voice_usage.php @@ -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;