This commit is contained in:
Ulrich Block 2013-10-26 11:59:03 +02:00
parent b59b1d494d
commit 40805c7163
34 changed files with 285 additions and 151 deletions

View File

@ -359,7 +359,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
foreach ($query4->fetchAll(PDO::FETCH_ASSOC) as $row4) {
$query5 = $sql->prepare("DELETE FROM `voice_server_backup` WHERE `id`=? AND `uid`=? AND `resellerid`=? LIMIT 1");
$query5->execute(array($row4['id'], $ts3userid, $resellerid));
$backupfolder='backups/virtualserver_'.$localserverid.'/';
$backupfolder='backups/virtualserver_'.$localserverid . '/';
$delcmd='cd '.$folders.' && function backup () { nice -n +19 rm -f '.$backupfolder.$row4['id'].'.tar.bz2; }; backup& ';
$shell=ssh2_exec($ssh2, $delcmd);
}
@ -371,8 +371,8 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
$query4 = $sql->prepare("SELECT `id` FROM `voice_server_backup` WHERE `sid`=? AND `uid`=? AND `resellerid`=? ORDER BY `id` DESC LIMIT 1");
$query4->execute(array($ts3id, $ts3userid, $resellerid));
foreach ($query4->fetchAll(PDO::FETCH_ASSOC) as $row4) {
$filefolder='files/virtualserver_'.$localserverid.'/';
$backupfolder='backups/virtualserver_'.$localserverid.'/';
$filefolder='files/virtualserver_'.$localserverid . '/';
$backupfolder='backups/virtualserver_'.$localserverid . '/';
$createcmd='cd '.$folders.' && function backup () { mkdir -p '.$backupfolder.' && nice -n +19 tar cfj '.$backupfolder.$row4['id'].'.tar.bz2 '.$filefolder.'; }; backup& ';
$shell=ssh2_exec($ssh2, $createcmd);
print "Creating backup for ts3 server: ".$row3['ip'] . ':' . $row3['port']."\r\n";

View File

@ -631,7 +631,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
}
}
}
foreach($shellCmds as $k=>$v) {
foreach($shellCmds as $k => $v) {
ssh2_execute('gs', $k, $v);
}
}

View File

@ -70,7 +70,7 @@ if ($ui->w('action',4, 'post') and !token(true)) {
$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) {
foreach ($row as $k => $v) {
if (!in_array($k, array('id','resellerid','depending'))) {
$key = $xml->createElement($k, $v);
$element->appendChild($key);

View File

@ -428,7 +428,7 @@ if (!isset($success['false']) and array_value_exists('action','add',$data) and $
$reply="<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE voice>
<voice>";
foreach ($row as $k=>$v) {
foreach ($row as $k => $v) {
$reply .= '<'.$k.'>'.$v.'</'.$k.'>';
}
$reply.="</voice>";

View File

@ -428,11 +428,11 @@ class masterServer {
if ($this->imageserver == 'none') {
$combined = array();
foreach ($goFor['sync'] as $k=>$v) {
foreach ($goFor['sync'] as $k => $v) {
$combined[$k] = $v;
}
foreach ($goFor['nosync'] as $k=>$v) {
foreach ($goFor['nosync'] as $k => $v) {
$combined[$k] = $v;
}

View File

@ -1,4 +1,5 @@
<?php
/**
* File: class_page_settings.php.
* Author: Ulrich Block
@ -36,69 +37,102 @@
*/
class PageSettings {
public $seo='',$language,$about,$canurl,$pageurl,$title,$keywords=array(),$lastnews,$tags,$pages,$hiddenPages,$last_news=array(),$MSIE=false,$lendactive,$lendactiveGS,$lendactiveVS,$lendGS=false,$lendVS=false,$protectioncheck,$pages_array=array(),$languageLinks = array();
function __construct($user_language,$pageurl,$seo) {
public $seo='', $language, $about, $canurl, $pageurl, $title, $keywords = array(), $lastnews, $tags, $pages, $hiddenPages, $last_news = array(), $MSIE = false, $lendactive, $lendactiveGS, $lendactiveVS, $lendGS = false, $lendVS = false, $protectioncheck, $pages_array = array(), $languageLinks = array();
function __construct($user_language, $pageurl, $seo) {
$this->language = $user_language;
$this->pageurl = $pageurl;
$this->seo = $seo;
$this->canurl = $this->pageurl.'/';
$this->canurl = $this->pageurl . '/';
}
private function NameToLink ($value) {
$szrm=array('ä' => 'ae','ö' => 'oe','ü' => 'ue','Ä' => 'Ae','Ö' => 'Oe','Ü' => 'Ue','ß' => 'ss','á' => 'a','à' => 'a','Á' => 'A','À' => 'A','é' => 'e','è' => 'e','É' => 'E','È' => 'E','ó' => 'o','ò' => 'o','Ó' => 'O','Ò' => 'O','ú' => 'u','ù' => 'u','Ú' => 'U','Ù' => 'U');
return strtolower(preg_replace('/[^a-zA-Z0-9]{1}/','-',strtr($value,$szrm)));
$szrm = array('ä' => 'ae', 'ö' => 'oe', 'ü' => 'ue', 'Ä' => 'Ae', 'Ö' => 'Oe', 'Ü' => 'Ue', 'ß' => 'ss', 'á' => 'a', 'à' => 'a', 'Á' => 'A', 'À' => 'A', 'é' => 'e', 'è' => 'e', 'É' => 'E', 'È' => 'E', 'ó' => 'o', 'ò' => 'o', 'Ó' => 'O', 'Ò' => 'O', 'ú' => 'u', 'ù' => 'u', 'Ú' => 'U', 'Ù' => 'U');
return strtolower(preg_replace('/[^a-zA-Z0-9]{1}/', '-', strtr($value, $szrm)));
}
function SetData ($var,$value) {
function SetData ($var, $value) {
$this->$var = $value;
}
function AddData ($var,$value) {
function AddData ($var, $value) {
if (is_array($this->$var)) {
if (!in_array($value,$this->$var,true)) array_push($this->$var,$value);
if (!in_array($value, $this->$var, true)) {
array_push($this->$var, $value);
}
} else {
$this->$var .= ' ' . $value;
}
}
function SetCanUrl ($value) {
$this->canurl = $this->pageurl. '/' . $value;
}
private function AddPageToArray ($type,$pageid,$value) {
private function AddPageToArray ($type, $pageid, $value) {
$i = 1;
while (isset($this->pages_array[$type]) and in_array($value,$this->pages_array[$type])) {
while (isset($this->pages_array[$type]) and in_array($value, $this->pages_array[$type])) {
$i++;
$value = $value . '-' . $i;
}
$this->pages_array[$type][$pageid] = $value;
return $value;
}
function SetMenu ($linkname,$request,$subid,$id=false,$listPage=true) {
$linkname=(string)$linkname;
function SetMenu ($linkname, $request, $subid, $id = false, $listPage = true) {
$linkname = (string) $linkname;
$subdata = array();
if ($this->seo== 'Y') {
if (is_array($request)) {
$link = '';
foreach ($request as $r) $link .= '/' . $this->NameToLink($r);
foreach ($request as $r) {
$link .= '/' . $this->NameToLink($r);
}
} else if ($id == false) {
$link = '/' . $this->AddPageToArray('pages',$subid,$this->NameToLink($request));
$link = '/' . $this->AddPageToArray('pages', $subid, $this->NameToLink($request));
} else {
$link = '/' . $this->AddPageToArray('pages',$id,$this->NameToLink($request));
$link = '/' . $this->AddPageToArray('pages', $id, $this->NameToLink($request));
}
$subdata['link'] = $this->pageurl. '/' . $this->language.$link.'/';
$subdata['link'] = $this->pageurl. '/' . $this->language.$link . '/';
} else {
if (is_array($request)) {
$getparams = '';
$i = 0;
foreach ($request as $k=>$v) {
if ($v != '' and $v != null) $getparams .=($i==0) ? '?'.$k.'='.$v : '&amp;'.$k.'='.$v;
foreach ($request as $k => $v) {
if ($v != '' and $v != null) {
$getparams .= ($i == 0) ? '?' . $k . '=' . $v : '&amp;' . $k . '=' . $v;
}
$i++;
}
} else if (is_numeric($request)) {
$getparams='?site=page&amp;id='.$request;
$getparams = '?site=page&amp;id=' . $request;
} else {
$getparams='?site='.$request;
$getparams = '?site=' . $request;
}
$subdata['link'] = $this->pageurl.'/index.php'.$getparams;
$subdata['link'] = $this->pageurl . '/index.php' . $getparams;
}
$subdata['href'] = '<a href="'.$subdata['link'].'" title="'.$linkname.'">'.$linkname.'</a>';
$subdata['href'] = '<a href="' . $subdata['link'] . '" title="' . $linkname . '">' . $linkname . '</a>';
$subdata['linkname'] = $linkname;
if ($id == false and $listPage == true) {
$this->pages[$subid] = $subdata;
} else if ($listPage == true) {
@ -109,179 +143,279 @@ class PageSettings {
$this->hiddenPages[$subid][$id] = $subdata;
}
}
function SetNewsPost ($id,$title,$text,$cutOff) {
function SetNewsPost ($id, $title, $text, $cutOff) {
$this->last_news[$id]['title'] = $title;
$this->last_news[$id]['text']=(strlen($text)<=$cutOff) ? $text : substr($text,0,$cutOff).' ...';
$this->last_news[$id]['link']=($this->seo== 'Y') ? $this->pages['news']['link'].$this->NameToLink($title).'/' : $this->pages['news']['link'].'&amp;id='.$id;
$this->last_news[$id]['href'] = '<a href="'.$this->last_news[$id]['link'].'" title="'.$title.'">'.$title.'</a>';
$this->last_news[$id]['text'] = (strlen($text) <= $cutOff) ? $text : substr($text,0, $cutOff) . ' ...';
$this->last_news[$id]['link'] = ($this->seo == 'Y') ? $this->pages['news']['link'].$this->NameToLink($title) . '/' : $this->pages['news']['link'] . '&amp;id=' . $id;
$this->last_news[$id]['href'] = '<a href="' . $this->last_news[$id]['link'] . '" title="' . $title . '">' . $title . '</a>';
}
function SetLinks ($var,$linkname,$request,$id,$date=null) {
function SetLinks ($var, $linkname, $request, $id, $date = null) {
if ($this->seo== 'Y') {
if (is_array($request)) {
$link = '';
for ($i = 0;$i<(count($request)-1);$i++) $link .= '/' . $this->NameToLink($request[$i]);
$link .= '/' . $this->AddPageToArray($var,$id,$this->NameToLink($request[$i]));
for ($i = 0;$i<(count($request)-1);$i++) {
$link .= '/' . $this->NameToLink($request[$i]);
}
$link .= '/' . $this->AddPageToArray($var, $id, $this->NameToLink($request[$i]));
} else {
$link = '/' . $this->AddPageToArray($var,$id,$this->NameToLink($request));
$link = '/' . $this->AddPageToArray($var, $id, $this->NameToLink($request));
}
$subdata[$id]['link'] = $this->pageurl. '/' . $this->language.$link.'/';
$subdata[$id]['link'] = $this->pageurl. '/' . $this->language.$link . '/';
} else {
if (is_array($request)) {
$getparams = '';
$i = 0;
foreach ($request as $k=>$v) {
if ($v != '' and $v != null) $getparams .=($i==0) ? '?'.$k.'='.$v : '&amp;'.$k.'='.$v;
foreach ($request as $k => $v) {
if ($v != '' and $v != null) {
$getparams .= ($i == 0) ? '?' . $k . '=' . $v : '&amp;' . $k . '=' . $v;
}
$i++;
}
} else {
$getparams='?site='.$request;
$getparams='?site=' . $request;
}
$subdata[$id]['link'] = $this->pageurl.'/index.php'.$getparams;
$subdata[$id]['link'] = $this->pageurl . '/index.php' . $getparams;
}
$subdata[$id]['href'] = '<a href="'.$subdata[$id]['link'].'" title="'.$linkname.'">'.$linkname.'</a>';
$subdata[$id]['href'] = '<a href="' . $subdata[$id]['link'] . '" title="' . $linkname . '">' . $linkname . '</a>';
$subdata[$id]['linkname'] = $linkname;
$this->$var = $subdata;
}
function setCanonicalUrl($s=null,$ID=null) {
if ($s==null) {
function setCanonicalUrl($s = null, $ID = null) {
if ($s == null) {
$this->canurl = $this->pageurl;
} else {
global $sql,$gsprache,$page_sprache;
global $sql, $gsprache, $page_sprache;
if ($this->seo== 'Y' and $ID != null and ($s == 'news' or $s == 'page')) {
$query = $sql->prepare("SELECT `title` FROM `page_pages_text` WHERE `id`=? LIMIT 1");
$query->execute(array($ID));
$title = $query->fetchColumn();
$addToUrl=($s == 'news') ? '/' . $this->language. '/' . $this->NameToLink($gsprache->news). '/' . $this->NameToLink($title).'/' : '/' . $this->language. '/' . $this->NameToLink($title).'/';
} else if ($this->seo== 'Y' and in_array($s, array('imprint','lendserver','news'))) {
$addToUrl='/' . $this->language. '/' . $this->NameToLink($gsprache->$s).'/';
$addToUrl = ($s == 'news') ? '/' . $this->language. '/' . $this->NameToLink($gsprache->news). '/' . $this->NameToLink($title) . '/' : '/' . $this->language. '/' . $this->NameToLink($title) . '/';
} else if ($this->seo== 'Y' and in_array($s, array('imprint', 'lendserver', 'news'))) {
$addToUrl = '/' . $this->language. '/' . $this->NameToLink($gsprache->$s) . '/';
} else if ($this->seo== 'Y') {
$addToUrl='/' . $this->language. '/' . $this->NameToLink($page_sprache->$s).'/';
$addToUrl = '/' . $this->language. '/' . $this->NameToLink($page_sprache->$s) . '/';
} else if ($ID != null) {
$addToUrl='?s='.$s.'&amp;id='.$ID;
$addToUrl = '?s=' . $s . '&amp;id=' . $ID;
} else {
$addToUrl='?s='.$s;
$addToUrl = '?s=' . $s;
}
$this->canurl = $this->pageurl.$addToUrl;
}
}
public function showLend ($admin,$user,$type) {
public function showLend ($admin, $user, $type) {
global $sql;
if ($type == 'g') {
$query = $sql->prepare("SELECT COUNT(`id`) AS `amount` FROM `gsswitch` WHERE `resellerid`=0 AND `active`='Y' AND `lendserver`='Y' LIMIT 1");
$query->execute();
$count = $query->fetchColumn();
if ($count>0 and ($this->lendactiveGS== 'B' or ($admin === true and $this->lendactiveGS!='N') or ($user === true and $this->lendactiveGS== 'R') or ($user === false and $this->lendactiveGS== 'A'))) {
if ($count > 0 and ($this->lendactiveGS == 'B' or ($admin === true and $this->lendactiveGS != 'N') or ($user === true and $this->lendactiveGS == 'R') or ($user === false and $this->lendactiveGS== 'A'))) {
$this->lendGS = true;
return true;
} else if ($count>0) {
} else if ($count > 0) {
$this->lendGS = null;
return null;
}
} else {
$query = $sql->prepare("SELECT COUNT(`id`) AS `amount` FROM `voice_server` WHERE `resellerid`=0 AND `active`='Y' AND `lendserver`='Y' LIMIT 1");
$query->execute();
$count = $query->fetchColumn();
if ($count>0 and ($this->lendactiveVS== 'B' or ($admin === true and $this->lendactiveVS!='N') or ($user === true and $this->lendactiveVS== 'R') or ($user === false and $this->lendactiveVS== 'A'))) {
if ($count > 0 and ($this->lendactiveVS== 'B' or ($admin === true and $this->lendactiveVS!='N') or ($user === true and $this->lendactiveVS == 'R') or ($user === false and $this->lendactiveVS == 'A'))) {
$this->lendVS = true;
return true;
} else if ($count>0) {
} else if ($count > 0) {
$this->lendVS = null;
return null;
}
}
return false;
}
// https://github.com/easy-wi/developer/issues/62
public function langLinks ($links=array()) {
public function langLinks ($links = array()) {
global $languages;
foreach ($languages as $l) {
if ($this->seo== 'Y') {
$this->languageLinks[$l]=(isset($links[$l])) ? $this->pageurl. '/' . $l. '/' . $links[$l].'/' : $this->pageurl. '/' . $l.'/';
if ($this->seo == 'Y') {
$this->languageLinks[$l]=(isset($links[$l])) ? $this->pageurl. '/' . $l. '/' . $links[$l] . '/' : $this->pageurl. '/' . $l . '/';
} else {
$this->languageLinks[$l]=(isset($links[$l])) ? $this->pageurl.'/index.php'.$links[$l].'&amp;l='.$l : $this->pageurl.'/index.php?l='.$l;
$this->languageLinks[$l]=(isset($links[$l])) ? $this->pageurl . '/index.php' . $links[$l] . '&amp;l=' . $l : $this->pageurl . '/index.php?l=' . $l;
}
}
}
public function getLangLinks () {
if (count($this->languageLinks)==0) {
$this->langLinks();
}
return $this->languageLinks;
}
function __destruct() {
unset($this->seo,$this->language,$this->about,$this->canurl,$this->pageurl,$this->title,$this->keywords,$this->lastnews,$this->tags,$this->pages,$this->hiddenPages,$this->last_news,$this->MSIE);
unset($this->seo, $this->language, $this->about, $this->canurl, $this->pageurl, $this->title, $this->keywords, $this->lastnews, $this->tags, $this->pages, $this->hiddenPages, $this->last_news, $this->MSIE);
}
}
function checkForSpam ($checkURL=null) {
global $ui,$blockLinks,$languageFilter,$page_data,$user_language,$textID,$blockWords,$honeyPotKey,$tornevall,$sql;
function checkForSpam ($checkURL = null) {
global $ui, $blockLinks, $languageFilter, $page_data, $user_language, $textID, $blockWords, $honeyPotKey, $tornevall, $sql;
$spamReason = array();
$ips = array();
// Check if IP exists at DB as a spammer
if ($checkURL==null) {
if ($checkURL == null) {
$hostByIp = '';
if ($ui->ip4('REMOTE_ADDR', 'server')) {
$hostByIp=gethostbyaddr($ui->ip4('REMOTE_ADDR', 'server'));
$hostByIp = gethostbyaddr($ui->ip4('REMOTE_ADDR', 'server'));
$ips[] = $hostByIp;
}
$query = $sql->prepare("SELECT COUNT(`commentID`) AS `amount` FROM `page_comments` WHERE `markedSpam`='Y' AND (`ip`=? OR `dns`=?) AND `resellerid`=0 LIMIT 1");
$query->execute(array($ui->ip('REMOTE_ADDR', 'server'),$hostByIp));
if ($query->fetchColumn()>0) $spamReason[] = 'IP or Host already known for spam';
$query->execute(array($ui->ip('REMOTE_ADDR', 'server'), $hostByIp));
if ($query->fetchColumn()>0) {
$spamReason[] = 'IP or Host already known for spam';
}
} else {
$check=str_replace(array('https://','http://','ftps://','ftp://'),'',$checkURL);
$ips=gethostbynamel($check);
$check = str_replace(array('https://', 'http://', 'ftps://', 'ftp://'), '', $checkURL);
$ips = gethostbynamel($check);
foreach($ips as $ip) {
$query = $sql->prepare("SELECT COUNT(`commentID`) AS `amount` FROM `page_comments` WHERE `markedSpam`='Y' AND `ip`=? AND `resellerid`=0 LIMIT 1");
$query->execute(array($ip));
if ($query->fetchColumn()>0 and !in_array('IP or Host already known for spam',$spamReason)) $spamReason[] = 'IP or Host already known for spam';
if ($query->fetchColumn() > 0 and !in_array('IP or Host already known for spam', $spamReason)) {
$spamReason[] = 'IP or Host already known for spam';
}
}
}
// reverse DNS does not add up
if ($checkURL==null and count($spamReason)==0 and $ui->ip4('REMOTE_ADDR', 'server') and !in_array($ui->ip4('REMOTE_ADDR', 'server'),gethostbynamel($ips))) $spamReason[] = 'Fake IP';
if ($checkURL == null and count($spamReason) == 0 and $ui->ip4('REMOTE_ADDR', 'server') and !in_array($ui->ip4('REMOTE_ADDR', 'server'), gethostbynamel($ips))) {
$spamReason[] = 'Fake IP';
}
// hidden fields have been filled
if ($checkURL==null and count($spamReason)==0 and strlen($ui->escaped('mail', 'post'))>0) $spamReason[] = 'XSS: Hidden field';
if ($checkURL == null and count($spamReason) == 0 and strlen($ui->escaped('mail', 'post')) > 0) {
$spamReason[] = 'XSS: Hidden field';
}
// CSFR token does not add up
if ($checkURL==null and count($spamReason)==0 and (!isset($_SESSION['news'][$textID]) or $_SESSION['news'][$textID] != $ui->escaped('token', 'post'))) $spamReason[] = 'XSS: Token';
if ($checkURL == null and count($spamReason) == 0 and (!isset($_SESSION['news'][$textID]) or $_SESSION['news'][$textID] != $ui->escaped('token', 'post'))) {
$spamReason[] = 'XSS: Token';
}
// Links not allowed in comments
if ($checkURL==null and count($spamReason)==0 and $blockLinks == 'Y') {
foreach (array('http://','https://','ftp://','ftps://') as $key) if (strpos($ui->escaped('comment', 'post'),$key) !== false and (!in_array('URL Spam',$spamReason))) $spamReason[] = 'URL Spam';
if ($checkURL == null and count($spamReason) == 0 and $blockLinks == 'Y') {
foreach (array('http://', 'https://', 'ftp://', 'ftps://') as $key) if (strpos($ui->escaped('comment', 'post'), $key) !== false and (!in_array('URL Spam', $spamReason))) {
$spamReason[] = 'URL Spam';
}
}
// Post contains blacklisted words
if ($checkURL==null and count($spamReason)==0) {
foreach (explode(',',$blockWords) as $word) {
if (strlen(trim($word))>0 and strpos($ui->escaped('comment', 'post'),trim($word)) !== false and !in_array('Word Blacklist',$spamReason)) $spamReason[] = 'Word Blacklist';
if ($checkURL == null and count($spamReason) == 0) {
foreach (explode(', ', $blockWords) as $word) {
if (strlen(trim($word))>0 and strpos($ui->escaped('comment', 'post'),trim($word)) !== false and !in_array('Word Blacklist', $spamReason)) {
$spamReason[] = 'Word Blacklist';
}
}
}
// use google translation REST API for language detection. If the current page contains a different language we likely have a spammer
if ($checkURL==null and count($spamReason)==0 and $languageFilter== 'Y') {
$raw=webhostRequest('translate.google.com',$page_data->pageurl,'/translate_a/t?client=x&text='.urlencode(htmlentities(substr($ui->escaped('comment', 'post'),0,200))));
$json=json_decode($raw);
if ($json and isset($json->src) and $json->src != $user_language) $spamReason[] = 'Language';
if ($checkURL == null and count($spamReason) == 0 and $languageFilter == 'Y') {
$raw = webhostRequest('translate.google.com', $page_data->pageurl, '/translate_a/t?client=x&text=' . urlencode(htmlentities(substr($ui->escaped('comment', 'post'), 0, 200))));
$json = json_decode($raw);
if ($json and isset($json->src) and $json->src != $user_language) {
$spamReason[] = 'Language';
}
}
// check if the remote address (IP) is known for spamming at the tornevall.org list
if (count($spamReason)==0 and ($checkURL != null or $ui->ip4('REMOTE_ADDR', 'server')) and (($honeyPotKey != null and $honeyPotKey != '') or $tornevall== 'Y')) {
if ($checkURL != null) $ips=array($ui->ip4('REMOTE_ADDR', 'server'));
if (count($spamReason) == 0 and ($checkURL != null or $ui->ip4('REMOTE_ADDR', 'server')) and (($honeyPotKey != null and $honeyPotKey != '') or $tornevall == 'Y')) {
if ($checkURL != null) {
$ips = array($ui->ip4('REMOTE_ADDR', 'server'));
}
foreach ($ips as $ip) {
$ipRevers=implode('.', array_reverse(explode('.',$ip)));
if (count($spamReason)==0 and $tornevall== 'Y' and (bool)checkdnsrr($ipRevers.'.opm.tornevall.org.','A')) $spamReason[] = 'IP is listed at dnsbl.tornevall.org';
if (count($spamReason)==0 and $honeyPotKey != null and $honeyPotKey != '') {
$ex=explode('.',gethostbyname($honeyPotKey . '.' . $ipRevers.'.dnsbl.httpbl.org'));
if ($ex[0]==127){
$types=array(1=>'Suspicious',2=>'Harvester',3=>'Suspicious & Harvester',4=>'Comment Spammer',5=>'Suspicious & Comment Spammer',6=>'Harvester & Comment Spammer',7=>'Suspicious & Harvester & Comment Spammer');
if ($ex[3] != 0) $spamReason[] = 'IP seems to be a '.$types[$ex[3]].'. It was last seen '.$ex[1].' day(s) ago and has a threat score of '.$ex[2];
$ipRevers = implode('.', array_reverse(explode('.', $ip)));
if (count($spamReason) == 0 and $tornevall== 'Y' and (bool)checkdnsrr($ipRevers . '.opm.tornevall.org.', 'A')) {
$spamReason[] = 'IP is listed at dnsbl.tornevall.org';
}
if (count($spamReason) == 0 and $honeyPotKey != null and $honeyPotKey != '') {
$ex = explode('.', gethostbyname($honeyPotKey . '.' . $ipRevers . '.dnsbl.httpbl.org'));
if ($ex[0] == 127){
$types = array(
1 => 'Suspicious',
2 => 'Harvester',
3 => 'Suspicious & Harvester',
4 => 'Comment Spammer',
5 => 'Suspicious & Comment Spammer',
6=>'Harvester & Comment Spammer',
7=>'Suspicious & Harvester & Comment Spammer'
);
if ($ex[3] != 0) {
$spamReason[] = 'IP seems to be a ' . $types[$ex[3]] . '. It was last seen ' . $ex[1] . ' day(s) ago and has a threat score of ' . $ex[2];
}
}
}
}
}
return $spamReason;
}

View File

@ -252,7 +252,7 @@ class rootServer {
}
public function dhcpFiles () {
$removeArray = array();
foreach ($this->dhcpData as $k=>$v) {
foreach ($this->dhcpData as $k => $v) {
$i = 0;
unset($tempBad);
if ($v['publickey']=="Y") {
@ -316,7 +316,7 @@ class rootServer {
return $removeArray;
}
public function PXEFiles() {
foreach($this->PXEData as $k=>$v) {
foreach($this->PXEData as $k => $v) {
if ($v['publickey']=="Y") {
# https://github.com/easy-wi/developer/issues/70

View File

@ -401,7 +401,7 @@ class TS3 {
public function ServerList () {
$serverdetails = array();
$array = $this->SendCommand('serverlist');
if (is_array($array) or is_object($array)) foreach ($array as $k=>$v) $serverdetails[$k] = $this->ReplaceFromTS3($v);
if (is_array($array) or is_object($array)) foreach ($array as $k => $v) $serverdetails[$k] = $this->ReplaceFromTS3($v);
if ($this->debug == true){
print "ServerList:";
print_r($serverdetails);
@ -660,7 +660,7 @@ function tsbackup ($action, $sship, $sshport, $sshuser, $keyuse, $sshkey, $sshpw
if (substr($path,0,1) == '/') {
$folders='/';
} else {
$folders='/home/'.$sshuser.'/';
$folders='/home/'.$sshuser . '/';
}
while ($i<=$folderfilecount) {
$folders .= $split_config[$i] . '/';
@ -669,9 +669,9 @@ function tsbackup ($action, $sship, $sshport, $sshuser, $keyuse, $sshkey, $sshpw
if ($folders == '') {
$folders='.';
}
if (substr($folders,-1) != '/') $folders = $folders.'/';
$filefolder = $folders.'files/virtualserver_'.$virtualserver_id.'/';
$backupfolder = $folders.'backups/virtualserver_'.$virtualserver_id.'/';
if (substr($folders,-1) != '/') $folders = $folders . '/';
$filefolder = $folders.'files/virtualserver_'.$virtualserver_id . '/';
$backupfolder = $folders.'backups/virtualserver_'.$virtualserver_id . '/';
if ($action == 'create') {
$function='function backup () { mkdir -p '.$backupfolder.' && nice -n +19 tar cfj '.$backupfolder.$backupid.'.tar.bz2 '.$filefolder.'; }';
} else if ($action == 'delete') {

View File

@ -1619,7 +1619,7 @@ if (!function_exists('passwordgenerate')) {
if ($json and isset($json->v)) {
$licencecode = array();
foreach($json as $k=>$v) {
foreach($json as $k => $v) {
$licencecode[$k] = $v;
}
@ -1697,7 +1697,7 @@ if (!function_exists('passwordgenerate')) {
unset($_SESSION[$w]);
}
foreach ($_SESSION as $k=>$v) {
foreach ($_SESSION as $k => $v) {
if (wpreg_check($k, 4) and ((isset($_SESSION[$k]['t']) and $_SESSION[$k]['d'] < strtotime('now')) or (is_array($_SESSION[$k]) and count($_SESSION[$k]) == 0))) {
unset($_SESSION[$k]);

View File

@ -145,7 +145,7 @@ if ($ui->st('d', 'get') == 'pw') {
#https://github.com/easy-wi/developer/issues/5
$oldValues = array();
foreach ($row as $k=>$v) $oldValues[$k] = $v;
foreach ($row as $k => $v) $oldValues[$k] = $v;
}
if ($ui->smallletters('action',2, 'post') == 'md' and isset($oldValues)){
if ($ui->ismail('mail', 'post') and token(true)) {
@ -174,7 +174,7 @@ if ($ui->st('d', 'get') == 'pw') {
if ($query->rowCount()>0) {
#https://github.com/easy-wi/developer/issues/5
$changed = array();
foreach ($oldValues as $k=>$v) if (isset($$k) and "{$$k}" != $v) $changed[$k] = $v;
foreach ($oldValues as $k => $v) if (isset($$k) and "{$$k}" != $v) $changed[$k] = $v;
$query = $sql->prepare("INSERT INTO `userdata_value_log` (`userID`,`date`,`json`,`resellerID`) VALUES (?,NOW(),?,?)");
$query->execute(array($lookUpID,json_encode($changed),$reseller_id));

View File

@ -68,7 +68,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$query->execute(array($ui->id('id', 10, 'get'), $reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$shorten = $row['shorten'];
foreach ($row as $k=>$v) {
foreach ($row as $k => $v) {
if (!in_array($k, array('id', 'resellerid', 'steamVersion'))) {
$key = $xml->createElement($k, $v);
$element->appendChild($key);

View File

@ -237,7 +237,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$games[$ex[0]] = $ex[1];
}
}
foreach ($games as $k=>$v) {
foreach ($games as $k => $v) {
if (!in_array($k, array('steamcmd','sync'))) {
$query2->execute(array($k,$reseller_id,$ip));
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) {

View File

@ -195,7 +195,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
if ($seo== 'N') {
$link = $page_url.'/index.php?site=news&amp;id='.$row['pageid'];
} else {
$link = $page_url. '/' . $row['language'] . '/' . szrp($titleLanguages[$row['language']]['general']->news) . '/' . szrp($row['title']).'/';
$link = $page_url. '/' . $row['language'] . '/' . szrp($titleLanguages[$row['language']]['general']->news) . '/' . szrp($row['title']) . '/';
}
$table[] = array('pageid' => $row['pageid'], 'title' => htmlentities($row['title']),'comment' => htmlentities($row['comment']),'commentID' => $row['commentID'], 'date' => date($commentDate,strtotime($row['date'])),'authorname' => htmlentities($row['authorname']),'moderated' => $moderated,'spam' => $spam,'spamReason' => $row['spamReason'], 'link' => $link);
}

View File

@ -66,11 +66,11 @@ if ((isset($page_name) and $page_name!=szrp($page_sprache->older) and isset($pag
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) {
$page_data->AddData('keywords', $row2['name']);
if ($seo== 'Y' and $row2['type'] == 'tag') {
$tagLink = $page_url. '/' . $user_language . '/' . szrp($page_sprache->tag) . '/' . szrp($row2['name']).'/';
$tagLink = $page_url. '/' . $user_language . '/' . szrp($page_sprache->tag) . '/' . szrp($row2['name']) . '/';
} else if ($row2['type'] == 'tag') {
$tagLink = $page_url.'/index.php?site=tag&amp;tag='.szrp($row2['name']);
} else if ($seo== 'Y' and $row2['type'] == 'category') {
$categoryLink = $page_url. '/' . $user_language . '/' . szrp($page_sprache->categories) . '/' . szrp($row2['name']).'/';
$categoryLink = $page_url. '/' . $user_language . '/' . szrp($page_sprache->categories) . '/' . szrp($row2['name']) . '/';
} else if ($row2['type'] == 'category') {
$categoryLink = $page_url.'/index.php?site=categories&amp;tag='.szrp($row2['name']);
}
@ -240,7 +240,7 @@ if ((isset($page_name) and $page_name!=szrp($page_sprache->older) and isset($pag
$page_title = $row['title'];
$page_text=nl2br($row['text']);
if ($seo== 'Y') {
$link = $page_url. '/' . $user_language . '/' . szrp($gsprache->news) . '/' . szrp($row['title']).'/';
$link = $page_url. '/' . $user_language . '/' . szrp($gsprache->news) . '/' . szrp($row['title']) . '/';
} else {
$link = $page_url.'/index.php?site=news&amp;id='.$row['id'];
}
@ -249,11 +249,11 @@ if ((isset($page_name) and $page_name!=szrp($page_sprache->older) and isset($pag
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) {
$page_data->AddData('keywords', $row2['name']);
if ($seo== 'Y' and $row2['type'] == 'tag') {
$tagLink = $page_url. '/' . $user_language . '/' . szrp($page_sprache->tag) . '/' . szrp($row2['name']).'/';
$tagLink = $page_url. '/' . $user_language . '/' . szrp($page_sprache->tag) . '/' . szrp($row2['name']) . '/';
} else if ($row2['type'] == 'tag') {
$tagLink = $page_url.'/index.php?site=tag&amp;tag='.szrp($row2['name']);
} else if ($seo== 'Y' and $row2['type'] == 'category') {
$categoryLink = $page_url. '/' . $user_language . '/' . szrp($page_sprache->categories) . '/' . szrp($row2['name']).'/';
$categoryLink = $page_url. '/' . $user_language . '/' . szrp($page_sprache->categories) . '/' . szrp($row2['name']) . '/';
} else if ($row2['type'] == 'category') {
$categoryLink = $page_url.'/index.php?site=categories&amp;tag='.szrp($row2['name']);
}
@ -280,7 +280,7 @@ if ((isset($page_name) and $page_name!=szrp($page_sprache->older) and isset($pag
$news[] = array('date' => $date,'title' => $page_title,'text' => $page_text,'href' => $href,'link' => $link,'tags' => $tag_tags,'categories' => $category_tags,'comments' => $row['comments'], 'commentCount' => $commentCount,'authorname' => $row['authorname']);
}
if ($seo== 'Y') {
$paginationLink = $page_url. '/' . $user_language . '/' . szrp($gsprache->news) . '/' . szrp($page_sprache->older).'/';
$paginationLink = $page_url. '/' . $user_language . '/' . szrp($gsprache->news) . '/' . szrp($page_sprache->older) . '/';
} else {
$paginationLink = $page_url.'/index.php?site=news&amp;start=';
}

View File

@ -465,9 +465,9 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$link = $page_url.'/index.php?site=page&amp;id='.$row['id'];
} else {
if ($row['language'] == $user_language) {
$link = $page_url. '/' . $user_language . '/' . szrp($titleLanguages[$row['language']]['general']->news) . '/' . strtolower(szrp($row['title'])).'/';
$link = $page_url. '/' . $user_language . '/' . szrp($titleLanguages[$row['language']]['general']->news) . '/' . strtolower(szrp($row['title'])) . '/';
} else {
$link = $page_url. '/' . $row['language'] . '/' . szrp($titleLanguages[$row['language']]['general']->news) . '/' . strtolower(szrp($row['title'])).'/';
$link = $page_url. '/' . $row['language'] . '/' . szrp($titleLanguages[$row['language']]['general']->news) . '/' . strtolower(szrp($row['title'])) . '/';
}
}
$explodedtime=explode(' ', $row['date']);

View File

@ -132,20 +132,20 @@ if (isset($page_id) and is_numeric($page_id)) {
$title = $row['title'];
if ($row['type'] == 'news' and isset($seo) and $seo== 'Y') {
$type=(string)$titleLanguages[$row['language']]['general']->news;
$link = $page_data->pageurl. '/' . $row['language'] . '/' . szrp($titleLanguages[$row['language']]['general']->news) . '/' . szrp($row['title']).'/';
$link = $page_data->pageurl. '/' . $row['language'] . '/' . szrp($titleLanguages[$row['language']]['general']->news) . '/' . szrp($row['title']) . '/';
} else if ($row['type'] == 'news') {
$type=(string)$titleLanguages[$row['language']]['general']->news;
$link = $page_data->pageurl.'?s=news&amp;l='.$row['language'].'&amp;id='.$row['pageID'];
} else if ($row['type'] == 'page' and isset($seo) and $seo== 'Y') {
$type=(string)$titleLanguages[$row['language']]['general']->page;
$link = $page_data->pageurl. '/' . $row['language'] . '/' . szrp($row['title']).'/';
$link = $page_data->pageurl. '/' . $row['language'] . '/' . szrp($row['title']) . '/';
} else if ($row['type'] == 'page') {
$type=(string)$titleLanguages[$row['language']]['general']->page;
$link = $page_data->pageurl.'?s=page&amp;l='.$row['language'].'&amp;id='.$row['pageID'];
} else if ($row['type'] == 'about' and isset($seo) and $seo== 'Y') {
$type=(string)$titleLanguages[$row['language']]['page']->about;
$title=(string)$titleLanguages[$row['language']]['page']->about;
$link = $page_data->pageurl. '/' . $row['language'] . '/' . szrp($titleLanguages[$row['language']]['page']->about).'/';
$link = $page_data->pageurl. '/' . $row['language'] . '/' . szrp($titleLanguages[$row['language']]['page']->about) . '/';
} else if ($row['type'] == 'about') {
$type=(string)$titleLanguages[$row['language']]['page']->about;
$title=(string)$titleLanguages[$row['language']]['page']->about;
@ -187,7 +187,7 @@ if (isset($page_id) and is_numeric($page_id)) {
}
}
$resultsArray = array();
foreach ($results as $k=>$v) {
foreach ($results as $k => $v) {
unset($results[$k]);
$resultsArray[$v['worth']][$v['textID']] = $v;
}
@ -195,7 +195,7 @@ if (isset($page_id) and is_numeric($page_id)) {
$results = array();
$exists = array();
foreach ($resultsArray as $key=>$val) {
foreach ($val as $k=>$v) {
foreach ($val as $k => $v) {
if (!in_array($key,$exists)) {
unset($resultsArray[$key][$k]);
$results[] = $v;

View File

@ -445,9 +445,9 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$link = $page_url.'/index.php?site=page&amp;id='.$row['id'];
} else {
if ($row['language'] == $user_language) {
$link = $page_url. '/' . $user_language . '/' . strtolower(szrp($row['title'])).'/';
$link = $page_url. '/' . $user_language . '/' . strtolower(szrp($row['title'])) . '/';
} else {
$link = $page_url. '/' . $row['language'] . '/' . strtolower(szrp($row['title'])).'/';
$link = $page_url. '/' . $row['language'] . '/' . strtolower(szrp($row['title'])) . '/';
}
}
$explodedtime=explode(' ', $row['date']);

View File

@ -40,7 +40,7 @@ if ($seo== 'Y') {
if (!isset($page_count)) {
$page_count = 1;
}
$current_page_link='/' . $user_language . '/' . szrp($page_sprache->$s). '/' . $page_name. '/' . $page_count.'/';
$current_page_link='/' . $user_language . '/' . szrp($page_sprache->$s). '/' . $page_name. '/' . $page_count . '/';
} else {
$search_tag=strtolower($ui->username('tag','255', 'get'));
if ($ui->id('older','30', 'get')) {
@ -75,7 +75,7 @@ if (isset($search_tag) and $search_tag != '' and $search_tag != null) {
$limit=($maxnews*$page_count)-$maxnews.','.($maxnews*$page_count);
}
if ($max_old>$page_count and $seo== 'Y') {
$older = $page_url. '/' . $user_language. '/' . $page_sprache->$s. '/' . $search_tag . '/' . ($page_count+1).'/';
$older = $page_url. '/' . $user_language. '/' . $page_sprache->$s. '/' . $search_tag . '/' . ($page_count+1) . '/';
} else if ($max_old>$page_count and $seo== 'N') {
$older = $page_url.'/index.php?site='.$s.'&amp;tag='.strtolower(szrp($row2['name'])).'&amp;older='.($page_count+1);
}
@ -87,7 +87,7 @@ if (isset($search_tag) and $search_tag != '' and $search_tag != null) {
}
}
if (isset($page_count) and $page_count>1 and $seo== 'Y') {
$newer = $page_url. '/' . $user_language. '/' . $page_sprache->$s. '/' . $search_tag . '/' . ($page_count-1).'/';
$newer = $page_url. '/' . $user_language. '/' . $page_sprache->$s. '/' . $search_tag . '/' . ($page_count-1) . '/';
} else if (isset($page_count) and $page_count>1 and $seo== 'N') {
$newer = $page_url.'/index.php?site='.$s.'&amp;tag='.strtolower(szrp($row2['name'])).'&amp;older='.($page_count-1);
}
@ -96,8 +96,8 @@ if (isset($search_tag) and $search_tag != '' and $search_tag != null) {
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
if ($seo== 'Y') {
$type = '';
if ($row['type'] == 'news') $type=szrp($gsprache->news).'/';
$row_link = $page_url. '/' . $user_language. '/' . $type.szrp($row['title']).'/';
if ($row['type'] == 'news') $type=szrp($gsprache->news) . '/';
$row_link = $page_url. '/' . $user_language. '/' . $type.szrp($row['title']) . '/';
} else {
$row_link = $page_url.'/index.php?site='.$row['type'].'&amp;id='.$row['id'];
}

View File

@ -157,7 +157,7 @@ if (isset($reseller_id)) {
$query = $sql->prepare("SELECT * FROM `settings` WHERE `resellerid`=? LIMIT 1");
$query->execute(array($reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
foreach ($row as $k=>$v) {
foreach ($row as $k => $v) {
$rSA[$k] = $v;
}
}
@ -190,7 +190,7 @@ if (isset($reseller_id)) {
$query = $sql->prepare("SELECT * FROM `settings` WHERE `resellerid`=0 LIMIT 1");
$query->execute();
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
foreach ($row as $k=>$v) {
foreach ($row as $k => $v) {
$rSA[$k] = $v;
}
}

View File

@ -472,7 +472,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
}
$temp .= ')';
if ($i != 0) $where .= $temp;
foreach ($ticketLinks as $k=>$v) {
foreach ($ticketLinks as $k => $v) {
foreach (array('A','C','D','N','P','R') as $s) {
if ((in_array($s,$selected) and $k != $s) or (!in_array($s,$selected) and $k==$s)) $ticketLinks[$k] .= '&amp;ts[] = '.$s;
}

View File

@ -241,7 +241,7 @@ if ($ui->st('d', 'get') == 'ad') {
}
$temp .= ')';
if ($i != 0) $where .= $temp;
foreach ($ticketLinks as $k=>$v) {
foreach ($ticketLinks as $k => $v) {
foreach (array('A','C','D','N','P','R') as $s) {
if ((in_array($s,$selected) and $k != $s) or (!in_array($s,$selected) and $k==$s)) $ticketLinks[$k] .= '&amp;ts[] = '.$s;
}

View File

@ -735,7 +735,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
} else {
$selected=array('Y','N','R');
}
foreach ($ticketLinks as $k=>$v) {
foreach ($ticketLinks as $k => $v) {
foreach (array('Y','N','R') as $s) {
if ((in_array($s,$selected) and $k != $s) or (!in_array($s,$selected) and $k==$s)) $ticketLinks[$k] .= '&amp;state[] = '.$s;
}

View File

@ -46,7 +46,7 @@ if ((!isset($user_id) or $main != 1) or (isset($user_id) and !$pa['useraddons'])
$sprache = getlanguagefile('images',$user_language,$reseller_id);
$loguserid = $user_id;
$logusername=getusername($user_id);
$logusername = getusername($user_id);
$logusertype = 'user';
$logreseller = 0;

View File

@ -46,7 +46,7 @@ include(EASYWIDIR . '/stuff/keyphrasefile.php');
$sprache = getlanguagefile('reseller',$user_language,$reseller_id);
$loguserid = $user_id;
$logusername=getusername($user_id);
$logusername = getusername($user_id);
$logusertype = 'user';
$logreseller = 0;
$logsubuser = 0;

View File

@ -44,7 +44,7 @@ include(EASYWIDIR . '/stuff/ssh_exec.php');
$sprache = getlanguagefile('gserver',$user_language,$reseller_id);
$loguserid = $user_id;
$logusername=getusername($user_id);
$logusername = getusername($user_id);
$logusertype = 'user';
$logreseller = 0;
if (isset($admin_id)) {

View File

@ -46,7 +46,7 @@ include(EASYWIDIR . '/stuff/keyphrasefile.php');
$sprache = getlanguagefile('gserver',$user_language,$reseller_id);
$loguserid = $user_id;
$logusername=getusername($user_id);
$logusername = getusername($user_id);
$logusertype = 'user';
$logreseller = 0;
$logsubuser = 0;
@ -95,7 +95,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
function checkFolders ($dir,$searchFor,$maxDepth=false,$currentDepth=0) {
global $ftp;
$donotsearch=array('bin','cfg','cl_dlls','dlls','gfx','hl2','manual','maps','materials','models','particles','recource','scenes','scripts','sound','sounds','textures','valve','reslists');
if ($dir!='/') $dir = $dir.'/';
if ($dir!='/') $dir = $dir . '/';
$spl=strlen($searchFor)*(-1);
$rawList=@ftp_rawlist($ftp,$dir);
if ($rawList) {

View File

@ -43,7 +43,7 @@ include(EASYWIDIR . '/stuff/keyphrasefile.php');
$sprache = getlanguagefile('mysql',$user_language,$reseller_id);
$loguserid = $user_id;
$logusername=getusername($user_id);
$logusername = getusername($user_id);
$logusertype = 'user';
$logreseller = 0;
if (isset($admin_id)) {

View File

@ -43,7 +43,7 @@ include(EASYWIDIR . '/stuff/keyphrasefile.php');
$sprache = getlanguagefile('gserver',$user_language,$reseller_id);
$loguserid = $user_id;
$logusername=getusername($user_id);
$logusername = getusername($user_id);
$logusertype = 'user';
$logreseller = 0;
if (isset($admin_id)) {

View File

@ -40,7 +40,7 @@ if ((!isset($user_id) or $main!=1) or (isset($user_id) and !$pa['usertickets']))
}
$sprache = getlanguagefile('tickets',$user_language,$reseller_id);
$loguserid = $user_id;
$logusername=getusername($user_id);
$logusername = getusername($user_id);
$logusertype = 'admin';
$logreseller = 0;
$logsubuser = 0;
@ -235,7 +235,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
}
$temp .= ')';
if ($i != 0) $where .= $temp;
foreach ($ticketLinks as $k=>$v) {
foreach ($ticketLinks as $k => $v) {
foreach (array('A','C','D','N','P','R') as $s) {
if ((in_array($s,$selected) and $k != $s) or (!in_array($s,$selected) and $k==$s)) $ticketLinks[$k] .= '&amp;ts[] = '.$s;
}

View File

@ -47,7 +47,7 @@ include(EASYWIDIR . '/stuff/keyphrasefile.php');
$sprache = getlanguagefile('reseller',$user_language,$reseller_id);
$loguserid = $user_id;
$logusername=getusername($user_id);
$logusername = getusername($user_id);
$logusertype = 'user';
$logreseller = 0;
$logsubuser = 0;

View File

@ -41,7 +41,7 @@ if ((!isset($user_id) or $main != 1) or (isset($user_id) and !$pa['voiceserver']
}
$sprache = getlanguagefile('voice', $user_language, $reseller_id);
$loguserid = $user_id;
$logusername=getusername($user_id);
$logusername = getusername($user_id);
$logusertype='user';
$logreseller = 0;
if (isset($admin_id)) {
@ -172,7 +172,7 @@ if ($ui->st('d', 'get') == 'bu' and $ui->id('id', 10, 'get') and (!isset($_SESSI
$move = array();
$channelListOld=@json_decode($row['channels']);
$channelListDeployed=@json_decode($connection->channelList($volocalserverid));
if (is_object($channelListDeployed) and is_object($channelListOld)) foreach ($channelListOld as $k=>$v) if (isset($channelListDeployed->$k)) $move[$v] = $channelListDeployed->$k;
if (is_object($channelListDeployed) and is_object($channelListOld)) foreach ($channelListOld as $k => $v) if (isset($channelListDeployed->$k)) $move[$v] = $channelListDeployed->$k;
tsbackup('deploy', $queryip, $ssh2port, $ssh2user, $publickey, $keyname, $ssh2password, $notified, $serverdir, $volocalserverid, $ui->id('id',10, 'post'), $reseller_id, $sql, $move);
$query = $sql->prepare("SELECT CONCAT(`ip`,':',`port`) AS `address` FROM `voice_server` WHERE `id`=? AND `userid`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($row['sid'], $user_id, $reseller_id));
@ -643,9 +643,9 @@ if ($ui->st('d', 'get') == 'bu' and $ui->id('id', 10, 'get') and (!isset($_SESSI
}
$flexSlots = '';
if ($row['flexSlots'] == 'Y' and $row['flexSlotsCurrent'] == null) {
$flexSlots = $row['slots'].'/';
$flexSlots = $row['slots'] . '/';
} else if ($row['flexSlots'] == 'Y') {
$flexSlots = $row['flexSlotsCurrent'].'/';
$flexSlots = $row['flexSlotsCurrent'] . '/';
}
$usage = $usedSlots. '/' . $flexSlots.$row['slots'];
if ($row['uptime']==0) {

View File

@ -38,7 +38,7 @@
*/
$sprache = getlanguagefile('voice',$user_language,$reseller_id);
$loguserid = $user_id;
$logusername=getusername($user_id);
$logusername = getusername($user_id);
$logusertype='user';
$logreseller = 0;
if (isset($admin_id)) {

View File

@ -755,8 +755,8 @@ if ($ui->st('d', 'get') == 'ad' and is_numeric($licenceDetails['lVo']) and $lice
$usedSlots = $row['usedslots'];
if ($row['usedslots'] == null) $usedSlots = 0;
$flexSlots = '';
if ($row['flexSlots'] == 'Y' and $row['flexSlotsCurrent'] == null) $flexSlots = $row['slots'].'/';
else if ($row['flexSlots'] == 'Y') $flexSlots = $row['flexSlotsCurrent'].'/';
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);
$hours=floor(($row['uptime']-($days*86400))/3600);

View File

@ -197,7 +197,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$i = 0;
$query = $sql->prepare("SELECT `tsdnsID` FROM `voice_dns` WHERE `dns`=? AND `resellerID`=? LIMIT 1");
$query2 = $sql->prepare("SELECT `id` FROM `voice_server` WHERE `dns`=? AND `resellerid`=? LIMIT 1");
foreach ($dnsarray as $k=>$v) {
foreach ($dnsarray as $k => $v) {
$query->execute(array($v,$reseller_id));
$query2->execute(array($v,$reseller_id));
$ex=explode(':',$k);
@ -265,7 +265,7 @@ if ($ui->w('action', 4, 'post') and !token(true)) {
$i = 0;
$query = $sql->prepare("SELECT `tsdnsID` FROM `voice_dns` WHERE `dns`=? AND `resellerID`=? LIMIT 1");
$query2 = $sql->prepare("SELECT `id` FROM `voice_server` WHERE `dns`=? AND `resellerid`=? LIMIT 1");
foreach ($dnsarray as $k=>$v) {
foreach ($dnsarray as $k => $v) {
$query->execute(array($v,$reseller_id));
$query2->execute(array($v,$reseller_id));
$ex=explode(':',$k);