cleaning up old functions; sudo -u +screen == bad

This commit is contained in:
Ulrich Block 2013-09-01 23:12:51 +02:00
parent 92911505ee
commit fc39a6985c
64 changed files with 213 additions and 273 deletions

View File

@ -87,6 +87,6 @@ if (isset($user_id)) {
}
}
}
if(((!isset($admin_id) and !isset($user_id)) or (((!$pa['gserver']) and !$pa['voiceserver'] and !$pa['voicemasterserver'] and !$pa['traffic'] and !$pa['user'] and !rsellerpermisions($admin_id,$sql) and !$pa['usertickets']) and (!$pau['restart'] and !$pau['usertickets'])))) {
if(((!isset($admin_id) and !isset($user_id)) or (((!$pa['gserver']) and !$pa['voiceserver'] and !$pa['voicemasterserver'] and !$pa['traffic'] and !$pa['user'] and !rsellerpermisions($admin_id) and !$pa['usertickets']) and (!$pau['restart'] and !$pau['usertickets'])))) {
die('No acces');
}

View File

@ -340,10 +340,10 @@ XML;
$_SESSION['resellerid']=$resellerid;
$query=$sql->prepare("DELETE FROM `badips` WHERE `badip`=?");
$query->execute(array($loguserip));
if(isanyadmin($id,$sql) or rsellerpermisions($id,$sql)) {
if(isanyadmin($id) or rsellerpermisions($id)) {
$_SESSION['adminid']=$id;
if(isset($_SESSION['adminid']) and is_numeric($_SESSION['adminid'])) $admin_id=$_SESSION['adminid'];
} else if (isanyuser($id,$sql)) {
} else if (isanyuser($idl)) {
$_SESSION['userid']=$id;
if(isset($_SESSION['userid']) and is_numeric($_SESSION['userid'])) $user_id=$_SESSION['userid'];
if(isset($sID)) $_SESSION['sID']=$sID;
@ -373,7 +373,7 @@ XML;
$query=$sql->prepare("UPDATE `settings` SET `paneldomain`=? WHERE `resellerid`=0 LIMIT 1");
$query->execute(array($webhostdomain));
$params=@json_decode(licenceRequest(true));
if(isanyadmin($admin_id,$sql) or rsellerpermisions($admin_id,$sql)) {
if(isanyadmin($admin_id) or rsellerpermisions($admin_id)) {
redirect('admin.php');
} else {
redirect('login.php&r=lo');

View File

@ -51,7 +51,7 @@ if (!isset($admin_id) and !isset($user_id)) {
} else {
$die=true;
}
if (!isset($pa) or count($pa)==0 or ((!isset($admin_id) and !isset($user_id)) or (((!$pa['gserver']) and !$pa['voiceserver'] and !$pa['voicemasterserver'] and !$pa['traffic'] and !$pa['user'] and !rsellerpermisions($admin_id,$sql) and !$pa['usertickets']) and (!$pa['restart'] and !$pa['usertickets'])))) {
if (!isset($pa) or count($pa)==0 or ((!isset($admin_id) and !isset($user_id)) or (((!$pa['gserver']) and !$pa['voiceserver'] and !$pa['voicemasterserver'] and !$pa['traffic'] and !$pa['user'] and !rsellerpermisions($admin_id) and !$pa['usertickets']) and (!$pa['restart'] and !$pa['usertickets'])))) {
$die=true;
}
if ($ui->smallletters('w',5,'get')=='check') {

View File

@ -58,7 +58,7 @@ if (isset($server_id)) {
$user_id=$row['id'];
}
} else {
$username=getusername($user_id,$sql);
$username=getusername($user_id);
}
$query=$sql->prepare("SELECT g.`id`,g.`newlayout`,g.`rootID`,g.`serverip`,g.`port`,g.`protected`,AES_DECRYPT(g.`ftppassword`,?) AS `dftppass`,AES_DECRYPT(g.`ppassword`,?) AS `decryptedftppass`,s.`servertemplate`,t.`binarydir`,t.`shorten` FROM `gsswitch` g LEFT JOIN `serverlist` s ON g.`serverid`=s.`id` LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE g.`id`=? AND g.`userid`=? AND g.`resellerid`=? LIMIT 1");
$query->execute(array($aeskey,$aeskey,$server_id,$user_id,$reseller_id));

View File

@ -41,7 +41,7 @@ if ((!isset($admin_id) or !$main == 1) or (isset($admin_id) and !$pa['addons']))
}
$sprache=getlanguagefile('images',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
if ($reseller_id==0) {
$logreseller=0;

View File

@ -36,7 +36,7 @@
* Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
* Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
*/
if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !isanyadmin($admin_id,$sql) and !rsellerpermisions($admin_id,$sql)) or (!isset($pa))) {
if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !isanyadmin($admin_id) and !rsellerpermisions($admin_id)) or (!isset($pa))) {
header('Location: login.php');
die('No acces');
}

View File

@ -35,7 +35,7 @@
* Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
*/
if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !isanyadmin($admin_id,$sql) and !rsellerpermisions($admin_id,$sql))) {
if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !isanyadmin($admin_id) and !rsellerpermisions($admin_id))) {
header('Location: login.php');
die('No acces');
}
@ -58,14 +58,14 @@ foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$password=$row['queryPassword'];
$name=$row['queryName'];
if ($name!="OFFLINE" and $row['stopped']=='N' and $war=="Y" and $password=="N") {
$removed[]=array('userid'=>$row['userid'],'username'=>getusername($row['userid'],$sql),'address'=>$row['server']);
$removed[]=array('userid'=>$row['userid'],'username'=>getusername($row['userid']),'address'=>$row['server']);
$crashedArray['gsPWD']++;
} else if ($name=="OFFLINE" and $row['stopped']=='N') {
$crashed[]=array('userid'=>$row['userid'],'username'=>getusername($row['userid'],$sql),'address'=>$row['server']);
$crashed[]=array('userid'=>$row['userid'],'username'=>getusername($row['userid']),'address'=>$row['server']);
$crashedArray['gsCrashed']++;
}
if (isset($name) and $name!="" and $name!="OFFLINE" and $row['stopped']=='N' and isset($reseller_brandname) and $reseller_brandname!="" and $brandname=="Y" and strpos(strtolower($name), strtolower($reseller_brandname)) === false) {
$tag_removed[]=array('userid'=>$row['userid'],'username'=>getusername($row['userid'],$sql),'address'=>$row['server']);
$tag_removed[]=array('userid'=>$row['userid'],'username'=>getusername($row['userid']),'address'=>$row['server']);
$crashedArray['gsTag']++;
}
}

View File

@ -43,12 +43,12 @@ if ($main!=1 or !isset($admin_id) or (isset($admin_id) and !$pa['apiSettings']))
}
$sprache=getlanguagefile('api',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype='admin';
$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
$aeskey=$aesfilecvar['aeskey'];
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype='admin';
if ($reseller_id==0) {
$logreseller=0;

View File

@ -42,12 +42,12 @@ if ($main!=1 or !isset($admin_id) or (isset($admin_id) and !$pa['apiSettings']))
}
$sprache=getlanguagefile('api',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype='admin';
$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
$aeskey=$aesfilecvar['aeskey'];
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype='admin';
if ($reseller_id==0) {
$logreseller=0;

View File

@ -43,7 +43,7 @@ if ($main!=1 or !isset($admin_id) or (isset($admin_id) and !$pa['apiSettings']))
}
$sprache=getlanguagefile('api',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype='admin';
if ($reseller_id==0) {
$logreseller=0;

View File

@ -938,7 +938,7 @@ function checkDNS ($dns,$id=null,$user_id=null,$type='') {
$query->execute(array($reseller_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
if ((isset($tsdnsServerID) and $id!=null and $row['id']==$tsdnsServerID) or ($type=='dns' and $id!=null and $row['id']==$masterID)) {
$defaultdns=strtolower($id.'-'.getusername($user_id,$sql).'.'.$row['defaultdns']);
$defaultdns=strtolower($id.'-'.getusername($user_id).'.'.$row['defaultdns']);
$partCount=count(explode('.',$defaultdns));
}
unset($temp);

View File

@ -44,7 +44,7 @@ $aeskey=$aesfilecvar['aeskey'];
$sprache=getlanguagefile('roots',$user_language,$reseller_id,$sql);
$gssprache=getlanguagefile('gserver',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
if ($reseller_id=="0") {
$logreseller="0";

View File

@ -39,7 +39,7 @@
$sprache=getlanguagefile('feeds',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype='admin';
$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
$aeskey=$aesfilecvar['aeskey'];

View File

@ -39,7 +39,7 @@
$sprache=getlanguagefile('feeds',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype='admin';
$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
$aeskey=$aesfilecvar['aeskey'];

View File

@ -60,27 +60,16 @@ if (!function_exists('passwordgenerate')) {
function passwordhash($username,$password,$salt=false){
$passworda = str_split($password,(strlen($password)/2)+1);
$usernamea = str_split($username,(strlen($username)/2)+1);
if ($salt==false) {
$hash = hash('sha512',sha1($usernamea[0].md5($passworda[0].$usernamea[1]).$passworda[1]));
} else {
$hash = hash('sha512',sha1($usernamea[0].md5($passworda[0].$salt.$usernamea[1]).$passworda[1]));
}
return $hash;
return ($salt==false) ? hash('sha512',sha1($usernamea[0].md5($passworda[0].$usernamea[1]).$passworda[1])): hash('sha512',sha1($usernamea[0].md5($passworda[0].$salt.$usernamea[1]).$passworda[1]));
}
function createHash ($name,$pwd,$saltOne,$saltTwo='ZPZw$[pkJF!;SHdl',$iterate=1000) {
$pwdSplit=str_split($pwd,(strlen($pwd)/2)+1);
$nameSplit=str_split($name,(strlen($name)/2)+1);
$hash='';
if (!isset($nameSplit[1]) and strlen($nameSplit[0])>0) {
$nameSplit[1]=$nameSplit[0];
}
if (!isset($pwdSplit[1]) and strlen($pwdSplit[0])>0) {
$pwdSplit[1]=$pwdSplit[0];
}
if (!isset($nameSplit[1]) and strlen($nameSplit[0])>0) $nameSplit[1]=$nameSplit[0];
if (!isset($pwdSplit[1]) and strlen($pwdSplit[0])>0) $pwdSplit[1]=$pwdSplit[0];
if (isset($nameSplit[1]) and isset($pwdSplit[1])) {
for ($i=0;$i<=$iterate;$i++) {
$hash=hash('sha512',$nameSplit[0].$saltOne.$pwdSplit[0].$hash.$nameSplit[1].$saltTwo.$pwdSplit[1]);
}
for ($i=0;$i<=$iterate;$i++) $hash=hash('sha512',$nameSplit[0].$saltOne.$pwdSplit[0].$hash.$nameSplit[1].$saltTwo.$pwdSplit[1]);
return $hash;
} else if (!isset($pwdSplit[1])) {
die ('Fatal Error: No or invalid Password!');
@ -100,35 +89,24 @@ if (!function_exists('passwordgenerate')) {
$selectLanguages=array();
if (is_dir($dir)){
$dirs=scandir($dir);
foreach ($dirs as $row) {
if (small_letters_check($row, '2')) {
$selectLanguages[]=$row;
}
}
foreach ($dirs as $row) if (small_letters_check($row,2)) $selectLanguages[]=$row;
}
return $selectLanguages;
}
function getlanguages ($value) {
$selectLanguages=listDirs('languages/'.$value.'/');
if (count($selectLanguages)<1) {
$selectLanguages=listDirs('languages/default/');
}
if (count($selectLanguages)<1) {
$selectLanguages=listDirs('languages/');
}
if (count($selectLanguages)<1) $selectLanguages=listDirs('languages/default/');
if (count($selectLanguages)<1) $selectLanguages=listDirs('languages/');
return $selectLanguages;
}
function cleanFsockOpenRequest ($string,$start,$stop) {
while(substr($string,0,1)!=$start and strlen($string)>0) {
$string=substr($string,1);
}
while(substr($string,-1)!=$stop and strlen($string)>0) {
$string=substr($string,0,-1);
}
while(substr($string,0,1)!=$start and strlen($string)>0) $string=substr($string,1);
while(substr($string,-1)!=$stop and strlen($string)>0) $string=substr($string,0,-1);
return $string;
}
function serverdata($type,$serverID,$aeskey,$sql) {
function serverdata($type,$serverID,$aeskey) {
global $sql;
$serverdata=array();
if ($type=="root") {
$query=$sql->prepare("SELECT `ip`,AES_DECRYPT(`port`,:aeskey) AS `decryptedport`,AES_DECRYPT(`user`,:aeskey) AS `decrypteduser`,AES_DECRYPT(`pass`,:aeskey) AS `decryptedpass`,AES_DECRYPT(`steamAccount`,:aeskey) AS `decryptedsteamAccount`,AES_DECRYPT(`steamPassword`,:aeskey) AS `decryptedsteamPassword`,`publickey`,`keyname`,`ftpport`,`notified`,`cores`,`hyperthreading`,`resellerid` FROM `rserverdata` WHERE `id`=:serverID LIMIT 1");
@ -213,31 +191,18 @@ if (!function_exists('passwordgenerate')) {
}
return array('left'=>$left,'count'=>$count,'gsCount'=>$gsCount,'vCount'=>$vCount,'voCount'=>$voCount,'dCount'=>$dCount,'mG'=>$mG,'mVs'=>$mVs,'mVo'=>$mVo,'mD'=>$mD,'lG'=>$lG,'lVs'=>$lVs,'lVo'=>$lVo,'lD'=>$lD,'p'=>$json->p,'b'=>$json->b,'t'=>$json->t,'u'=>$json->u,'c'=>$json->c,'v'=>$json->v);
}
function getftppass($userNAME,$sql) {
$user='';
$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
$aeskey=$aesfilecvar['aeskey'];
$pselect=$sql->prepare("SELECT AES_DECRYPT(`ftppass`,?) AS `decryptedftppass` FROM `userdata` WHERE `cname`=? LIMIT 1");
$pselect->execute(array($aeskey,$userNAME));
foreach ($pselect->fetchAll(PDO::FETCH_ASSOC) as $row) {
$user=$row['decryptedftppass'];
}
return $user;
}
function getusername($userid,$sql) {
$cname='User deleted';
$pselect=$sql->prepare("SELECT `cname` FROM `userdata` WHERE `id`=? LIMIT 1");
$pselect->execute(array($userid));
foreach ($pselect->fetchAll(PDO::FETCH_ASSOC) as $row) {
$cname=$row['cname'];
}
function getusername($userid) {
global $sql;
$query=$sql->prepare("SELECT `cname` FROM `userdata` WHERE `id`=? LIMIT 1");
$query->execute(array($userid));
$cname=($query->rowCount()==0) ? 'User deleted' : $query->fetchColumn();
return $cname;
}
function rsellerpermisions($userid,$sql) {
$pselect=$sql->prepare("SELECT `userid` FROM `userpermissions` WHERE `userid`=? AND (`addvserver`='Y' OR `modvserver`='Y' OR `delvserver`='Y' OR `vserversettings`='Y' OR `vserverhost`='Y' OR `resellertemplates`='Y' OR `usevserver`='Y' OR `root`='Y' OR `traffic`='Y') LIMIT 1");
$pselect->execute(array($userid));
$colcount=$pselect->rowCount();
function rsellerpermisions($userid) {
global $sql;
$query=$sql->prepare("SELECT `userid` FROM `userpermissions` WHERE `userid`=? AND (`addvserver`='Y' OR `modvserver`='Y' OR `delvserver`='Y' OR `vserversettings`='Y' OR `vserverhost`='Y' OR `resellertemplates`='Y' OR `usevserver`='Y' OR `root`='Y' OR `traffic`='Y') LIMIT 1");
$query->execute(array($userid));
$colcount=$query->rowCount();
if ($colcount==0) {
$u_p_q=$sql->prepare("SELECT g.`id` FROM `userdata_groups` u LEFT JOIN `usergroups` g ON u.`groupID`=g.`id` WHERE u.`userID`=? AND (`addvserver`='Y' OR `modvserver`='Y' OR `delvserver`='Y' OR `vserversettings`='Y' OR `vserverhost`='Y' OR `resellertemplates`='Y' OR `usevserver`='Y' OR `root`='Y' OR `traffic`='Y') LIMIT 1");
$u_p_q->execute(array($userid));
@ -245,46 +210,38 @@ if (!function_exists('passwordgenerate')) {
}
return $colcount;
}
function isanyadmin($userid,$sql) {
function isanyadmin($userid) {
global $sql;
$query=$sql->prepare("SELECT `accounttype` FROM `userdata` WHERE `id`=? LIMIT 1");
$query->execute(array($userid));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
return ($row['accounttype']=='a' or $row['accounttype']=='r') ? true : false;
}
$accountType=$query->fetchColumn();
return ($accountType=='a' or $accountType=='r') ? true : false;
}
function isanyuser($userid,$sql) {
function isanyuser($userid) {
global $sql;
$query=$sql->prepare("SELECT `accounttype` FROM `userdata` WHERE `id`=? LIMIT 1");
$query->execute(array($userid));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
if($row['accounttype']=="u") return true;
}
return ($query->fetchColumn()=='u') ? true : false;
}
function language($user_id,$sql) {
function language($user_id) {
global $sql,$ui;
if (!isset($_SESSION['language'])) {
$query=$sql->prepare("SELECT `language` FROM `userdata` WHERE `id`=? LIMIT 1");
$query->execute(array($user_id));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$language=$row['language'];
if ($language=="") {
if (isset($ui->server['HTTP_ACCEPT_LANGUAGE'])){
$lang_detect=small_letters_check(substr($ui->server['HTTP_ACCEPT_LANGUAGE'],0,2), 2);
} else {
$lang_detect='uk';
}
if (is_dir(EASYWIDIR."/languages/$lang_detect")) {
$language=$lang_detect;
} else {
$query2="SELECT `language` FROM settings LIMIT 1";
foreach ($sql->query($query2) as $row2) {
$language=$row2['language'];
}
}
} else if (!is_dir(EASYWIDIR."/languages/$language")) {
$query2="SELECT `language` FROM settings LIMIT 1";
foreach ($sql->query($query2) as $row2) {
$language=$row2['language'];
}
$language=$query->fetchColumn();
if ($language=='') {
$lang_detect=(isset($ui->server['HTTP_ACCEPT_LANGUAGE'])) ? small_letters_check(substr($ui->server['HTTP_ACCEPT_LANGUAGE'],0,2),2) : 'uk';
if (is_dir(EASYWIDIR."/languages/$lang_detect")) {
$language=$lang_detect;
} else {
$query=$sql->prepare("SELECT `language` FROM `settings` LIMIT 1");
$query->execute();
$language=$query->fetchColumn();
}
} else if (!is_dir(EASYWIDIR."/languages/$language")) {
$query=$sql->prepare("SELECT `language` FROM `settings` LIMIT 1");
$query->execute();
$language=$query->fetchColumn();
}
$query=$sql->prepare("UPDATE `userdata` SET `language`=? WHERE `id`=? LIMIT 1");
$query->execute(array($language,$user_id));
@ -616,7 +573,7 @@ if (!function_exists('passwordgenerate')) {
$cmd .=" +host_workshop_collection ${row['workshopCollection']} +workshop_start_map ${map} -authkey ${row['dwebapiAuthkey']}";
$cmd=preg_replace('/[\s\s+]{1,}\+map[\s\s+]{1,}[\w-_!%]{1,}/','',$cmd);
}
$rdata=serverdata('root',$rootid,$aeskey,$sql);
$rdata=serverdata('root',$rootid,$aeskey);
$sship=$rdata['ip'];
$sshport=$rdata['port'];
$sshuser=$rdata['user'];
@ -1034,13 +991,9 @@ if (!function_exists('passwordgenerate')) {
$array=$query->fetchAll(PDO::FETCH_ASSOC);
foreach ($array as $row) {
if (($accounttype=='u' and $row['miniroot']=='Y')) {
foreach ($row as $key => $value) {
$pa["$key"]=true;
}
foreach ($row as $key => $value) $pa["$key"]=true;
} else if (($accounttype!='u' and $row['root']=='Y')) {
foreach ($row as $key => $value) {
$pa["$key"]=true;
}
foreach ($row as $key => $value) $pa["$key"]=true;
} else {
foreach ($row as $key => $value) {
if ((isset($pa["$key"]) and $pa["$key"]===false) or !isset($pa["$key"])) $pa["$key"]=($value=='Y') ? true : false;
@ -1050,12 +1003,10 @@ if (!function_exists('passwordgenerate')) {
return $pa;
}
function array_value_exists($key,$value,$array) {
if (array_key_exists($key,$array) and $array[$key]==$value) {
return true;
}
if (array_key_exists($key,$array) and $array[$key]==$value) return true;
return false;
}
function updateJobs ($localID,$resellerID,$sql,$jobPending='Y') {
function updateJobs($localID,$resellerID,$sql,$jobPending='Y') {
$update=$sql->prepare("UPDATE `gsswitch` SET `jobPending`=? WHERE `userid`=? AND `resellerid`=?");
$update->execute(array($jobPending,$localID,$resellerID));
$update=$sql->prepare("UPDATE `mysql_external_dbs` SET `jobPending`=? WHERE `uid`=? AND `resellerid`=?");
@ -1068,11 +1019,7 @@ if (!function_exists('passwordgenerate')) {
$update->execute(array($jobPending,$localID,$resellerID));
}
function updateStates($sql,$action,$type=null) {
if ($type!=null) {
$typeQuery=' AND `type`=\''.$type.'\'';
} else {
$typeQuery='';
}
$typeQuery=($type!=null) ? " AND `type`='${type}" : '';
$query=$sql->prepare("SELECT `type`,`affectedID` FROM `jobs` WHERE (`status` IS NULL OR `status`=1) AND `action`=? $typeQuery GROUP BY `type`,`affectedID`");
$query->execute(array($action));
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
@ -1090,9 +1037,8 @@ if (!function_exists('passwordgenerate')) {
}
}
function dataExist ($value,$array) {
if (isset($array[$value]) and isset($array[$array[$value]]) and !in_array($array[$array[$value]],array(false,null,''))) {
return true;
}
if (isset($array[$value]) and isset($array[$array[$value]]) and !in_array($array[$array[$value]],array(false,null,''))) return true;
return false;
}
function webhostRequest ($domain,$useragent,$file,$postParams='',$port=80) {
$domain=str_replace(array('https://','http://'),'',$domain);
@ -1143,14 +1089,8 @@ if (!function_exists('passwordgenerate')) {
return 'Error: Could not connect to host '.$domain.' and port '.$port.' ('.$errstr.')';
}
function checkPorts ($send,$used) {
$success=true;
$new=array();
foreach ($send as $port) {
if (!port($port) or in_array($port,$used) or in_array($port,$new)) {
$success=false;
}
}
return $success;
foreach ($send as $port) if (!port($port) or in_array($port,$used)) return false;
return true;
}
function usedPorts ($ips) {
global $sql;

View File

@ -41,7 +41,7 @@ if ($ui->st('w','get')=='se') {
die();
}
$loguserid=$user_id;
$logusername=getusername($user_id,$sql);
$logusername=getusername($user_id);
$logusertype="user";
$logreseller=0;
if (isset($admin_id)) {
@ -58,7 +58,7 @@ if ($ui->st('w','get')=='se') {
die();
}
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
if ($reseller_id==0) {
$logreseller=0;

View File

@ -42,7 +42,7 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['gserver'])) {
$sprache=getlanguagefile('gserver',$user_language,$reseller_id,$sql);
$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
$aeskey=$aesfilecvar['aeskey'];
if ($reseller_id==0) {
@ -348,7 +348,7 @@ if ($ui->st('d','get')=='ad' and is_numeric($licenceDetails['lG']) and $licenceD
include(EASYWIDIR.'/stuff/ssh_exec.php');
$gamestring=array();
$template_file='';
$rdata=serverdata('root',$serverid,$aeskey,$sql);
$rdata=serverdata('root',$serverid,$aeskey);
$sship=$rdata['ip'];
$sshport=$rdata['port'];
$sshuser=$rdata['user'];
@ -549,7 +549,7 @@ if ($ui->st('d','get')=='ad' and is_numeric($licenceDetails['lG']) and $licenceD
$query=$sql->prepare("SELECT `cname` FROM `userdata` WHERE `id`=? LIMIT 1");
$query->execute(array($userID));
$customer2=$query->fetchColumn();
$rdata=serverdata('root',$rootID,$aeskey,$sql);
$rdata=serverdata('root',$rootID,$aeskey);
$sship=$rdata['ip'];
$sshport=$rdata['port'];
$sshuser=$rdata['user'];
@ -613,8 +613,8 @@ if ($ui->st('d','get')=='ad' and is_numeric($licenceDetails['lG']) and $licenceD
$query->execute(array($row['id'],$server_id,$reseller_id));
}
} else {
if ($ui->w('safeDelete',1,'post')!='D') $cmds[]="sudo -u $server_customer screen -dmS delscreen-$server_customer ./control.sh delscreen $server_customer" ;
if ($ui->w('safeDelete',1,'post')!='D') $cmds[]="sudo -u $server_customer-p screen -dmS delscreen-$server_customer-p ./control.sh delscreen $server_customer-p";
if ($ui->w('safeDelete',1,'post')!='D') $cmds[]="sudo -u $server_customer ./control.sh delscreen $server_customer" ;
if ($ui->w('safeDelete',1,'post')!='D') $cmds[]="sudo -u $server_customer-p ./control.sh delscreen $server_customer-p";
if ($ui->w('safeDelete',1,'post')!='D') $cmds[]="./control.sh delCustomer $server_customer";
$template_file=$sprache->no_server_left;
}
@ -815,7 +815,7 @@ if ($ui->st('d','get')=='ad' and is_numeric($licenceDetails['lG']) and $licenceD
$server_customer=$server_customer.'-'.$server_id;
}
}
$rdata=serverdata('root',$rootID,$aeskey,$sql);
$rdata=serverdata('root',$rootID,$aeskey);
$sship=$rdata['ip'];
$sshport=$rdata['port'];
$sshuser=$rdata['user'];
@ -1018,7 +1018,7 @@ if ($ui->st('d','get')=='ad' and is_numeric($licenceDetails['lG']) and $licenceD
if (count($gamestring)>0 and $ui->active('type','post')) {
include(EASYWIDIR.'/stuff/ssh_exec.php');
$gamestring=count($gamestring).'_'.implode('_',$gamestring);
$rdata=serverdata('root',$serverid,$aeskey,$sql);
$rdata=serverdata('root',$serverid,$aeskey);
$sship=$rdata['ip'];
$sshport=$rdata['port'];
$sshuser=$rdata['user'];

View File

@ -42,7 +42,7 @@ if ((!isset($admin_id) or !$main == "1") or (isset($admin_id) and !$pa['gimages'
$sprache=getlanguagefile('images',$user_language,$reseller_id,$sql);
$gssprache=getlanguagefile('gserver',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
if ($reseller_id=="0") {
$logreseller="0";

View File

@ -39,7 +39,7 @@
if (!isset($admin_id) or !isset($reseller_id)) redirect('login.php');
$pa=User_Permissions($admin_id);
if (!isanyadmin($admin_id,$sql) and count($pa)==0) redirect('login.php');
if (!isanyadmin($admin_id) and count($pa)==0) redirect('login.php');
$licenceDetails=serverAmount($reseller_id);
$gserver_module=(is_numeric($licenceDetails['mG']) and $licenceDetails['mG']==0) ? false : true;
$vserver_module=(is_numeric($licenceDetails['mVs']) and $licenceDetails['mVs']==0) ? false : true;

View File

@ -114,7 +114,7 @@ foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
if (is_array($tmp)) foreach($tmp as $t) $cmds[]=$t;
}
$newPort=(is_object($extraData) and isset($extraData->newPort)) ? $extraData->newPort : $port;
if ($port!=$newPort) $cmds[]="sudo -u ${customer} screen -dmS move ./control.sh move ${customer} ${gsfolder} ${gsIP}_${port}";
if ($port!=$newPort) $cmds[]="sudo -u ${customer} ./control.sh move ${customer} ${gsfolder} ${gsIP}_${port}";
$cmds[]='./control.sh mod '.$customer.' '.$ftppass.' '.$ftppass2;
$query4=$sql->prepare("UPDATE `gsswitch` SET `active`=?,`port`=?,`jobPending`='N' WHERE `id`=? LIMIT 1");
$query4->execute(array($newActive,$newPort,$row2['affectedID']));

View File

@ -42,7 +42,7 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and (!isset($pa) or (!$
$sprache=getlanguagefile('lendserver',$user_language,$reseller_id,$sql);
$gssprache=getlanguagefile('gserver',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
if ($reseller_id==0) {
$logreseller=0;

View File

@ -43,7 +43,7 @@ $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
$aeskey=$aesfilecvar['aeskey'];
$sprache=getlanguagefile('roots',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
if ($reseller_id==0) {
$logreseller=0;
@ -113,7 +113,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
if ($ui->smallletters('action',2,'post')=='dl'){
include(EASYWIDIR.'/stuff/ssh_exec.php');
$serverid=$ui->id('id',19,'get');
$rdata=serverdata('root',$serverid,$aeskey,$sql);
$rdata=serverdata('root',$serverid,$aeskey);
$sship=$rdata['ip'];
$sshport=$rdata['port'];
$sshuser=$rdata['user'];
@ -218,7 +218,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
}
}
if (count($sshcheck)>0) {
$serverdata=serverdata('root',$id,$aeskey,$sql);
$serverdata=serverdata('root',$id,$aeskey);
$ip=$serverdata['ip'];
$user=$serverdata['user'];
$port=$serverdata['port'];

View File

@ -44,7 +44,7 @@ $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
$aeskey=$aesfilecvar['aeskey'];
$sprache=getlanguagefile('mysql',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
if ($reseller_id==0) {
$logreseller=0;
@ -62,7 +62,7 @@ if ($reseller_id!=0 and $admin_id!=$reseller_id) {
}
if ($ui->w('action',4,'post') and !token(true)) {
$template_file=$spracheResponse->token;
} else if ($ui->st('d','get')=='ms' and !$ui->id('id','30','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';
@ -120,9 +120,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','30','get') and $pa['mysql_settings']) {
if ($ui->smallletters('action',2,'post')=='dl') {
$id=$ui->id('id','30','get');
} 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');
$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) {
@ -136,7 +136,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
$loguseraction="%del% MYSQL Server $ip";
$insertlog->execute();
} else {
$id=$ui->id('id','30','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) {
@ -145,9 +145,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','30','get') and $pa['mysql_settings']) {
if (!isset($action)) {
$id=$ui->id('id','30','get');
} 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');
$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) {
@ -164,7 +164,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
$max_userconnections_per_hour=$row['max_userconnections_per_hour'];
}
$template_file="admin_mysql_server_md.tpl";
} else if ($action=='md') {
} else if ($ui->st('action','post')=='md') {
$errors=array();
if (!$ui->ip('ip','post')) $errors[]='IP';
if (!$ui->port('port','post')) $errors[]='Port';
@ -173,7 +173,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','30','get');
$id=$ui->id('id',10,'get');
$active=$ui->active('active','post');
$ip=$ui->ip('ip','post');
$port=$ui->port('port','post');
@ -193,9 +193,9 @@ if ($ui->w('action',4,'post') and !token(true)) {
}
}
} else if ($ui->st('d','get')=='as' and $pa['mysql']) {
if (!$ui->smallletters('action',2,'post')) {
if (!$ui->st('action','post')) {
$template_file="admin_mysql_server_add.tpl";
} else if ($ui->smallletters('action',2,'post')=='ad'){
} else if ($ui->st('action','post')=='ad'){
$errors=array();
if (!$ui->ip('ip','post')) $errors[]='IP';
if (!$ui->port('port','post')) $errors[]='Port';
@ -204,7 +204,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','30','get');
$id=$ui->id('id',10,'get');
$active=$ui->active('active','post');
$ip=$ui->ip('ip','post');
$port=$ui->port('port','post');
@ -224,7 +224,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
}
}
} else if ($ui->st('d','get')=='ad' and $pa['mysql']) {
if (!$ui->smallletters('action',2,'post')) {
if (!$ui->st('action','post')) {
$table=array();
$table2=array();
$password=passwordgenerate(20);
@ -255,15 +255,15 @@ if ($ui->w('action',4,'post') and !token(true)) {
$max_userconnections_per_hour=0;
}
$template_file="admin_mysql_db_add.tpl";
} else if ($ui->smallletters('action',2,'post')=='ad' and $ui->password('password',40,'post') and $ui->id('serverid',30,'post') and $ui->id('userid',30,'post') and $ui->active('active','post')) {
} else if ($ui->st('action','post')=='ad' and $ui->id('serverid',10,'post') and $ui->id('userid',10,'post')) {
$errors=array();
if (!$ui->active('active','post')) $errors[]=$sprache->active;
if (!$ui->password('password',40,'post')) $errors[]=$sprache->password;
if (count($errors)>0) {
$template_file="Error: ".implode('<br>',$errors);
} else {
$sid=$ui->id('serverid',30,'post');
$uid=$ui->id('userid',30,'post');
$sid=$ui->id('serverid',10,'post');
$uid=$ui->id('userid',10,'post');
$active=$ui->active('active','post');
$password=$ui->password('password',40,'post');
$ips=$ui->ips('ips','post');
@ -274,11 +274,10 @@ if ($ui->w('action',4,'post') and !token(true)) {
$max_updates_per_hour=($ui->id('max_updates_per_hour',255,'post')) ? $ui->id('max_updates_per_hour',255,'post') : 0;
$max_connections_per_hour=($ui->id('max_connections_per_hour',255,'post')) ? $ui->id('max_connections_per_hour',255,'post') : 0;
$max_userconnections_per_hour=($ui->id('max_userconnections_per_hour',255,'post')) ? $ui->id('max_userconnections_per_hour',255,'post') : 0;
$dbname=$cname.'_'.$password;
#https://github.com/easy-wi/developer/issues/42 column description added
$query=$sql->prepare("INSERT INTO `mysql_external_dbs` (`active`,`sid`,`uid`,`dbname`,`description`,`password`,`ips`,`max_queries_per_hour`,`max_updates_per_hour`,`max_connections_per_hour`,`max_userconnections_per_hour`,`resellerid`) VALUES (?,?,?,?,?,AES_ENCRYPT(?,?),?,?,?,?,?,?)");
$query->execute(array($active,$sid,$uid,$dbname,$ui->names('description',255,'post'),$password,$aeskey,$ips,$max_queries_per_hour,$max_updates_per_hour,$max_connections_per_hour,$max_userconnections_per_hour,$reseller_id));
$query=$sql->prepare("INSERT INTO `mysql_external_dbs` (`active`,`sid`,`uid`,`description`,`password`,`ips`,`max_queries_per_hour`,`max_updates_per_hour`,`max_connections_per_hour`,`max_userconnections_per_hour`,`resellerid`) VALUES (?,?,?,?,AES_ENCRYPT(?,?),?,?,?,?,?,?)");
$query->execute(array($active,$sid,$uid,$ui->names('description',255,'post'),$password,$aeskey,$ips,$max_queries_per_hour,$max_updates_per_hour,$max_connections_per_hour,$max_userconnections_per_hour,$reseller_id));
if ($active=='N') $password=passwordgenerate(20);
$id=$sql->lastInsertId();
$dbname=$cname.'-'.$id;
@ -287,35 +286,35 @@ if ($ui->w('action',4,'post') and !token(true)) {
$strStart=$nameLength-16;
$dbname=substr($dbname,$strStart,$nameLength);
}
$query3=$sql->prepare("SELECT `ip`,`port`,`user`,AES_DECRYPT(`password`,?) AS `decryptedpassword` FROM `mysql_external_servers` WHERE `id`=? AND `resellerid`=? LIMIT 1");
$query3->execute(array($aeskey,$sid,$reseller_id));
foreach ($query3->fetchall(PDO::FETCH_ASSOC) as $row3) {
$ip=$row3['ip'];
$port=$row3['port'];
$user=$row3['user'];
$pwd=$row3['decryptedpassword'];
$query=$sql->prepare("UPDATE `mysql_external_dbs` SET `dbname`=?,`password`=AES_ENCRYPT(?,?) WHERE `id`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($dbname,$password,$aeskey,$id,$reseller_id));
$query=$sql->prepare("SELECT `ip`,`port`,`user`,AES_DECRYPT(`password`,?) AS `decryptedpassword` FROM `mysql_external_servers` WHERE `id`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($aeskey,$sid,$reseller_id));
foreach ($query->fetchall(PDO::FETCH_ASSOC) as $row) {
$ip=$row['ip'];
$port=$row['port'];
$user=$row['user'];
$pwd=$row['decryptedpassword'];
}
$remotesql=new ExternalSQL ($ip,$port,$user,$pwd);
if ($remotesql->error=='ok') {
$remotesql->AddDB($dbname,$password,$ips,$max_queries_per_hour,$max_connections_per_hour,$max_updates_per_hour,$max_userconnections_per_hour);
$pupdate=$sql->prepare("UPDATE `mysql_external_dbs` SET `dbname`=?,`password`=AES_ENCRYPT(?,?) WHERE `id`=? AND `resellerid`=? LIMIT 1");
$pupdate->execute(array($dbname,$password,$aeskey,$id,$reseller_id));
customColumns('D',$id,'save');
$template_file=$spracheResponse->table_add;
$loguseraction="%add% MYSQL DB $dbname ($ip)";
$insertlog->execute();
} else {
$template_file=$remotesql->error;
$pdelete=$sql->prepare("DELETE FROM `mysql_external_dbs` WHERE `id`=? AND `resellerid`=? LIMIT 1");
$pdelete->execute(array($id,$reseller_id));
$query=$sql->prepare("DELETE FROM `mysql_external_dbs` WHERE `id`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($id,$reseller_id));
}
}
} else {
$template_file='Error: '.$sprache->password;
$template_file='userpanel_404.tpl';
}
} else if ($ui->st('d','get')=='md' and $ui->id('id','30','get') and $pa['mysql']) {
if (!isset($action)) {
$id=$ui->id('id','30','get');
} 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');
$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) {
@ -345,15 +344,15 @@ if ($ui->w('action',4,'post') and !token(true)) {
$max_connections_per_hour=$row['max_connections_per_hour'];
$max_userconnections_per_hour=$row['max_userconnections_per_hour'];
}
$template_file="admin_mysql_db_md.tpl";
} else if ($action=='md') {
$template_file=(isset($active)) ? 'admin_mysql_db_md.tpl' : 'admin_404.tpl';
} else if ($ui->st('action','post')=='md') {
$errors=array();
if (!$ui->active('active','post')) $errors[]=$sprache->active;
if (!$ui->password('password',40,'post')) $errors[]=$sprache->password;
if (count($errors)>0) {
$template_file="Error: ".implode('<br>',$errors);
} else {
$id=$ui->id('id','30','get');
$id=$ui->id('id',10,'get');
$active=$ui->active('active','post');
$password=$ui->password('password',40,'post');
$ips=$ui->ips('ips','post');
@ -401,22 +400,22 @@ 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','30','get') and $pa['mysql']) {
if (!isset($action)) {
$id=$ui->id('id','30','get');
$pselect=$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");
$pselect->execute(array($id,$reseller_id));
foreach ($pselect->fetchall(PDO::FETCH_ASSOC) as $row) {
} 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');
$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) {
$ip=$row['ip'];
$dbname=$row['dbname'];
$cname=$row['cname'];
}
$template_file="admin_mysql_db_dl.tpl";
} else if ($action=='dl') {
$id=$ui->id('id','30','get');
$pselect=$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");
$pselect->execute(array($aeskey,$id,$reseller_id));
foreach ($pselect->fetchall(PDO::FETCH_ASSOC) as $row) {
$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');
$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) {
$sid=$row['sid'];
$uid=$row['uid'];
$dbname=$row['dbname'];
@ -425,19 +424,20 @@ if ($ui->w('action',4,'post') and !token(true)) {
$port=$row['port'];
$user=$row['user'];
$pwd=$row['decryptedpassword2'];
$remotesql=new ExternalSQL ($ip,$port,$user,$pwd);
if ($remotesql->error=='ok') {
$remotesql->DelDB($dbname);
$query=$sql->prepare("DELETE FROM `mysql_external_dbs` WHERE `id`=? AND `resellerid`=? LIMIT 1");
$query->execute(array($id,$reseller_id));
customColumns('D',$id,'del');
$template_file=$spracheResponse->table_del;
$loguseraction="%del% MYSQL DB $dbname ($ip)";
$insertlog->execute();
} else {
$template_file=$remotesql->error;
}
}
$remotesql=new ExternalSQL ($ip,$port,$user,$pwd);
if ($remotesql->error=='ok') {
$remotesql->DelDB($dbname);
$pupdate=$sql->prepare("DELETE FROM `mysql_external_dbs` WHERE `id`=? AND `resellerid`=? LIMIT 1");
$pupdate->execute(array($id,$reseller_id));
customColumns('D',$id,'del');
$template_file=$spracheResponse->table_del;
$loguseraction="%del% MYSQL DB $dbname ($ip)";
$insertlog->execute();
} else {
$template_file=$remotesql->error;
}
if (!isset($sid)) $template_file='userpanel_404.tpl';
} else {
$template_file='admin_404.tpl';
}

View File

@ -42,7 +42,7 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['cms_pages'])
}
$sprache=getlanguagefile('page',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype='admin';
$logreseller=0;
$logsubuser=0;

View File

@ -43,7 +43,7 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['cms_pages'])
}
$sprache=getlanguagefile('page',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
$logreseller=0;
$logsubuser=0;

View File

@ -41,7 +41,7 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['cms_news']) o
}
$sprache=getlanguagefile('page',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
$logreseller=0;
$logsubuser=0;

View File

@ -41,7 +41,7 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['cms_pages'])
}
$sprache=getlanguagefile('page',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
$logreseller=0;
$logsubuser=0;

View File

@ -41,7 +41,7 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['cms_settings'
}
$sprache=getlanguagefile('page',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
$logreseller=0;
$logsubuser=0;

View File

@ -41,7 +41,7 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['settings']))
$sprache=getlanguagefile('settings',$user_language,$reseller_id,$sql);
$gssprache=getlanguagefile('gserver',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
if ($reseller_id==0) {
$logreseller=0;

View File

@ -41,7 +41,7 @@ if ((!isset($admin_id) or !isset($reseller_id) or $main!=1) or (isset($admin_id)
redirect('admin.php');
}
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype='admin';
$logreseller=0;
$logsubuser=0;

View File

@ -43,7 +43,7 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['settings']))
$sprache=getlanguagefile('settings',$user_language,$reseller_id,$sql);
$gssprache=getlanguagefile('gserver',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
if ($reseller_id==0) {
$logreseller=0;

View File

@ -45,7 +45,7 @@ $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
$aeskey=$aesfilecvar['aeskey'];
$sprache=getlanguagefile('reseller',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype='admin';
if ($reseller_id==0) {
$logreseller=0;

View File

@ -45,7 +45,7 @@ $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
$aeskey=$aesfilecvar['aeskey'];
$sprache=getlanguagefile('reseller',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype='admin';
if ($reseller_id==0) {
$logreseller=0;

View File

@ -45,7 +45,7 @@ $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
$aeskey=$aesfilecvar['aeskey'];
$sprache=getlanguagefile('reseller',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype='admin';
if ($reseller_id==0) {
$logreseller=0;

View File

@ -45,7 +45,7 @@ $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
$aeskey=$aesfilecvar['aeskey'];
$sprache=getlanguagefile('reseller',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
if ($reseller_id==0) {
$logreseller=0;

View File

@ -44,7 +44,7 @@ $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
$aeskey=$aesfilecvar['aeskey'];
$sprache=getlanguagefile('reseller',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
$logreseller=0;
$logsubuser=0;

View File

@ -42,7 +42,7 @@ $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
$aeskey=$aesfilecvar['aeskey'];
$sprache=getlanguagefile('roots',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
if ($reseller_id==0) {
$logreseller=0;

View File

@ -45,7 +45,7 @@ $aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
$aeskey=$aesfilecvar['aeskey'];
$sprache=getlanguagefile('reseller',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype='admin';
if ($reseller_id==0) {
$logreseller=0;

View File

@ -180,11 +180,11 @@ if ($loguserip!='localhost') {
if (isset($elements[3]) and $elements[3]!='') $page_count=strtolower($elements[3]);
}
if (!isset($user_language) and isset($user_id) and isset($admin_id)) {
$user_language=language($admin_id,$sql);
$user_language=language($admin_id);
} else if(!isset($user_language) and isset($user_id) and !isset($admin_id)) {
$user_language=language($user_id,$sql);
$user_language=language($user_id);
} else if (!isset($user_language) and isset($admin_id)) {
$user_language=language($admin_id,$sql);
$user_language=language($admin_id);
}
if (isset($page_detect_language) and preg_match('/^[a-z]{2}+$/',$page_detect_language) and ((isset($_SESSION['language']) and $page_detect_language!=$_SESSION['language']) or !isset($_SESSION['language']))){
$language_changed=true;

View File

@ -40,7 +40,7 @@ if (!isset($admin_id) or $main!=1 or (isset($admin_id) and !$pa['tickets'])) {
}
$sprache=getlanguagefile('tickets',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
if ($reseller_id==0) {
$logreseller=0;

View File

@ -40,7 +40,7 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['usertickets']
}
$sprache=getlanguagefile('tickets',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
if ($reseller_id==0) {
$logreseller=0;
@ -146,7 +146,7 @@ if ($ui->st('d','get')=='ad') {
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$query2->execute(array($id,$resellerid));
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) {
$table[]=array('writedate'=>($user_language=='de') ? date('d.m.Y H:i:s',strtotime($row2['writeDate'])) : $row2['writeDate'],'ticket'=>nl2br(htmlspecialchars(stripslashes($row2['message']))),'writer'=>getusername($row2['userID'],$sql));
$table[]=array('writedate'=>($user_language=='de') ? date('d.m.Y H:i:s',strtotime($row2['writeDate'])) : $row2['writeDate'],'ticket'=>nl2br(htmlspecialchars(stripslashes($row2['message']))),'writer'=>getusername($row2['userID']));
}
if ($row['userPriority']==1) $priority=$sprache->priority_low;
else if ($row['userPriority']==2) $priority=$sprache->priority_medium;

View File

@ -43,7 +43,7 @@ $aeskey=$aesfilecvar['aeskey'];
$sprache=getlanguagefile('user',$user_language,$reseller_id,$sql);
$rsprache=getlanguagefile('reseller',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
if ($reseller_id==0) {
$logreseller=0;

View File

@ -44,7 +44,7 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['userGroups'])
$sprache=getlanguagefile('user',$user_language,$reseller_id,$sql);
$rsprache=getlanguagefile('reseller',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype='admin';
if ($reseller_id==0) {
$logreseller=0;

View File

@ -40,7 +40,7 @@ if ((!isset($user_id) or !$main == "1") or (isset($user_id) and !$pa['useraddons
}
$sprache=getlanguagefile('images',$user_language,$reseller_id,$sql);
$loguserid=$user_id;
$logusername=getusername($user_id,$sql);
$logusername=getusername($user_id);
$logusertype="user";
$logreseller=0;
if (isset($admin_id)) {
@ -96,7 +96,7 @@ if ($ui->id('id',10,'get') and $ui->id('adid',10,'get') and in_array($ui->smalll
$type=$row['type'];
$folder=$row['folder'];
}
$rdata=serverdata('root',$rootID,$aeskey,$sql);
$rdata=serverdata('root',$rootID,$aeskey);
$sship=$rdata['ip'];
$sshport=$rdata['port'];
$sshuser=$rdata['user'];
@ -167,7 +167,7 @@ if ($ui->id('id',10,'get') and $ui->id('adid',10,'get') and in_array($ui->smalll
$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']))) {
$username=getusername($user_id,$sql);
$username=getusername($user_id);
$switchID=$ui->id('id',19,'get');
$table=array();
$query=$sql->prepare("SELECT `language` FROM `settings` WHERE `resellerid`=? LIMIT 1");

View File

@ -42,7 +42,7 @@ $sprache=getlanguagefile('gserver',$user_language,$reseller_id,$sql);
if (isset($admin_id) and $reseller_id!=0 and $admin_id!=$reseller_id) {
$reseller_id=$admin_id;
}
$customer=getusername($user_id,$sql);
$customer=getusername($user_id);
$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
$aeskey=$aesfilecvar['aeskey'];
if ($ui->id('id',10,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id',10,'get'),$substituteAccess['gs']))) {
@ -66,7 +66,7 @@ if ($ui->id('id',10,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id
$template_file="userpanel_gserver_backup.tpl";
} else if ($ui->w('action',3,'post')=='mb'){
include(EASYWIDIR.'/stuff/ssh_exec.php');
$rdata=serverdata('root',$rootid,$aeskey,$sql);
$rdata=serverdata('root',$rootid,$aeskey);
$sship=$rdata['ip'];
$sshport=$rdata['port'];
$sshuser=$rdata['user'];
@ -97,7 +97,7 @@ if ($ui->id('id',10,'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id
$template_file="userpanel_gserver_backup_rb.tpl";
} else if ($ui->w('action',3,'post')=='rb2' and $ui->gamestring('template','post')){
include(EASYWIDIR.'/stuff/ssh_exec.php');
$rdata=serverdata('root',$rootid,$aeskey,$sql);
$rdata=serverdata('root',$rootid,$aeskey);
$sship=$rdata['ip'];
$sshport=$rdata['port'];
$sshuser=$rdata['user'];

View File

@ -43,7 +43,7 @@ if ((!isset($main) or $main!=1) or (!isset($user_id) or (isset($user_id) and !$p
}
$sprache=getlanguagefile('reseller',$user_language,$reseller_id,$sql);
$loguserid=$user_id;
$logusername=getusername($user_id,$sql);
$logusername=getusername($user_id);
$logusertype="user";
$logreseller=0;
$logsubuser=0;

View File

@ -40,7 +40,7 @@ if ((!isset($user_id) or !$main == "1") or (isset($user_id) and !$pa['fastdl']))
}
$sprache=getlanguagefile('fastdl',$user_language,$reseller_id,$sql);
$loguserid=$user_id;
$logusername=getusername($user_id,$sql);
$logusername=getusername($user_id);
$logusertype="user";
$logreseller=0;
if (isset($admin_id) and $reseller_id!=0 and $admin_id!=$reseller_id) {
@ -88,14 +88,14 @@ if ($ui->st('d','get')=='ud' and $ui->id('id',19,'get') and (!isset($_SESSION['s
}
if ($ftpupload!="") {
include(EASYWIDIR."/stuff/ssh_exec.php");
$rdata=serverdata('root',$rootid,$aeskey,$sql);
$rdata=serverdata('root',$rootid,$aeskey);
$sship=$rdata['ip'];
$sshport=$rdata['port'];
$sshuser=$rdata['user'];
$sshpass=$rdata['pass'];
if ($row['newlayout']=='Y') $customer=$customer.'-'.$serverid;
$serverfolder=$serverip."_"."$port/$shorten$servertemplate";
if(ssh2_execute('gs',$rootid,"sudo -u ${customer} screen -dmS $port.sync ./control.sh fastdl $customer $serverfolder \"$ftpupload\" $modfolder")===false) {
if(ssh2_execute('gs',$rootid,"sudo -u ${customer} ./control.sh fastdl ${customer} ${serverfolder} \"${ftpupload}\" ${modfolder}")===false) {
$template_file=$spracheResponse->error_server;
$actionstatus="fail";
} else {

View File

@ -40,7 +40,7 @@ if ((!isset($main) or $main!=1) or (!isset($user_id) or (isset($user_id) and !$p
}
$sprache=getlanguagefile('gserver',$user_language,$reseller_id,$sql);
$loguserid=$user_id;
$logusername=getusername($user_id,$sql);
$logusername=getusername($user_id);
$logusertype="user";
$logreseller=0;
if (isset($admin_id)) {
@ -96,7 +96,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
}
if (isset($gsfolder) and count($gamestring)>0 and $ui->active('type','post')) {
$gamestring=count($gamestring).'_'.implode('_',$gamestring);
$rdata=serverdata('root',$rootID,$aeskey,$sql);
$rdata=serverdata('root',$rootID,$aeskey);
$sship=$rdata['ip'];
$sshport=$rdata['port'];
$sshuser=$rdata['user'];
@ -359,7 +359,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
}
}
if ($ftppass!=$oldPass) {
$rdata=serverdata('root',$rootID,$aeskey,$sql);
$rdata=serverdata('root',$rootID,$aeskey);
$sship=$rdata['ip'];
$sshport=$rdata['port'];
$sshuser=$rdata['user'];
@ -413,7 +413,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
$configCheck=array();
$query=$sql->prepare("SELECT g.`protected`,t.`configs`,s.`id` FROM `gsswitch` g INNER JOIN `serverlist` s ON g.`serverid`=s.`id` INNER JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE g.`id`=? AND g.`userid`=? AND g.`resellerid`=? LIMIT 1");
$query->execute(array($id,$user_id,$reseller_id));
$customer=getusername($user_id,$sql);
$customer=getusername($user_id);
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$serverID=$row['id'];
$protected=$row['protected'];

View File

@ -34,7 +34,7 @@
* Sie sollten eine Kopie der GNU General Public License zusammen mit diesem
* Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
*/
if ((!isset($user_id) or !$main == "1") or (isset($user_id) and !isanyuser($user_id,$sql))) {
if ((!isset($user_id) or !$main == "1") or (isset($user_id) and !isanyuser($user_id))) {
header('Location: login.php');
die('No acces');
}
@ -57,7 +57,7 @@ $i_tag_removed=0;
$crashedArray=array('gsCrashed'=>0,'gsPWD'=>0,'gsTag'=>0,'ticketsOpen'=>0,'tickets'=>0,'ts3'=>0);
$query=$sql->prepare("SELECT `stopped`,`serverid`,CONCAT(`serverip`,':',`port`) AS `server`,`userid`,`war`,`brandname`,`queryName`,`queryPassword` FROM `gsswitch` WHERE `active`='Y' AND `userid`=? AND `resellerid`=?");
$query->execute(array($user_id,$reseller_id));
$customer=getusername($user_id,$sql);
$customer=getusername($user_id);
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$war=$row['war'];
$brandname=$row['brandname'];
@ -73,7 +73,7 @@ foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
$crashedArray['gsCrashed']++;
}
if (isset($name) and $name!="" and $row['stopped']=='N' and $name!="OFFLINE" and $brandname=="Y" and isset($reseller_brandname) and $reseller_brandname!="" and strpos(strtolower($name), strtolower($reseller_brandname)) === false) {
$tag_removed[]=array('userid'=>$row['userid'],'username'=>getusername($row['userid'],$sql),'address'=>$row['server']);
$tag_removed[]=array('userid'=>$row['userid'],'username'=>getusername($row['userid']),'address'=>$row['server']);
$i_tag_removed++;
$crashedArray['gsTag']++;
}

View File

@ -53,7 +53,7 @@ foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
} else {
$query2->execute(array($subuser));
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row2) {
if (isanyadmin($subuser,$sql) and !isset($admin_id)) {
if (isanyadmin($subuser) and !isset($admin_id)) {
$username=$row2['cname'];
$ip="";
} else {

View File

@ -45,7 +45,7 @@ $sprache=getlanguagefile('gserver',$user_language,$reseller_id,$sql);
$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");
$aeskey=$aesfilecvar['aeskey'];
$loguserid=$user_id;
$logusername=getusername($user_id,$sql);
$logusername=getusername($user_id);
$logusertype="user";
$logreseller=0;
$logsubuser=0;
@ -203,7 +203,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
}
if (count($error)==0 and isset($rootID)) {
include(EASYWIDIR.'/stuff/ssh_exec.php');
$rdata=serverdata('root',$rootID,$aeskey,$sql);
$rdata=serverdata('root',$rootID,$aeskey);
$sship=$rdata['ip'];
$sshport=$rdata['port'];
$sshuser=$rdata['user'];

View File

@ -40,7 +40,7 @@ if ((!isset($user_id) or $main!=1) or (isset($user_id) and !$pa['mysql'])) {
}
$sprache=getlanguagefile('mysql',$user_language,$reseller_id,$sql);
$loguserid=$user_id;
$logusername=getusername($user_id,$sql);
$logusername=getusername($user_id);
$logusertype="user";
$logreseller=0;
$aesfilecvar=getconfigcvars(EASYWIDIR."/stuff/keyphrasefile.php");

View File

@ -37,7 +37,7 @@
if ((!isset($user_id) or $main!=1) or (isset($user_id) and !$pa['restart']) or !$ui->id('id',10,'get')) redirect('userpanel.php');
$sprache=getlanguagefile('gserver',$user_language,$reseller_id,$sql);
$loguserid=$user_id;
$logusername=getusername($user_id,$sql);
$logusername=getusername($user_id);
$logusertype="user";
$logreseller=0;
if (isset($admin_id)) {
@ -117,7 +117,7 @@ if ($query->rowCount()==0 or (isset($pallowed) and $pallowed=='N') or (isset($_S
}
}
}
$rdata=serverdata('root',$rootid,$aeskey,$sql);
$rdata=serverdata('root',$rootid,$aeskey);
$sship=$rdata['ip'];
$sshport=$rdata['port'];
$sshuser=$rdata['user'];

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,$sql);
$loguserid=$user_id;
$logusername=getusername($user_id,$sql);
$logusername=getusername($user_id);
$logusertype="admin";
$logreseller="0";
$logsubuser="0";

View File

@ -44,7 +44,7 @@ if ((!isset($main) or $main!=1) or (!isset($user_id) or (isset($user_id) and !$p
}
$sprache=getlanguagefile('reseller',$user_language,$reseller_id,$sql);
$loguserid=$user_id;
$logusername=getusername($user_id,$sql);
$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['voiceserve
}
$sprache=getlanguagefile('voice',$user_language,$reseller_id,$sql);
$loguserid=$user_id;
$logusername=getusername($user_id,$sql);
$logusername=getusername($user_id);
$logusertype='user';
$logreseller=0;
if (isset($admin_id)) {

View File

@ -38,7 +38,7 @@
*/
$sprache=getlanguagefile('voice',$user_language,$reseller_id,$sql);
$loguserid=$user_id;
$logusername=getusername($user_id,$sql);
$logusername=getusername($user_id);
$logusertype='user';
$logreseller=0;
if (isset($admin_id)) {
@ -60,7 +60,7 @@ if ($ui->w('action',4,'post') and !token(true)) {
$dns=$row['dns'];
$ip=$row['ip'];
$port=$row['port'];
$defaultdns=strtolower($row['dnsID'].'-'.getusername($user_id,$sql).$row['defaultdns']);
$defaultdns=strtolower($row['dnsID'].'-'.getusername($user_id).$row['defaultdns']);
}
if (isset($dns)) {
$template_file='userpanel_voiceserver_dns_md.tpl';

View File

@ -40,7 +40,7 @@ if ((!isset($admin_id) or $main!=1) or $reseller_id!=0 or !$pa['updateEW']) {
die;
}
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$sprache=getlanguagefile('licence',$user_language,$reseller_id,$sql);
$logusertype="admin";
$logreseller=0;

View File

@ -40,7 +40,7 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['voiceserver']
}
$sprache=getlanguagefile('voice',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
if ($reseller_id==0) {
$logreseller=0;
@ -315,7 +315,7 @@ if ($ui->st('d','get')=='ad' and is_numeric($licenceDetails['lVo']) and $licence
if ($active=='N') {
$connection->StopServer($virtualserver_id);
}
$username=strtolower(getusername($customer,$sql));
$username=strtolower(getusername($customer));
$connection->CloseConnection();
$pinsert=$sql->prepare("INSERT INTO `voice_server` (`active`,`backup`,`lendserver`,`userid`,`masterserver`,`ip`,`port`,`slots`,`initialpassword`,`password`,`forcebanner`,`forcebutton`,`forceservertag`,`forcewelcome`,`max_download_total_bandwidth`,`max_upload_total_bandwidth`,`localserverid`,`dns`,`maxtraffic`,`serverCreated`,`flexSlots`,`flexSlotsFree`,`flexSlotsPercent`,`autoRestart`,`externalID`,`resellerid`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,NOW(),?,?,?,?,?,?)");
$pinsert->execute(array($active,$backup,$lendserver,$customer,$masterserver,$ip,$port,$slots,$initialpassword,$password,$forcebanner,$forcebutton,$forceservertag,$forcewelcome,$max_download_total_bandwidth,$max_upload_total_bandwidth,$virtualserver_id,$dns,$maxtraffic,$flexSlots,$flexSlotsFree,$flexSlotsPercent,$autoRestart,$ui->w('externalID',255,'post'),$reseller_id));

View File

@ -42,7 +42,7 @@ if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['voicemasterse
}
$sprache=getlanguagefile('voice',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
if ($reseller_id==0) {
$logreseller=0;

View File

@ -40,7 +40,7 @@
if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['voiceserver'])) redirect('admin.php');
$sprache=getlanguagefile('voice',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
if ($reseller_id==0) {
$logreseller=0;

View File

@ -40,7 +40,7 @@
if ((!isset($admin_id) or $main!=1) or (isset($admin_id) and !$pa['voiceserver'])) redirect('admin.php');
$sprache=getlanguagefile('voice',$user_language,$reseller_id,$sql);
$loguserid=$admin_id;
$logusername=getusername($admin_id,$sql);
$logusername=getusername($admin_id);
$logusertype="admin";
if ($reseller_id==0) {
$logreseller=0;

View File

@ -42,7 +42,7 @@
<dt><?php echo $sprache->ramMax;?></dt>
<dd><?php echo $table_row['maxram'];?> MB</dd>
<?php } ?>
<?php if($table_row['taskset']==Y and $table_row['coreCount']>0) { ?>
<?php if($table_row['taskset']=='Y' and $table_row['coreCount']>0) { ?>
<dt><?php echo $sprache->coreBind;?></dt>
<dd><?php echo $table_row['cores'].' ('.$table_row['coreCount'].')';?></dd>
<?php } ?>

View File

@ -13,8 +13,6 @@
<input type="hidden" name="token" value="<?php echo token();?>">
<div class="row-fluid">
<dl class="dl-horizontal">
<dt><?php echo $sprache->interface;?></dt>
<dd><a href="<?php echo $interface;?>" target="_blank"><?php echo $interface;?></a></dd>
<dt>IP</dt>
<dd><?php echo $ip;?></dd>
<dt>Port</dt>
@ -23,6 +21,8 @@
<dd><?php echo $dbname;?></dd>
<dt><?php echo $sprache->dbname;?></dt>
<dd><?php echo $dbname;?></dd>
<dt><?php echo $sprache->interface;?></dt>
<dd><a href="<?php echo $interface;?>" target="_blank"><?php echo $interface;?></a></dd>
</dl>
</div>
<div class="control-group">