Moved the Agents into their own repo. Kept the agent.pl just for reference
This commit is contained in:
parent
22381be29a
commit
8680a02b13
18132 changed files with 0 additions and 2569420 deletions
|
|
@ -1,125 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($sid===false OR empty($sid)) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
|
||||
$error='';
|
||||
$noerror='';
|
||||
$files='';
|
||||
|
||||
if(isset($_POST['hostbackup']))
|
||||
{
|
||||
$path="site/backups/channel/hostbackups/";
|
||||
}
|
||||
else
|
||||
{
|
||||
$path="site/backups/channel/";
|
||||
}
|
||||
|
||||
if(isset($_POST['create']))
|
||||
{
|
||||
$filename="channel_".time()."_".$_SESSION['server_ip']."-".$whoami['virtualserver_port'].".txt";
|
||||
$channellist=$ts3->channelList("-topic -flags -voice -limits");
|
||||
foreach($channellist['data'] AS $key=>$value)
|
||||
{
|
||||
$channelinfo=$ts3->getElement('data', $ts3->channelInfo($value['cid']));
|
||||
unset($channelinfo['channel_password']);
|
||||
unset($channelinfo['channel_filepath']);
|
||||
foreach($channelinfo AS $key2=>$value2)
|
||||
{
|
||||
if(!isset($channellist['data'][$key][$key2]))
|
||||
{
|
||||
$channellist['data'][$key][$key2]=$value2;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($channellist['success']!==false)
|
||||
{
|
||||
if(channel_backup_create($path.$filename, $channellist['data'])===true)
|
||||
{
|
||||
$noerror .= $lang['chanbackupcreate'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$error .= $lang['chanbackupcreateerror'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error .= $lang['errorchannellist']."<br />".$channellist['errors'][0];
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['deploy']))
|
||||
{
|
||||
$filename="channel_".$_POST['backupid']."_".$_POST['fileport'].".txt";
|
||||
$channellist=$ts3->channelList("-topic -flags -voice -limits");
|
||||
$backup=channel_backup_deploy($path.$filename);
|
||||
if($backup===false)
|
||||
{
|
||||
$error .= $lang['chanbackupdeployerror'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(channel_backup_deploy_action($channellist['data'], 0, $backup, 0)===false)
|
||||
{
|
||||
$error .= $lang['chanbackupdeployerror'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$noerror .= $lang['chanbackupdeploy'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['delete']))
|
||||
{
|
||||
if(@!unlink($path."channel_".$_POST['backupid']."_".$_POST['fileport'].".txt"))
|
||||
{
|
||||
$error .= $lang['chanbackupdelerror'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$noerror .= $lang['chanbackupdel'];
|
||||
}
|
||||
}
|
||||
|
||||
$handler=opendir("site/backups/channel/");
|
||||
while($datei=readdir($handler))
|
||||
{
|
||||
if($datei!='.' AND $datei!='..' AND $datei!='hostbackups')
|
||||
{
|
||||
$datei=str_replace('.txt', '', $datei);
|
||||
$datei_info=explode('_', $datei);
|
||||
$files[0][]=array("timestamp"=>$datei_info[1], "server"=>$datei_info[2]);
|
||||
}
|
||||
}
|
||||
|
||||
$handler=opendir("site/backups/channel/hostbackups/");
|
||||
while($datei=readdir($handler))
|
||||
{
|
||||
if($datei!='.' AND $datei!='..')
|
||||
{
|
||||
$datei=str_replace('.txt', '', $datei);
|
||||
$datei_info=explode('_', $datei);
|
||||
$files[1][]=array("timestamp"=>$datei_info[1], "server"=>$datei_info[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("files", $files);
|
||||
?>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
ErrorDocument 403 "<h1>Fehler 403</h1><p>Sie haben keinen Zugriff auf dieses Verzeichnis!</p>"
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($sid===false OR empty($sid)) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
|
||||
$error='';
|
||||
$noerror='';
|
||||
|
||||
if (isset($_POST['addban']))
|
||||
{
|
||||
if(isset($_POST['banip']) AND !empty($_POST['banip']))
|
||||
{
|
||||
$ban_add=$ts3->BanAddByIp($_POST['banip'], $_POST['bantime'], $_POST['reason']);
|
||||
}
|
||||
if(isset($_POST['banuid']) AND !empty($_POST['banuid']))
|
||||
{
|
||||
$ban_add=$ts3->BanAddByUid($_POST['banuid'], $_POST['bantime'], $_POST['reason']);
|
||||
}
|
||||
if(isset($_POST['banname']) AND !empty($_POST['banname']))
|
||||
{
|
||||
$ban_add=$ts3->BanAddByName($_POST['banname'], $_POST['bantime'], $_POST['reason']);
|
||||
}
|
||||
if(isset($ban_add))
|
||||
{
|
||||
if($ban_add['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['banaddok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($ban_add['errors']); $i++)
|
||||
{
|
||||
$error .= $ban_add['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($sid===false OR empty($sid)) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
|
||||
$error='';
|
||||
$noerror='';
|
||||
|
||||
if (isset($_POST['unban']))
|
||||
{
|
||||
$ban_delete=$ts3->banDelete($_POST['banid']);
|
||||
|
||||
if($ban_delete['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['bandelok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($ban_delete['errors']); $i++)
|
||||
{
|
||||
$error .= $ban_delete['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$banlist=$ts3->getElement('data', $ts3->banList());
|
||||
}
|
||||
|
||||
if(!empty($banlist))
|
||||
{
|
||||
foreach($banlist AS $key=>$value)
|
||||
{
|
||||
$banlist[$key]=secure($banlist[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("banlist", $banlist);
|
||||
?>
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
|
||||
if($sid===false OR empty($sid)) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
$banlist=$ts3->getElement('data', $ts3->banList());
|
||||
|
||||
$banexport='';
|
||||
if(!empty($banlist))
|
||||
{
|
||||
foreach($banlist AS $value)
|
||||
{
|
||||
if(isset($value['ip']) AND !empty($value['ip']))
|
||||
{
|
||||
$bantype="ip=".$value['ip'];
|
||||
}
|
||||
elseif(isset($value['name']) AND !empty($value['name']))
|
||||
{
|
||||
$bantype="name=".$value['name'];
|
||||
}
|
||||
elseif(isset($value['uid']) AND !empty($value['uid']))
|
||||
{
|
||||
$bantype="uid=".$value['uid'];
|
||||
}
|
||||
|
||||
if(!isset($value['duration']))
|
||||
{
|
||||
$banlength=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$banlength=$value['duration'];
|
||||
}
|
||||
|
||||
$banexport.="banadd ".$bantype." time=".$banlength." banreason=".str_replace(' ', '\s', $value['reason'])."\n";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("banexport", secure($banexport));
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
|
||||
$error='';
|
||||
$noerror='';
|
||||
|
||||
if(isset($_POST['addgroup']))
|
||||
{
|
||||
if(!empty($_POST['name']))
|
||||
{
|
||||
if(!empty($_POST['copyfrom']))
|
||||
{
|
||||
empty($_POST['type']) ? $type=0:$type=$_POST['type'];
|
||||
$creategroup=$ts3->channelGroupCopy($_POST['copyfrom'], $_POST['overwrite'], $_POST['name'], $type);
|
||||
if($creategroup['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['groupcreatedok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($creategroup['errors']); $i++)
|
||||
{
|
||||
$error .= $creategroup['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$creategroup=$ts3->channelGroupAdd($_POST['name']);
|
||||
if($creategroup['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['groupcreatedok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($creategroup['errors']); $i++)
|
||||
{
|
||||
$error .= $creategroup['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error .= $lang['groupnameempty']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
$channelgroups=$ts3->getElement('data', $ts3->channelGroupList());
|
||||
if(!empty($channelgroups))
|
||||
{
|
||||
foreach($channelgroups AS $key => $value)
|
||||
{
|
||||
$channelgroups[$key]=secure($channelgroups[$key]);
|
||||
if ($hoststatus===false AND $value['type']=='0')
|
||||
{
|
||||
unset($channelgroups[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("channelgroups", $channelgroups);
|
||||
?>
|
||||
|
|
@ -1,141 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($sid===false OR empty($sid)) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
|
||||
$error='';
|
||||
$noerror='';
|
||||
if(isset($_POST['addclient']))
|
||||
{
|
||||
$setclient_cgroup=$ts3->setClientChannelGroup($cgid, $_POST['cid'], $_POST['cldbid']);
|
||||
if($setclient_cgroup['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['clientaddok'];
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($setclient_cgroup['errors']); $i++)
|
||||
{
|
||||
$error .= $setclient_cgroup['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['switchgroup']))
|
||||
{
|
||||
$setclient_cgroup=$ts3->setClientChannelGroup($_POST['cgid'], $_POST['cid'], $_POST['cldbid']);
|
||||
if($setclient_cgroup['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['clientaddok'];
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($setclient_cgroup['errors']); $i++)
|
||||
{
|
||||
$error .= $setclient_cgroup['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
$channelgroups=$ts3->getElement('data', $ts3->channelGroupList());
|
||||
|
||||
$groupclients=$ts3->getElement('data', $ts3->channelGroupClientList('', '', $cgid));
|
||||
|
||||
$channellist=$ts3->getElement('data', $ts3->channelList());
|
||||
|
||||
$start_while=0;
|
||||
$duration_while=100;
|
||||
while($clientdblist=$ts3->getElement('data', $ts3->clientDbList($start_while, $duration_while)))
|
||||
{
|
||||
|
||||
if(!empty($groupclients))
|
||||
{
|
||||
foreach($groupclients AS $key => $value)
|
||||
{
|
||||
foreach($clientdblist AS $key2=>$value2)
|
||||
{
|
||||
if($value['cldbid']==$value2['cldbid'])
|
||||
{
|
||||
$groupclients[$key]['client_unique_identifier']=$value2['client_unique_identifier'];
|
||||
$groupclients[$key]['client_nickname']=secure($value2['client_nickname']);
|
||||
$groupclients[$key]['client_created']=$value2['client_created'];
|
||||
$groupclients[$key]['client_lastconnected']=$value2['client_lastconnected'];
|
||||
}
|
||||
}
|
||||
|
||||
foreach($channellist AS $key3 => $value3)
|
||||
{
|
||||
if($value['cid'] == $value3['cid'])
|
||||
{
|
||||
$groupclients[$key]['channel_name']=$value3['channel_name'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$start_while=$start_while+$duration_while;
|
||||
}
|
||||
if(isset($_POST['searchby']) AND $_POST['searchby']=='cldbid' AND !empty($_POST['search']))
|
||||
{
|
||||
if(!empty($groupclients))
|
||||
{
|
||||
foreach ($groupclients AS $key => $value)
|
||||
{
|
||||
if($_POST['search']!=$value['cldbid'])
|
||||
{
|
||||
unset($groupclients[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif(isset($_POST['searchby']) AND $_POST['searchby']=='name' AND !empty($_POST['search']))
|
||||
{
|
||||
if(!empty($groupclients))
|
||||
{
|
||||
foreach ($groupclients AS $key => $value)
|
||||
{
|
||||
if(strpos(strtolower($value['client_nickname']),strtolower($_POST['search']))===false)
|
||||
{
|
||||
unset($groupclients[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($channelgroups AS $key=>$value)
|
||||
{
|
||||
$channelgroups[$key]=secure($channelgroups[$key]);
|
||||
if($cgid==$value['cgid'])
|
||||
{
|
||||
$cgroupid=$value['cgid'];
|
||||
$cgroupname=secure($value['name']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($channellist))
|
||||
{
|
||||
foreach($channellist AS $key=>$value)
|
||||
{
|
||||
$channellist[$key]=secure($channellist[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("channellist", $channellist);
|
||||
$smarty->assign("groupclients", $groupclients);
|
||||
$smarty->assign("channelgroups", $channelgroups);
|
||||
$smarty->assign("cgroupid", $cgroupid);
|
||||
$smarty->assign("cgroupname", $cgroupname);
|
||||
?>
|
||||
|
|
@ -1,176 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($sid===false OR empty($sid)) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
|
||||
$serverinfo=$ts3->getElement('data', $ts3->serverInfo());
|
||||
$get_build=explode(' ', $serverinfo['virtualserver_version']);
|
||||
$get_build=str_replace(']', '', $get_build[2]);
|
||||
|
||||
if(isset($_POST['showmyperms']) AND $_POST['showmyperms']==1)
|
||||
{
|
||||
$showmyperms=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$showmyperms=0;
|
||||
}
|
||||
|
||||
if($showmyperms==1 or !empty($_POST['searchperms']))
|
||||
{
|
||||
$display="block";
|
||||
$disp_pic="minus";
|
||||
}
|
||||
else
|
||||
{
|
||||
$display="none";
|
||||
$disp_pic="plus";
|
||||
}
|
||||
|
||||
$channelgroups=$ts3->channelGroupList();
|
||||
|
||||
foreach($channelgroups['data'] AS $value)
|
||||
{
|
||||
if($cgid==$value['cgid'])
|
||||
{
|
||||
$cgroupname=$value['name'];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['editall']))
|
||||
{
|
||||
$delperms=array();
|
||||
$editperms=array();
|
||||
$allpermsedit=$_POST['perm'];
|
||||
|
||||
|
||||
foreach($allpermsedit AS $key => $value)
|
||||
{
|
||||
if(isset($_POST['granttoall']) AND isset($value['grant']) AND $value['grant']==1 AND isset($value['available']))
|
||||
{
|
||||
if($_POST['granttoall']===0 OR $_POST['granttoall']>0)
|
||||
{
|
||||
$value['value']=$_POST['granttoall'];
|
||||
}
|
||||
}
|
||||
if(isset($value['delperm']) AND $value['delperm']==1)
|
||||
{
|
||||
$delperms[]=$key;
|
||||
}
|
||||
elseif(isset($value['grant']) AND $value['grant']==1 AND !isset($value['available']) AND $value['value']==0)
|
||||
{
|
||||
|
||||
}
|
||||
elseif(isset($value['available']) OR !isset($value['available']) AND !empty($value['value']))
|
||||
{
|
||||
(!isset($value['value']) or empty($value['value'])) ? $editperms[$key]='0' : $editperms[$key]=$value['value'];
|
||||
}
|
||||
}
|
||||
|
||||
$cgrouplist=$ts3->getElement('data', $ts3->channelGroupPermList($cgid));
|
||||
foreach($cgrouplist AS $value)
|
||||
{
|
||||
foreach($editperms AS $key2=>$value2)
|
||||
{
|
||||
if($value['permid']==$key2 AND $value['permvalue']==$value2[0])
|
||||
{
|
||||
unset($editperms[$key2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($editperms))
|
||||
{
|
||||
$ts3->channelGroupAddPerm($cgid, $editperms);
|
||||
$debug=$ts3->getDebugLog();
|
||||
foreach($debug AS $key=>$value)
|
||||
{
|
||||
$error.=$value."<br />";
|
||||
}
|
||||
}
|
||||
if(!empty($delperms))
|
||||
{
|
||||
$ts3->channelGroupDelPerm($cgid, $delperms);
|
||||
$debug=$ts3->getDebugLog();
|
||||
foreach($debug AS $key=>$value)
|
||||
{
|
||||
$error.=$value."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$cgrouplist=$ts3->getElement('data', $ts3->channelGroupPermList($cgid));
|
||||
|
||||
$allperms=$ts3->permissionList(true);
|
||||
|
||||
if(!empty($allperms))
|
||||
{
|
||||
if(!empty($cgrouplist))
|
||||
{
|
||||
foreach($cgrouplist AS $key => $value)
|
||||
{
|
||||
foreach($allperms AS $key2 => $value2)
|
||||
{
|
||||
if(isset($value2['permissions']))
|
||||
{
|
||||
foreach($value2['permissions'] AS $key3=>$value3)
|
||||
{
|
||||
if($value['permid']==$value3['permid'])
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['available']=1;
|
||||
$allperms[$key2]['permissions'][$key3]['permvalue']=$value['permvalue'];
|
||||
}
|
||||
elseif(!isset($allperms[$key2]['permissions'][$key3]['permvalue']))
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['available']=0;
|
||||
$allperms[$key2]['permissions'][$key3]['permvalue']=0;
|
||||
}
|
||||
if($value['permid']==$value3['grantpermid'])
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['grantav']=1;
|
||||
$allperms[$key2]['permissions'][$key3]['grant']=$value['permvalue'];
|
||||
}
|
||||
elseif(!isset($allperms[$key2]['permissions'][$key3]['grant']))
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['grantav']=0;
|
||||
$allperms[$key2]['permissions'][$key3]['grant']=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error.="The permissions can't show complete because you don't have the permission to see the list!<br />Needed Permission: b_serverinstance_permission_list<br />";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(isset($_POST['searchperms']))
|
||||
{
|
||||
$smarty->assign("searchperms", trim($_POST['searchperms']));
|
||||
}
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("showmyperms", $showmyperms);
|
||||
$smarty->assign("display", $display);
|
||||
$smarty->assign("disp_pic", $disp_pic);
|
||||
$smarty->assign("cgroupname", secure($cgroupname));
|
||||
$smarty->assign("allperms", $allperms);
|
||||
$smarty->assign("build", $get_build);
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($sid===false OR empty($sid)) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
|
||||
$error='';
|
||||
$noerror='';
|
||||
if(isset($_POST['sendname']))
|
||||
{
|
||||
if(!empty($_POST['name']))
|
||||
{
|
||||
$cgroup_rename=$ts3->channelGroupRename($cgid, $_POST['name']);
|
||||
if($cgroup_rename['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['groupnameeditok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($cgroup_rename['errors']); $i++)
|
||||
{
|
||||
$error .= $cgroup_rename['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error .= $lang['groupnameempty']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['delgroup']))
|
||||
{
|
||||
$cgroup_delete=$ts3->channelGroupDelete($cgid);
|
||||
if($cgroup_delete['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['groupremoveok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($cgroup_delete['errors']); $i++)
|
||||
{
|
||||
$error .= $cgroup_delete['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$channelgroups=$ts3->getElement('data', $ts3->channelGroupList());
|
||||
|
||||
if(!empty($channelgroups))
|
||||
{
|
||||
foreach($channelgroups AS $key => $value)
|
||||
{
|
||||
$channelgroups[$key]=secure($channelgroups[$key]);
|
||||
if ($hoststatus===false AND $value['type']=='0')
|
||||
{
|
||||
unset($channelgroups[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("channelgroups", $channelgroups);
|
||||
}
|
||||
?>
|
||||
|
|
@ -1 +0,0 @@
|
|||
<?php
/*
*Copyright (C) 2012-2013 Psychokiller
*
*This program is free software; you can redistribute it and/or modify it under the terms of
*the GNU General Public License as published by the Free Software Foundation; either
*version 3 of the License, or any later version.
*
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*See the GNU General Public License for more details.
*
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
error_reporting(E_ALL & ~E_NOTICE);
require("../functions.inc.php");
?>
<html>
<head>
<link rel="stylesheet" href="../gfx/tsviewpub.css" type="text/css" media="screen" />
</head>
<body onload="window.resizeTo(500, 600)">
<?php
if(isset($_GET['hostbackup']))
{
$path="backups/channel/hostbackups/";
}
else
{
$path="backups/channel/";
}
$filename="channel_".$_GET['backupid']."_".$_GET['fileport'].".txt";
$backup=channel_backup_deploy($path.$filename);
?>
<div class='content'>
<?php
echo create_channel_tree(0, "<div class='place'> </div>" ,$backup);
?>
</div>
</body>
</html>
|
||||
|
|
@ -1,164 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
|
||||
$serverinfo=$ts3->getElement('data', $ts3->serverInfo());
|
||||
$get_build=explode(' ', $serverinfo['virtualserver_version']);
|
||||
$get_build=str_replace(']', '', $get_build[2]);
|
||||
|
||||
if(isset($_POST['cid']) AND isset($_POST['cldbid']))
|
||||
{
|
||||
$channelinfo=$ts3->getElement('data', $ts3->channelInfo($_POST['cid']));
|
||||
$channelname=$channelinfo['channel_name'];
|
||||
|
||||
$clientname=$ts3->getElement('data', $ts3->clientGetNameFromDbid($_POST['cldbid']));
|
||||
$clientname=$clientname['name'];
|
||||
|
||||
if(isset($_POST['showmyperms']) AND $_POST['showmyperms']==1)
|
||||
{
|
||||
$showmyperms=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$showmyperms=0;
|
||||
}
|
||||
|
||||
if($showmyperms==1 or !empty($_POST['searchperms']))
|
||||
{
|
||||
$display="block";
|
||||
$disp_pic="minus";
|
||||
}
|
||||
else
|
||||
{
|
||||
$display="none";
|
||||
$disp_pic="plus";
|
||||
}
|
||||
|
||||
if (isset($_POST['editall']))
|
||||
{
|
||||
|
||||
$delperms=array();
|
||||
$editperms=array();
|
||||
$allpermsedit=$_POST['perm'];
|
||||
|
||||
foreach($allpermsedit AS $key => $value)
|
||||
{
|
||||
if(isset($_POST['granttoall']) AND isset($value['grant']) AND $value['grant']==1 AND isset($value['available']))
|
||||
{
|
||||
if($_POST['granttoall']===0 OR $_POST['granttoall']>0)
|
||||
{
|
||||
$value['value']=$_POST['granttoall'];
|
||||
}
|
||||
}
|
||||
if(isset($value['delperm']) AND $value['delperm']==1)
|
||||
{
|
||||
$delperms[]=$key;
|
||||
}
|
||||
elseif(isset($value['grant']) AND $value['grant']==1 AND !isset($value['available']) AND $value['value']==0)
|
||||
{
|
||||
|
||||
}
|
||||
elseif(isset($value['available']) OR !isset($value['available']) AND !empty($value['value']))
|
||||
{
|
||||
(!isset($value['value']) or empty($value['value'])) ? $editperms[$key]='0' : $editperms[$key]=$value['value'];
|
||||
}
|
||||
}
|
||||
|
||||
$chanclientpermlist=$ts3->getElement('data', $ts3->channelClientPermList($_POST['cid'], $_POST['cldbid']));
|
||||
if(!empty($chanclientpermlist))
|
||||
{
|
||||
foreach($chanclientpermlist AS $value)
|
||||
{
|
||||
foreach($editperms AS $key2=>$value2)
|
||||
{
|
||||
if($value['permid']==$key2 AND $value['permvalue']==$value2[0])
|
||||
{
|
||||
unset($editperms[$key2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($editperms))
|
||||
{
|
||||
$ts3->channelClientAddPerm($_POST['cid'], $_POST['cldbid'], $editperms);
|
||||
}
|
||||
if(!empty($delperms))
|
||||
{
|
||||
$ts3->channelClientDelPerm($_POST['cid'], $_POST['cldbid'], $delperms);
|
||||
}
|
||||
}
|
||||
|
||||
$chanclientpermlist=$ts3->getElement('data', $ts3->channelClientPermList($_POST['cid'], $_POST['cldbid']));
|
||||
|
||||
$allperms=$ts3->permissionList(true);
|
||||
|
||||
if(!empty($allperms))
|
||||
{
|
||||
if(!empty($chanclientpermlist))
|
||||
{
|
||||
foreach($chanclientpermlist AS $key => $value)
|
||||
{
|
||||
foreach($allperms AS $key2 => $value2)
|
||||
{
|
||||
if(isset($value2['permissions']))
|
||||
{
|
||||
foreach($value2['permissions'] AS $key3=>$value3)
|
||||
{
|
||||
if($value['permid']==$value3['permid'])
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['available']=1;
|
||||
$allperms[$key2]['permissions'][$key3]['permvalue']=$value['permvalue'];
|
||||
}
|
||||
elseif(!isset($allperms[$key2]['permissions'][$key3]['permvalue']))
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['available']=0;
|
||||
$allperms[$key2]['permissions'][$key3]['permvalue']=0;
|
||||
}
|
||||
if($value['permid']==$value3['grantpermid'])
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['grantav']=1;
|
||||
$allperms[$key2]['permissions'][$key3]['grant']=$value['permvalue'];
|
||||
}
|
||||
elseif(!isset($allperms[$key2]['permissions'][$key3]['grant']))
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['grantav']=0;
|
||||
$allperms[$key2]['permissions'][$key3]['grant']=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error.="The permissions can't show complete because you don't have the permission to see the list!<br />Needed Permission: b_serverinstance_permission_list<br />";
|
||||
}
|
||||
|
||||
if(isset($_POST['searchperms']))
|
||||
{
|
||||
$smarty->assign("searchperms", trim($_POST['searchperms']));
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("showmyperms", $showmyperms);
|
||||
$smarty->assign("display", $display);
|
||||
$smarty->assign("disp_pic", $disp_pic);
|
||||
$smarty->assign("channelname", secure($channelname));
|
||||
$smarty->assign("clientname", secure($clientname));
|
||||
$smarty->assign("allperms", $allperms);
|
||||
$smarty->assign("build", $get_build);
|
||||
}
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($sid===false OR empty($sid)) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
|
||||
$error='';
|
||||
$noerror='';
|
||||
if(isset($_POST['delete']))
|
||||
{
|
||||
$force=isset($_POST['force']) ? 1:0;
|
||||
$channel_delete=$ts3->channelDelete($_POST['cid'], $force);
|
||||
if($channel_delete['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['channeldelok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($channel_delete['errors']); $i++)
|
||||
{
|
||||
$error .= $channel_delete['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$channellist=$ts3->getElement('data', $ts3->channelList("-topic -flags -voice -limits -icon"));
|
||||
|
||||
if(!empty($channellist))
|
||||
{
|
||||
foreach($channellist AS $key=>$value)
|
||||
{
|
||||
$channellist[$key]=secure($channellist[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("channellist", $channellist);
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,131 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($sid===false OR empty($sid)) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
|
||||
$error='';
|
||||
$noerror='';
|
||||
|
||||
$newsettings=array();
|
||||
if(isset($_POST['editchannelname']))
|
||||
{
|
||||
$channel_edit=$ts3->channelEdit($cid, $_POST['newsettings']);
|
||||
|
||||
if($channel_edit['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['channelnameeditok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($channel_edit['errors']); $i++)
|
||||
{
|
||||
$error .= $channel_edit['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isset($_POST['editchannel']))
|
||||
{
|
||||
if($_POST['chantyp']=='0')
|
||||
{
|
||||
$_POST['newsettings']['channel_flag_permanent']=0;
|
||||
$_POST['newsettings']['channel_flag_semi_permanent']=0;
|
||||
}
|
||||
if($_POST['chantyp']=='1')
|
||||
{
|
||||
$_POST['newsettings']['channel_flag_permanent']=0;
|
||||
$_POST['newsettings']['channel_flag_semi_permanent']=1;
|
||||
}
|
||||
elseif($_POST['chantyp']=='2')
|
||||
{
|
||||
$_POST['newsettings']['channel_flag_permanent']=1;
|
||||
$_POST['newsettings']['channel_flag_semi_permanent']=0;
|
||||
}
|
||||
elseif($_POST['chantyp']=='3')
|
||||
{
|
||||
$_POST['newsettings']['channel_flag_permanent']=1;
|
||||
$_POST['newsettings']['channel_flag_semi_permanent']=0;
|
||||
$_POST['newsettings']['channel_flag_default']=1;
|
||||
}
|
||||
|
||||
$channel_edit=$ts3->channelEdit($cid, $_POST['newsettings']);
|
||||
|
||||
if($channel_edit['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['channeleditok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($channel_edit['errors']); $i++)
|
||||
{
|
||||
$error .= $channel_edit['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isset($_POST['editpw']))
|
||||
{
|
||||
|
||||
$channel_edit=$ts3->channelEdit($cid, $_POST['newsettings']);
|
||||
|
||||
if($channel_edit['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['passwordsetok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($channel_edit['errors']); $i++)
|
||||
{
|
||||
$error .= $channel_edit['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isset($_POST['movechan']))
|
||||
{
|
||||
$channel_move=$ts3->channelMove($cid, $_POST['move']);
|
||||
|
||||
if($channel_move['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['channelmoveok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($channel_move['errors']); $i++)
|
||||
{
|
||||
$error .= $channel_move['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$channellist=$ts3->getElement('data', $ts3->channellist());
|
||||
$channelinfo=$ts3->getElement('data', $ts3->channelInfo($cid));
|
||||
|
||||
if(!empty($channellist))
|
||||
{
|
||||
foreach($channellist AS $key=>$value)
|
||||
{
|
||||
$channellist[$key]=secure($channellist[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($channelinfo))
|
||||
{
|
||||
$channelinfo=secure($channelinfo);
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("channellist", $channellist);
|
||||
$smarty->assign("channelinfo", $channelinfo);
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,174 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($sid===false OR empty($sid)) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
|
||||
$channelinfo=$ts3->getElement('data', $ts3->channelInfo($cid));
|
||||
|
||||
$channelname=$channelinfo['channel_name'];
|
||||
|
||||
$serverinfo=$ts3->getElement('data', $ts3->serverInfo());
|
||||
$get_build=explode(' ', $serverinfo['virtualserver_version']);
|
||||
$get_build=str_replace(']', '', $get_build[2]);
|
||||
|
||||
if(isset($_POST['showmyperms']) AND $_POST['showmyperms']==1)
|
||||
{
|
||||
$showmyperms=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$showmyperms=0;
|
||||
}
|
||||
|
||||
if($showmyperms==1 or !empty($_POST['searchperms']))
|
||||
{
|
||||
$display="block";
|
||||
$disp_pic="minus";
|
||||
}
|
||||
else
|
||||
{
|
||||
$display="none";
|
||||
$disp_pic="plus";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (isset($_POST['editall']))
|
||||
{
|
||||
$delperms=array();
|
||||
$editperms=array();
|
||||
$allpermsedit=$_POST['perm'];
|
||||
|
||||
|
||||
foreach($allpermsedit AS $key => $value)
|
||||
{
|
||||
if(isset($_POST['granttoall']) AND isset($value['grant']) AND $value['grant']==1 AND isset($value['available']))
|
||||
{
|
||||
if($_POST['granttoall']===0 OR $_POST['granttoall']>0)
|
||||
{
|
||||
$value['value']=$_POST['granttoall'];
|
||||
}
|
||||
}
|
||||
if(isset($value['delperm']) AND $value['delperm']==1)
|
||||
{
|
||||
$delperms[]=$key;
|
||||
}
|
||||
elseif(isset($value['grant']) AND $value['grant']==1 AND !isset($value['available']) AND $value['value']==0)
|
||||
{
|
||||
|
||||
}
|
||||
elseif(isset($value['available']) OR !isset($value['available']) AND !empty($value['value']))
|
||||
{
|
||||
(!isset($value['value']) or empty($value['value'])) ? $editperms[$key]='0' : $editperms[$key]=$value['value'];
|
||||
}
|
||||
}
|
||||
|
||||
$channellist=$ts3->getElement('data', $ts3->channelPermList($cid));
|
||||
|
||||
if(!empty($channellist))
|
||||
{
|
||||
foreach($channellist AS $value)
|
||||
{
|
||||
foreach($editperms AS $key2=>$value2)
|
||||
{
|
||||
if($value['permid']==$key2 AND $value['permvalue']==$value2[0])
|
||||
{
|
||||
unset($editperms[$key2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($editperms))
|
||||
{
|
||||
$ts3->channelAddPerm($cid, $editperms);
|
||||
$debug=$ts3->getDebugLog();
|
||||
foreach($debug AS $key=>$value)
|
||||
{
|
||||
$error.=$value."<br />";
|
||||
}
|
||||
}
|
||||
if(!empty($delperms))
|
||||
{
|
||||
$ts3->channelDelPerm($cid, $delperms);
|
||||
$debug=$ts3->getDebugLog();
|
||||
foreach($debug AS $key=>$value)
|
||||
{
|
||||
$error.=$value."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$channellist=$ts3->getElement('data', $ts3->channelPermList($cid));
|
||||
|
||||
$allperms=$ts3->permissionList(true);
|
||||
|
||||
if(!empty($allperms))
|
||||
{
|
||||
if(!empty($channellist))
|
||||
{
|
||||
foreach($channellist AS $key => $value)
|
||||
{
|
||||
foreach($allperms AS $key2 => $value2)
|
||||
{
|
||||
if(isset($value2['permissions']))
|
||||
{
|
||||
foreach($value2['permissions'] AS $key3=>$value3)
|
||||
{
|
||||
if($value['permid']==$value3['permid'])
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['available']=1;
|
||||
$allperms[$key2]['permissions'][$key3]['permvalue']=$value['permvalue'];
|
||||
}
|
||||
elseif(!isset($allperms[$key2]['permissions'][$key3]['permvalue']))
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['available']=0;
|
||||
$allperms[$key2]['permissions'][$key3]['permvalue']=0;
|
||||
}
|
||||
if($value['permid']==$value3['grantpermid'])
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['grantav']=1;
|
||||
$allperms[$key2]['permissions'][$key3]['grant']=$value['permvalue'];
|
||||
}
|
||||
elseif(!isset($allperms[$key2]['permissions'][$key3]['grant']))
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['grantav']=0;
|
||||
$allperms[$key2]['permissions'][$key3]['grant']=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error.="The permissions can't show complete because you don't have the permission to see the list!<br />Needed Permission: b_serverinstance_permission_list<br />";
|
||||
}
|
||||
|
||||
if(isset($_POST['searchperms']))
|
||||
{
|
||||
$smarty->assign("searchperms", trim($_POST['searchperms']));
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("showmyperms", $showmyperms);
|
||||
$smarty->assign("display", $display);
|
||||
$smarty->assign("disp_pic", $disp_pic);
|
||||
$smarty->assign("channelname", secure($channelname));
|
||||
$smarty->assign("allperms", $allperms);
|
||||
$smarty->assign("build", $get_build);
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($sid===false OR empty($sid)) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
|
||||
$channelinfo=$ts3->getElement('data', $ts3->channelInfo($cid));
|
||||
|
||||
if(!empty($channelinfo))
|
||||
{
|
||||
$channelinfo=secure($channelinfo);
|
||||
}
|
||||
|
||||
$smarty->assign("channelinfo", $channelinfo);
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,167 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($sid===false OR empty($sid)) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
|
||||
$clientname=$ts3->getElement('data', $ts3->clientGetNameFromDbid($cldbid));
|
||||
|
||||
$serverinfo=$ts3->getElement('data', $ts3->serverInfo());
|
||||
$get_build=explode(' ', $serverinfo['virtualserver_version']);
|
||||
$get_build=str_replace(']', '', $get_build[2]);
|
||||
|
||||
if(isset($_POST['showmyperms']) AND $_POST['showmyperms']==1)
|
||||
{
|
||||
$showmyperms=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$showmyperms=0;
|
||||
}
|
||||
|
||||
if($showmyperms==1 or !empty($_POST['searchperms']))
|
||||
{
|
||||
$display="block";
|
||||
$disp_pic="minus";
|
||||
}
|
||||
else
|
||||
{
|
||||
$display="none";
|
||||
$disp_pic="plus";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (isset($_POST['editall']))
|
||||
{
|
||||
$delperms=array();
|
||||
$editperms=array();
|
||||
$allpermsedit=$_POST['perm'];
|
||||
|
||||
|
||||
foreach($allpermsedit AS $key => $value)
|
||||
{
|
||||
if(isset($_POST['granttoall']) AND isset($value['grant']) AND $value['grant']==1 AND isset($value['available']))
|
||||
{
|
||||
if($_POST['granttoall']===0 OR $_POST['granttoall']>0)
|
||||
{
|
||||
$value['value']=$_POST['granttoall'];
|
||||
}
|
||||
}
|
||||
if(isset($value['delperm']) AND $value['delperm']==1)
|
||||
{
|
||||
$delperms[]=$key;
|
||||
}
|
||||
elseif(isset($value['grant']) AND $value['grant']==1 AND !isset($value['available']) AND $value['value']==0)
|
||||
{
|
||||
|
||||
}
|
||||
elseif(isset($value['available']) OR !isset($value['available']) AND !empty($value['value']) OR !isset($value['available']) AND !empty($value['skip']))
|
||||
{
|
||||
(!isset($value['value']) or empty($value['value'])) ? $editperms[$key][]='0' : $editperms[$key][]=$value['value'];
|
||||
(!isset($value['skip']) or empty($value['skip'])) ? $editperms[$key][]='0' : $editperms[$key][]=$value['skip'];
|
||||
}
|
||||
}
|
||||
|
||||
$clpermlist=$ts3->getElement('data', $ts3->clientPermList($cldbid));
|
||||
if(!empty($clpermlist))
|
||||
{
|
||||
foreach($clpermlist AS $value)
|
||||
{
|
||||
foreach($editperms AS $key2=>$value2)
|
||||
{
|
||||
if($value['permid']==$key2 AND $value['permvalue']==$value2[0] AND $value['permskip']==$value2[1])
|
||||
{
|
||||
unset($editperms[$key2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($editperms))
|
||||
{
|
||||
$ts3->clientAddPerm($cldbid, $editperms);
|
||||
}
|
||||
|
||||
if(!empty($delperms))
|
||||
{
|
||||
$ts3->clientDelPerm($cldbid, $delperms);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$clpermlist=$ts3->getElement('data', $ts3->clientPermList($cldbid));
|
||||
|
||||
$allperms=$ts3->permissionList(true);
|
||||
|
||||
if(!empty($allperms))
|
||||
{
|
||||
if(!empty($clpermlist))
|
||||
{
|
||||
foreach($clpermlist AS $key => $value)
|
||||
{
|
||||
foreach($allperms AS $key2 => $value2)
|
||||
{
|
||||
if(isset($value2['permissions']))
|
||||
{
|
||||
foreach($value2['permissions'] AS $key3=>$value3)
|
||||
{
|
||||
if($value['permid']==$value3['permid'])
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['available']=1;
|
||||
$allperms[$key2]['permissions'][$key3]['permvalue']=$value['permvalue'];
|
||||
$allperms[$key2]['permissions'][$key3]['permskip']=$value['permskip'];
|
||||
}
|
||||
elseif(!isset($allperms[$key2]['permissions'][$key3]['permvalue']))
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['available']=0;
|
||||
$allperms[$key2]['permissions'][$key3]['permvalue']=0;
|
||||
$allperms[$key2]['permissions'][$key3]['permskip']=0;
|
||||
}
|
||||
if($value['permid']==$value3['grantpermid'])
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['grantav']=1;
|
||||
$allperms[$key2]['permissions'][$key3]['grant']=$value['permvalue'];
|
||||
}
|
||||
elseif(!isset($allperms[$key2]['permissions'][$key3]['grant']))
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['grantav']=0;
|
||||
$allperms[$key2]['permissions'][$key3]['grant']=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error.="The permissions can't show complete because you don't have the permission to see the list!<br />Needed Permission: b_serverinstance_permission_list<br />";
|
||||
}
|
||||
|
||||
if(isset($_POST['searchperms']))
|
||||
{
|
||||
$smarty->assign("searchperms", trim($_POST['searchperms']));
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("showmyperms", $showmyperms);
|
||||
$smarty->assign("display", $display);
|
||||
$smarty->assign("disp_pic", $disp_pic);
|
||||
$smarty->assign("clientname", secure($clientname['name']));
|
||||
$smarty->assign("allperms", $allperms);
|
||||
$smarty->assign("build", $get_build);
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
|
||||
$error='';
|
||||
$noerror='';
|
||||
$currentDeleted=0;
|
||||
$sgrouplist=$ts3->getElement('data', $ts3->serverGroupList());
|
||||
//$cgrouplist=$ts3->getElement('data', $ts3->channelGroupList());
|
||||
|
||||
if(isset($_REQUEST['cleanit']))
|
||||
{
|
||||
if(isset($_POST['sgroups']))
|
||||
{
|
||||
$protectedgroups=$_POST['sgroups'];
|
||||
}
|
||||
elseif(isset($_GET['protectedgroups']) AND !empty($_GET['protectedgroups']))
|
||||
{
|
||||
$protectedgroups=explode(',', $_GET['protectedgroups']);
|
||||
}
|
||||
$deleted=isset($_GET['deleted']) ? $_GET['deleted']:0;
|
||||
$timetodelete=time()-($_REQUEST['number']*86400);
|
||||
$clientdblist=array();
|
||||
$start=isset($_GET['start']) ? $_GET['start']:0;
|
||||
|
||||
$getclientdblist=$ts3->getElement('data', $ts3->clientDbList($start, 50));
|
||||
if(!empty($getclientdblist))
|
||||
{
|
||||
$clientdblist=$getclientdblist;
|
||||
$start=$start+50;
|
||||
|
||||
if(isset($protectedgroups))
|
||||
{
|
||||
foreach($clientdblist AS $key=>$value)
|
||||
{
|
||||
$clientdblist[$key]['sgroups']=$ts3->getElement('data', $ts3->serverGroupsByClientID($value['cldbid']));
|
||||
}
|
||||
}
|
||||
|
||||
foreach($clientdblist AS $key=>$value)
|
||||
{
|
||||
$protected=true;
|
||||
if($value['client_lastconnected']<=$timetodelete)
|
||||
{
|
||||
$protected=false;
|
||||
if(isset($protectedgroups))
|
||||
{
|
||||
foreach($value['sgroups'] AS $key2=>$value2)
|
||||
{
|
||||
if(in_array($value2['sgid'], $protectedgroups))
|
||||
{
|
||||
$protected=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($protected===false)
|
||||
{
|
||||
if($ts3->getElement('success', $ts3->clientDbDelete($value['cldbid'])))
|
||||
{
|
||||
$currentDeleted++;
|
||||
$deleted++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isset($protectedgroups))
|
||||
{
|
||||
$protectedgroups=implode(',', $protectedgroups);
|
||||
}
|
||||
$start=$start-$currentDeleted;
|
||||
echo "<img src=\"../gfx/images/away.png\" onLoad=\"document.location.href='index.php?site=clientcleaner&sid=".$_GET['sid']."&start=".$start."&deleted=".$deleted."&protectedgroups=".$protectedgroups."&number=".$_REQUEST['number']."&cleanit=1'\">";
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($deleted))
|
||||
{
|
||||
$deleted=sprintf($lang['countdelclients'], $deleted);
|
||||
$smarty->assign('deleted', $deleted);
|
||||
}
|
||||
$smarty->assign('sgrouplist', $sgrouplist);
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
|
@ -1,224 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($sid===false OR empty($sid)) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
|
||||
$sortby="cldbid";
|
||||
$sorttype=SORT_ASC;
|
||||
|
||||
if(empty($duration))
|
||||
{
|
||||
$duration=25;
|
||||
}
|
||||
|
||||
if(isset($_GET['start']))
|
||||
{
|
||||
$start=$_GET['start'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$start=0;
|
||||
}
|
||||
if(($start-$duration)<0)
|
||||
{
|
||||
$start=0;
|
||||
}
|
||||
|
||||
if(isset($_GET['sortby']))
|
||||
{
|
||||
if($_GET['sortby']=="cldbid")
|
||||
{
|
||||
$sortby="cldbid";
|
||||
}
|
||||
elseif($_GET['sortby']=="status")
|
||||
{
|
||||
$sortby="clid";
|
||||
}
|
||||
elseif($_GET['sortby']=="name")
|
||||
{
|
||||
$sortby="client_nickname";
|
||||
}
|
||||
elseif($_GET['sortby']=="unique")
|
||||
{
|
||||
$sortby="client_unique_identifier";
|
||||
}
|
||||
elseif($_GET['sortby']=="created")
|
||||
{
|
||||
$sortby="client_created";
|
||||
}
|
||||
elseif($_GET['sortby']=="lastcon")
|
||||
{
|
||||
$sortby="client_lastconnected";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sortby="cldbid";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_GET['sorttype']))
|
||||
{
|
||||
if($_GET['sorttype']=="asc")
|
||||
{
|
||||
$sorttype=SORT_ASC;
|
||||
}
|
||||
elseif($_GET['sorttype']=="desc")
|
||||
{
|
||||
$sorttype=SORT_DESC;
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['clientdel']))
|
||||
{
|
||||
$client_delete=$ts3->clientDbDelete($_POST['cldbid']);
|
||||
if($client_delete['succes']!==false)
|
||||
{
|
||||
echo "<tr><td colspan=\"4\" class=\"green1\">".$lang['clientdeletedok']."</td></tr>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<tr><td colspan=\"4\" class=\"green1\">";
|
||||
for($i=0; $i+1==count($client_delete['errors']); $i++)
|
||||
{
|
||||
echo $client_delete['errors'][$i]."<br />";
|
||||
}
|
||||
echo "</td></tr>";
|
||||
}
|
||||
}
|
||||
|
||||
$clientdblist=array();
|
||||
while($getclientdblist=$ts3->getElement('data', $ts3->clientDbList($start, $duration)))
|
||||
{
|
||||
$clientdblist=array_merge($clientdblist, $getclientdblist);
|
||||
$start=$start+$duration;
|
||||
}
|
||||
|
||||
|
||||
$clientlist=$ts3->getElement('data', $ts3->clientList());
|
||||
$countclients=count($clientdblist);
|
||||
|
||||
$pages=$countclients/$duration;
|
||||
if(floor($pages)!=0)
|
||||
{
|
||||
$pages=ceil($pages);
|
||||
}
|
||||
|
||||
|
||||
if(isset($_POST['searchby']) AND $_POST['searchby']=='cldbid' AND !empty($_POST['search']))
|
||||
{
|
||||
foreach ($clientdblist AS $key => $value)
|
||||
{
|
||||
if($_POST['search']!=$value['cldbid'])
|
||||
{
|
||||
unset($clientdblist[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif(isset($_POST['searchby']) AND $_POST['searchby']=='name' AND !empty($_POST['search']))
|
||||
{
|
||||
|
||||
foreach ($clientdblist AS $key => $value)
|
||||
{
|
||||
if(strpos(strtolower($value['client_nickname']),strtolower($_POST['search']))===false)
|
||||
{
|
||||
unset($clientdblist[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($clientdblist))
|
||||
{
|
||||
|
||||
foreach($clientdblist AS $key => $value)
|
||||
{
|
||||
if(!empty($clientlist))
|
||||
{
|
||||
foreach($clientlist AS $key2 => $value2)
|
||||
{
|
||||
if($value['cldbid'] == $value2['client_database_id'])
|
||||
{
|
||||
$clientdblist[$key]['clid']=$value2['clid'];
|
||||
$clientdblist[$key]['cid']=$value2['cid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$countstarted=0;
|
||||
$print_pages=1;
|
||||
if(!isset($_GET['getstart']))
|
||||
{
|
||||
$getstart=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$getstart=$_GET['getstart'];
|
||||
}
|
||||
|
||||
if(isset($_POST['searchby']) AND $_POST['searchby']=='cldbid' AND !empty($_POST['search']) AND !empty($clientdblist))
|
||||
{
|
||||
foreach ($clientdblist AS $key => $value)
|
||||
{
|
||||
if($_POST['search']!=$value['cldbid'])
|
||||
{
|
||||
unset($clientdblist[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif(isset($_POST['searchby']) AND $_POST['searchby']=='name' AND !empty($_POST['search']) AND !empty($clientdblist))
|
||||
{
|
||||
foreach ($clientdblist AS $key => $value)
|
||||
{
|
||||
if(strpos(strtolower($value['client_nickname']),strtolower($_POST['search']))===false)
|
||||
{
|
||||
unset($clientdblist[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif(isset($_POST['searchby']) AND $_POST['searchby']=='uniqueid' AND !empty($_POST['search']) AND !empty($clientdblist))
|
||||
{
|
||||
foreach ($clientdblist AS $key => $value)
|
||||
{
|
||||
if($value['client_unique_identifier']!=$_POST['search'])
|
||||
{
|
||||
unset($clientdblist[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
$showclients=1;
|
||||
if(!empty($clientdblist))
|
||||
{
|
||||
foreach($clientdblist AS $key=>$value)
|
||||
{
|
||||
$clientdblist[$key]=secure($clientdblist[$key]);
|
||||
|
||||
$sort[]=$value[$sortby];
|
||||
}
|
||||
|
||||
array_multisort($sort, $sorttype, $clientdblist);
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("sortby", $sortby);
|
||||
$smarty->assign("sorttype", $sorttype);
|
||||
$smarty->assign("duration", $duration);
|
||||
$smarty->assign("pages", $pages);
|
||||
$smarty->assign("getstart", $getstart);
|
||||
$smarty->assign("countstarted", $countstarted);
|
||||
$smarty->assign("showclients", $showclients);
|
||||
$smarty->assign("print_pages", $print_pages);
|
||||
$smarty->assign("clientdblist", $clientdblist);
|
||||
?>
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(isset($_POST['give']))
|
||||
{
|
||||
session_start();
|
||||
require_once('../ts3admin.class.php');
|
||||
$sqlstring='';
|
||||
$ts3=new ts3admin($_SESSION['server_ip'], $_SESSION['server_tport']);
|
||||
$ts3->connect();
|
||||
$ts3->login($_SESSION['loginuser'], unserialize(base64_decode($_SESSION['loginpw'])));
|
||||
$ts3->selectServer($_POST['sid'], 'serverId');
|
||||
|
||||
$start=0;
|
||||
$duration=1000;
|
||||
while($clients=$ts3->getElement('data', $ts3->clientDbList($start, $duration)))
|
||||
{
|
||||
foreach($clients AS $client)
|
||||
{
|
||||
if($client['client_unique_identifier']!="ServerQuery")
|
||||
{
|
||||
$sqlstring.="INSERT INTO \"clients\" (server_id, client_unique_id, client_nickname) VALUES (".$_POST['sid'].",'".$client['client_unique_identifier']."','".$client['client_nickname']."');\n";
|
||||
}
|
||||
}
|
||||
$start=$start + $duration;
|
||||
}
|
||||
header('Content-Disposition: attachment; filename="clientbackup.sql"');
|
||||
header('Content-Type: x-type/subtype');
|
||||
echo $sqlstring;
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
require_once('../ts3admin.class.php');
|
||||
$ts3=new ts3admin($_SESSION['server_ip'], $_SESSION['server_tport']);
|
||||
$ts3->connect();
|
||||
$ts3->login($_SESSION['loginuser'], unserialize(base64_decode($_SESSION['loginpw'])));
|
||||
$ts3->selectServer($_POST['sid'], 'serverId');
|
||||
|
||||
$start=0;
|
||||
$duration=1000;
|
||||
while($clients=$ts3->getElement('data', $ts3->clientDbList($start, $duration)))
|
||||
{
|
||||
foreach($clients AS $client)
|
||||
{
|
||||
if($client['client_unique_identifier']!="ServerQuery")
|
||||
{
|
||||
$sqlstring.="INSERT INTO \"clients\" (server_id, client_unique_id, client_nickname) VALUES (".$_POST['sid'].",'".$client['client_unique_identifier']."','".$client['client_nickname']."');\n";
|
||||
}
|
||||
}
|
||||
$start=$start + $duration;
|
||||
}
|
||||
header('Content-Disposition: attachment; filename="clientbackup.sql"');
|
||||
header('Content-Type: x-type/subtype');
|
||||
echo $sqlstring;
|
||||
?>
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
|
||||
$error='';
|
||||
$noerror='';
|
||||
|
||||
if(isset($_POST['delall']))
|
||||
{
|
||||
$complain_delete_all=$ts3->complainDeleteAll($_POST['tcldbid']);
|
||||
|
||||
if($complain_delete_all['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['complaindel']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($complain_delete_all['errors']); $i++)
|
||||
{
|
||||
$error .= $complain_delete_all['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['delete']))
|
||||
{
|
||||
$complain_delete=$ts3->complainDelete($_POST['tcldbid'], $_POST['fcldbid']);
|
||||
|
||||
if($complain_delete['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['complainsdel']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($complain_delete['errors']); $i++)
|
||||
{
|
||||
$error .= $complain_delete['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
$complainlist=$ts3->getElement('data', $ts3->complainList());
|
||||
$newcomplainlist=array();
|
||||
if(!empty($complainlist))
|
||||
{
|
||||
foreach($complainlist AS $key=>$value)
|
||||
{
|
||||
$value=secure($value);
|
||||
$newcomplainlist[$value['tcldbid']][$value['tname']][$value['fcldbid']]['fname']=$value['fname'];
|
||||
$newcomplainlist[$value['tcldbid']][$value['tname']][$value['fcldbid']]['message']=$value['message'];
|
||||
$newcomplainlist[$value['tcldbid']][$value['tname']][$value['fcldbid']]['timestamp']=$value['timestamp'];
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("newcomplainlist", $newcomplainlist);
|
||||
?>
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
|
||||
$showOutput='';
|
||||
$getOutput='';
|
||||
if(isset($_POST['command']))
|
||||
{
|
||||
$data=strtr($_POST['command'], array("\n\n" => '\n', "\r\n" => '\n', "\r" => '\n', "\n" => '\n'));
|
||||
$commands=explode('\n', $data);
|
||||
$use_error=0;
|
||||
if($hoststatus===false)
|
||||
{
|
||||
foreach($commands AS $key=>$value)
|
||||
{
|
||||
if(substr($value, 0, 3)=='use')
|
||||
{
|
||||
$use_error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(empty($use_error))
|
||||
{
|
||||
foreach($commands AS $key=>$value)
|
||||
{
|
||||
if(!empty($value))
|
||||
{
|
||||
$getOutput=$ts3->execOwnCommand(3, $value);
|
||||
|
||||
if(!empty($getOutput['errors']))
|
||||
{
|
||||
$get_errorid=explode('ErrorID: ', $getOutput['errors'][0]);
|
||||
$get_errorid=explode(' | Message: ', $get_errorid[1]);
|
||||
$errormsg="error id=".$get_errorid[0]." msg=".$get_errorid[1]."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$errormsg="error id=0 msg=ok\n";
|
||||
}
|
||||
$showOutput.=$getOutput['data'].$errormsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$showOutput .= $lang['nouse'];
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("showOutput", str_replace('<br>', "\n", $showOutput));
|
||||
?>
|
||||
|
|
@ -1,117 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
|
||||
$i=0;
|
||||
$start_while=0;
|
||||
$duration_while=1;
|
||||
$count_online=0;
|
||||
$count_today=0;
|
||||
$count_week=0;
|
||||
$count_month=0;
|
||||
$perc_online=0;
|
||||
$perc_today=0;
|
||||
$perc_week=0;
|
||||
$perc_month=0;
|
||||
$totalclients='';
|
||||
|
||||
if(date("w")==0)
|
||||
{
|
||||
$dayofweek=6;
|
||||
}
|
||||
else
|
||||
{
|
||||
$dayofweek=date("w")-1;
|
||||
}
|
||||
$thisday=mktime(0,0,0,date("n"),date("d"),date("Y"));
|
||||
$thisweek=mktime(0,0,0,date("n"),date("j")-$dayofweek,date("Y"));
|
||||
$thismonth=mktime(0,0,0,date("n"),1,date("Y"));
|
||||
|
||||
$clientlist=$ts3->getElement('data', $ts3->clientList());
|
||||
|
||||
while($clientdblist=$ts3->getElement('data', $ts3->clientDbList($start_while, $duration_while)))
|
||||
{
|
||||
foreach($clientdblist AS $key=>$value)
|
||||
{
|
||||
if(!empty($clientlist))
|
||||
{
|
||||
foreach($clientlist AS $key2=>$value2)
|
||||
{
|
||||
if($value['cldbid']==$value2['client_database_id'])
|
||||
{
|
||||
$clientstatuslist[$i]['online']=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
$clientstatuslist[$i]['cldbid']=$value['cldbid'];
|
||||
$clientstatuslist[$i]['client_lastconnected']=$value['client_lastconnected'];
|
||||
$i++;
|
||||
}
|
||||
$start_while=$start_while+$duration_while;
|
||||
}
|
||||
$totalclients=count($clientstatuslist);
|
||||
|
||||
|
||||
|
||||
if(!empty($clientstatuslist))
|
||||
{
|
||||
foreach($clientstatuslist AS $key => $value)
|
||||
{
|
||||
if(isset($value['online']))
|
||||
{
|
||||
$count_online++;
|
||||
}
|
||||
if($value['client_lastconnected']>=$thisday)
|
||||
{
|
||||
$count_today++;
|
||||
}
|
||||
if($value['client_lastconnected']>=$thisweek)
|
||||
{
|
||||
$count_week++;
|
||||
}
|
||||
if($value['client_lastconnected']>=$thismonth)
|
||||
{
|
||||
$count_month++;
|
||||
}
|
||||
}
|
||||
if(!empty($count_online))
|
||||
{
|
||||
$perc_online=round(100*$count_online/$totalclients);
|
||||
}
|
||||
if(!empty($count_today))
|
||||
{
|
||||
$perc_today=round(100*$count_today/$totalclients);
|
||||
}
|
||||
if(!empty($count_week))
|
||||
{
|
||||
$perc_week=round(100*$count_week/$totalclients);
|
||||
}
|
||||
if(!empty($count_month))
|
||||
{
|
||||
$perc_month=round(100*$count_month/$totalclients);
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("count_online", $count_online);
|
||||
$smarty->assign("count_today", $count_today);
|
||||
$smarty->assign("count_week", $count_week);
|
||||
$smarty->assign("count_month", $count_month);
|
||||
$smarty->assign("perc_online", $perc_online);
|
||||
$smarty->assign("perc_today", $perc_today);
|
||||
$smarty->assign("perc_week", $perc_week);
|
||||
$smarty->assign("perc_month", $perc_month);
|
||||
$smarty->assign("totalclients", $totalclients);
|
||||
|
||||
?>
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($sid===false OR empty($sid)) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
|
||||
$error='';
|
||||
$noerror='';
|
||||
|
||||
$settings=array();
|
||||
if(isset($_POST['createchannel']))
|
||||
{
|
||||
if($_POST['chantyp']=='1')
|
||||
{
|
||||
$_POST['settings']['channel_flag_permanent']=0;
|
||||
$_POST['settings']['channel_flag_semi_permanent']=1;
|
||||
}
|
||||
elseif($_POST['chantyp']=='2')
|
||||
{
|
||||
$_POST['settings']['channel_flag_permanent']=1;
|
||||
$_POST['settings']['channel_flag_semi_permanent']=0;
|
||||
}
|
||||
elseif($_POST['chantyp']=='3')
|
||||
{
|
||||
$_POST['settings']['channel_flag_permanent']=1;
|
||||
$_POST['settings']['channel_flag_semi_permanent']=0;
|
||||
$_POST['settings']['channel_flag_default']=1;
|
||||
}
|
||||
$channel_create=$ts3->channelCreate($_POST['settings']);
|
||||
if($channel_create['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['channelid'].": ".$channel_create['data']['cid']."<br />";
|
||||
$noerror .= $lang['channelcreatedok'];
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($channel_create['errors']); $i++)
|
||||
{
|
||||
$error .= $channel_create['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$channellist=$ts3->getElement('data', $ts3->channellist());
|
||||
|
||||
if(!empty($channellist))
|
||||
{
|
||||
foreach($channellist AS $key=>$value)
|
||||
{
|
||||
$channellist[$key]=secure($channellist[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("channellist", $channellist);
|
||||
} ?>
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($hoststatus===false) { echo $lang['nohoster']; } else {
|
||||
|
||||
include('screate_config.php');
|
||||
|
||||
$error = '';
|
||||
$noerror = '';
|
||||
|
||||
if(isset($_POST['createserver']))
|
||||
{
|
||||
$token=$ts3->serverCreate($_POST['newsettings']);
|
||||
if($token['success']===false)
|
||||
{
|
||||
for($i=0; $i+1==count($token['errors']); $i++)
|
||||
{
|
||||
$error .= $token['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$noerror = $lang['serverid'].": ".$token['data']['sid']."<br />".$lang['port'].": ".$token['data']['virtualserver_port']."<br />".$lang['token'].": ".$token['data']['token'];
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("screate_tmp", $screate_tmp);
|
||||
} ?>
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);} ?>
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($fastswitch==true AND $hoststatus==true AND $loginstatus!==false AND !empty($sid) OR $fastswitch==true AND $loginstatus!==false AND !empty($sid))
|
||||
{
|
||||
$serverlist=$ts3->getElement('data', $ts3->serverList());
|
||||
if(!empty($serverlist))
|
||||
{
|
||||
foreach($serverlist AS $key=>$value)
|
||||
{
|
||||
$serverlist[$key]=secure($serverlist[$key]);
|
||||
}
|
||||
}
|
||||
$smarty->assign("fastswitch", true);
|
||||
$smarty->assign("serverlist", $serverlist);
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,204 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
error_reporting(E_ALL & ~E_NOTICE);
|
||||
session_start();
|
||||
|
||||
define("SECURECHECK", 1);
|
||||
|
||||
define('DS', DIRECTORY_SEPARATOR);
|
||||
define('SMARTY_DIR', '..'.DS.'libs'.DS.'Smarty'.DS.'libs'.DS);
|
||||
|
||||
require('../config.php');
|
||||
require('lang.php');
|
||||
require('../ts3admin.class.php');
|
||||
require('../functions.inc.php');
|
||||
require_once('../libs/Smarty/libs/Smarty.class.php');
|
||||
|
||||
if(!isset($_SESSION['logged']) OR isset($_SESSION['logged']) AND $_SESSION['logged']!=true OR empty($_GET['sid']) OR empty($_GET['cid'])) {die($lang['error_file_alone']);}
|
||||
|
||||
$smarty=new Smarty();
|
||||
|
||||
$smarty->template_dir = '..'.DS.'templates/';
|
||||
$smarty->compile_dir = '..'.DS.'templates_c/';
|
||||
$smarty->config_dir = '..'.DS.'configs/';
|
||||
$smarty->cache_dir = '..'.DS.'cache/';
|
||||
|
||||
$error='';
|
||||
$noerror='';
|
||||
$flist='';
|
||||
|
||||
if(!file_exists('..'.DS.'templates'.DS.$style))
|
||||
{
|
||||
$style="default";
|
||||
}
|
||||
|
||||
$smarty->assign("tmpl", $style);
|
||||
|
||||
$ts3=new ts3admin($_SESSION['server_ip'], $_SESSION['server_tport']);
|
||||
$ts3->connect();
|
||||
$ts3->login($_SESSION['loginuser'], unserialize(base64_decode($_SESSION['loginpw'])));
|
||||
$ts3->selectServer($_GET['sid'], 'serverId');
|
||||
$chaninfo=$ts3->getElement('data', $ts3->channelInfo($_GET['cid']));
|
||||
|
||||
function cmp($a, $b)
|
||||
{
|
||||
return strcmp($a["name"], $b["name"]);
|
||||
}
|
||||
|
||||
if(isset($_GET['deletefile']))
|
||||
{
|
||||
$delfiles[]=$_GET['path']=="/" ? "/".$_GET['name']:$_GET['path']."/".$_GET['name'];
|
||||
$isdelete=$ts3->ftDeleteFile($_GET['cid'], isset($_GET['cpw']) ? $_GET['cpw']:'', $delfiles);
|
||||
if($isdelete['success']===false)
|
||||
{
|
||||
$error .= $isdelete['errors'][0];
|
||||
}
|
||||
else
|
||||
{
|
||||
$noerror .= $lang['fdelok'];
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['createdir']))
|
||||
{
|
||||
$dirname=$_GET['path']=="/" ? "/".$_POST['fname']:$_GET['path']."/".$_POST['fname'];
|
||||
$iscreate=$ts3->ftCreateDir($_GET['cid'], isset($_GET['cpw']) ? $_GET['cpw']:'', $dirname);
|
||||
if($iscreate['success']===false)
|
||||
{
|
||||
$error .= $iscreate['errors'][0];
|
||||
}
|
||||
else
|
||||
{
|
||||
$noerror .= $lang['createdir'];
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['upload']))
|
||||
{
|
||||
if($_FILES['thefile']['error']==0)
|
||||
{
|
||||
if(move_uploaded_file($_FILES['thefile']['tmp_name'],"../temp/".$_FILES['thefile']['name']))
|
||||
{
|
||||
$noerror .= $lang['fileadd']."<br />";
|
||||
}
|
||||
$path=$_GET['path']=="/" ? "/".$_FILES['thefile']['name']:$_GET['path']."/".$_FILES['thefile']['name'];
|
||||
$ft2=$ts3->getElement('data', $ts3->ftInitUpload($path, $_GET['cid'], $_FILES['thefile']['size'], $_GET['cpw']));
|
||||
$file=file_get_contents("../temp/".$_FILES['thefile']['name']);
|
||||
$con_ft=fsockopen($_SESSION['server_ip'], $ft2['port'], $errnum, $errstr, 10);
|
||||
fputs($con_ft, $ft2['ftkey']);
|
||||
fputs($con_ft, $file);
|
||||
unlink("../temp/".$_FILES['thefile']['name']);
|
||||
fclose($con_ft);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch($_FILES['thefile']['error'])
|
||||
{
|
||||
case 1:
|
||||
$error .= $lang['UPLOAD_ERR_INI_SIZE'];
|
||||
break;
|
||||
case 2:
|
||||
$error .= $lang['UPLOAD_ERR_FORM_SIZE'];
|
||||
break;
|
||||
case 3:
|
||||
$error .= $lang['UPLOAD_ERR_PARTIAL'];
|
||||
break;
|
||||
case 4:
|
||||
$error .= $lang['UPLOAD_ERR_NO_FILE'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_GET['cid']) AND isset($_GET['path']))
|
||||
{
|
||||
require('filetransfer.php');
|
||||
if(!empty($flist))
|
||||
{
|
||||
foreach($flist AS $key=>$value)
|
||||
{
|
||||
if($value['type']==0)
|
||||
{
|
||||
$folder[]=$flist[$key];
|
||||
}
|
||||
else
|
||||
{
|
||||
$files[]=$flist[$key];
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!empty($folder))
|
||||
{
|
||||
usort($folder, "cmp");
|
||||
}
|
||||
if(!empty($files))
|
||||
{
|
||||
usort($files, "cmp");
|
||||
}
|
||||
if(!empty($folder) AND empty($files))
|
||||
{
|
||||
$flist=$folder;
|
||||
}
|
||||
elseif(empty($folder) AND !empty($files))
|
||||
{
|
||||
$flist=$files;
|
||||
}
|
||||
elseif(!empty($folder) AND !empty($files))
|
||||
{
|
||||
$flist=array_merge($folder, $files);
|
||||
}
|
||||
else
|
||||
{
|
||||
$flist='';
|
||||
}
|
||||
}
|
||||
if(isset($_GET['path']) AND $_GET['path']!="/" AND !empty($_GET['path']))
|
||||
{
|
||||
$cid=$_GET['cid'];
|
||||
$splitpath=explode("/",$_GET['path']);
|
||||
unset($splitpath[count($splitpath)-1]);
|
||||
$newpath=implode("/", $splitpath);
|
||||
empty($newpath) ? $newpath="/":'';
|
||||
$newpath=="/" ? $cid='':'';
|
||||
$newpath=urlencode($newpath);
|
||||
}
|
||||
|
||||
if(!empty($flist))
|
||||
{
|
||||
foreach($flist AS $key=>$value)
|
||||
{
|
||||
$flist[$key]['size']=round($flist[$key]['size'] / 1048576, 2);
|
||||
$flist[$key]=secure($flist[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("lang", $lang);
|
||||
$smarty->assign("flist", $flist);
|
||||
$smarty->assign("chaninfo", secure($chaninfo));
|
||||
if(isset($newpath))
|
||||
{
|
||||
$smarty->assign("newpath", $newpath);
|
||||
}
|
||||
|
||||
if(isset($cid))
|
||||
{
|
||||
$smarty->assign("cid", $cid);
|
||||
}
|
||||
|
||||
|
||||
$smarty->display($style.DS.'filebrowser.tpl');
|
||||
?>
|
||||
|
|
@ -1,195 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($sid===false OR empty($sid)) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
|
||||
$error='';
|
||||
$noerror='';
|
||||
$channellist=$ts3->channelList();
|
||||
$getallfiles=array();
|
||||
|
||||
if(isset($_GET['deletefile']))
|
||||
{
|
||||
$delfiles[]=$_GET['path']=="/" ? "/".$_GET['name']:$_GET['path']."/".$_GET['name'];
|
||||
if(!isset($_GET['cpw'])) {$_GET['cpw']='';}
|
||||
$isdelete=$ts3->ftDeleteFile($_GET['cid'], $_GET['cpw'], $delfiles);
|
||||
$_GET['path']=="/" ? $_GET['cid']='':'';
|
||||
if($isdelete['success']===false)
|
||||
{
|
||||
for($i=0; $i+1==count($isdelete['errors']); $i++)
|
||||
{
|
||||
$error .= $isdelete['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$noerror .= $lang['fdelok']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['createdir']))
|
||||
{
|
||||
$dirname=$_GET['path']=="/" ? "/".$_POST['fname']:$_GET['path']."/".$_POST['fname'];
|
||||
$iscreate=$ts3->ftCreateDir($_REQUEST['cid'], $_GET['cpw'], $dirname);
|
||||
if($iscreate['success']===false)
|
||||
{
|
||||
for($i=0; $i+1==count($iscreate['errors']); $i++)
|
||||
{
|
||||
$error .= $iscreate['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$noerror .= $lang['createdir']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['upload']))
|
||||
{
|
||||
if($_FILES['thefile']['error']==0)
|
||||
{
|
||||
if(move_uploaded_file($_FILES['thefile']['tmp_name'],"temp/".$_FILES['thefile']['name']))
|
||||
{
|
||||
$noerror .= $lang['fileadd']."<br />";
|
||||
}
|
||||
$path=$_GET['path']=="/" ? "/".$_FILES['thefile']['name']:$_GET['path']."/".$_FILES['thefile']['name'];
|
||||
$ft2=$ts3->getElement('data', $ts3->ftInitUpload($path, $_REQUEST['cid'], $_FILES['thefile']['size'], $_GET['cpw']));
|
||||
$file=file_get_contents("temp/".$_FILES['thefile']['name']);
|
||||
$con_ft=fsockopen($_SESSION['server_ip'], $ft2['port'], $errnum, $errstr, 10);
|
||||
fputs($con_ft, $ft2['ftkey']);
|
||||
fputs($con_ft, $file);
|
||||
unlink("temp/".$_FILES['thefile']['name']);
|
||||
fclose($con_ft);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch($_FILES['thefile']['error'])
|
||||
{
|
||||
case 1:
|
||||
$error .= $lang['UPLOAD_ERR_INI_SIZE'];
|
||||
break;
|
||||
case 2:
|
||||
$error .= $lang['UPLOAD_ERR_FORM_SIZE'];
|
||||
break;
|
||||
case 3:
|
||||
$error .= $lang['UPLOAD_ERR_PARTIAL'];
|
||||
break;
|
||||
case 4:
|
||||
$error .= $lang['UPLOAD_ERR_NO_FILE'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($_GET['cid']) or empty($_GET['cid']))
|
||||
{
|
||||
if(!empty($channellist['data']))
|
||||
{
|
||||
foreach($channellist['data'] AS $key => $value)
|
||||
{
|
||||
$flist=$ts3->ftGetFileList($value['cid'], '', '/');
|
||||
|
||||
if(!empty($flist['data']))
|
||||
{
|
||||
foreach($flist['data'] AS $key2=>$value2)
|
||||
{
|
||||
$flist['data'][$key2]['cname']=$value['channel_name'];
|
||||
if(!isset($value2['cid']))
|
||||
{
|
||||
$flist['data'][$key2]['cid']=$value['cid'];
|
||||
}
|
||||
}
|
||||
$getallfiles=array_merge($getallfiles, $flist['data']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_GET['path']=str_replace('%2', '+', $_GET['path']);
|
||||
$getallfiles=$ts3->getElement('data', $ts3->ftGetFileList($_GET['cid'], '', $_GET['path']));
|
||||
}
|
||||
|
||||
if(!empty($getallfiles))
|
||||
{
|
||||
foreach($getallfiles AS $key=>$value)
|
||||
{
|
||||
$sort[]=$value['type'];
|
||||
$sort2[]=$value['name'];
|
||||
}
|
||||
array_multisort($sort, SORT_ASC, $sort2, SORT_ASC, $getallfiles);
|
||||
}
|
||||
|
||||
if(isset($_GET['cid']))
|
||||
{
|
||||
$chaninfo=$ts3->getElement('data', $ts3->channelInfo($_GET['cid']));
|
||||
}
|
||||
|
||||
if(isset($_GET['path']) AND $_GET['path']!="/" AND !empty($_GET['path']))
|
||||
{
|
||||
$cid=$_GET['cid'];
|
||||
$splitpath=explode("/",$_GET['path']);
|
||||
unset($splitpath[count($splitpath)-1]);
|
||||
$newpath=implode("/", $splitpath);
|
||||
empty($newpath) ? $newpath="/":'';
|
||||
$newpath=="/" ? $cid='':'';
|
||||
$newpath=urlencode($newpath);
|
||||
}
|
||||
|
||||
if(!empty($channellist))
|
||||
{
|
||||
foreach($channellist['data'] AS $key=>$value)
|
||||
{
|
||||
$channellist['data'][$key]=secure($channellist['data'][$key]);
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($getallfiles))
|
||||
{
|
||||
$getallfiles['totalsize']=0;
|
||||
foreach($getallfiles AS $key=>$value)
|
||||
{
|
||||
if($key!=='totalsize')
|
||||
{
|
||||
$getallfiles[$key]['size']=round($getallfiles[$key]['size'] / 1048576, 2);
|
||||
$getallfiles[$key]=secure($getallfiles[$key]);
|
||||
}
|
||||
$getallfiles['totalsize']=$getallfiles['totalsize']+$getallfiles[$key]['size'];
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($chaninfo) AND !empty($chaninfo))
|
||||
{
|
||||
$chaninfo=secure($chaninfo);
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("channellist", $channellist['data']);
|
||||
$smarty->assign("getallfiles", $getallfiles);
|
||||
if(isset($chaninfo))
|
||||
{
|
||||
$smarty->assign("chaninfo", $chaninfo);
|
||||
}
|
||||
if(isset($newpath))
|
||||
{
|
||||
$smarty->assign("newpath", $newpath);
|
||||
}
|
||||
if(isset($cid))
|
||||
{
|
||||
$smarty->assign("cid", $cid);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,192 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
$ip='';
|
||||
$error='';
|
||||
$noerror='';
|
||||
$count_del=0;
|
||||
if(isset($_GET['cid']) AND isset($_GET['path']) AND !isset($_GET['getfile']))
|
||||
{
|
||||
$flist=$ts3->getElement('data', $ts3->ftGetFileList($_GET['cid'], '', $_GET['path']));
|
||||
}
|
||||
if(isset($_GET['getfile']) AND isset($_GET['cid']) AND isset($_GET['path']) AND isset($_GET['name']) AND isset($_GET['sid']))
|
||||
{
|
||||
session_start();
|
||||
require_once('../ts3admin.class.php');
|
||||
$ts3=new ts3admin($_SESSION['server_ip'], $_SESSION['server_tport']);
|
||||
$ts3->connect();
|
||||
$ts3->login($_SESSION['loginuser'], unserialize(base64_decode($_SESSION['loginpw'])));
|
||||
$ts3->selectServer($_GET['sid'], 'serverId');
|
||||
|
||||
$ft=$ts3->ftInitDownload($_GET['path']."/".$_GET['name'], $_GET['cid']);
|
||||
if($ft['success']===true or empty($ft['data']['port']))
|
||||
{
|
||||
$con_ft=@fsockopen($_SESSION['server_ip'], $ft['data']['port'], $errnum, $errstr, 10);
|
||||
if($con_ft)
|
||||
{
|
||||
fputs($con_ft, $ft['data']['ftkey']);
|
||||
$data='';
|
||||
while (!feof($con_ft))
|
||||
{
|
||||
$data.= fgets($con_ft, 4096);
|
||||
}
|
||||
header('Content-Disposition: attachment; filename="'.$_GET['name'].'"');
|
||||
header('Content-Type: x-type/subtype');
|
||||
echo $data;
|
||||
}
|
||||
else
|
||||
{
|
||||
$error .= $lang['ftconerr']."<br />";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error .= $lang['ftiniterr']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
// Automatischer Icon Download
|
||||
if(isset($geticons) AND $geticons==1)
|
||||
{
|
||||
if(isset($_GET['ip']))
|
||||
{
|
||||
$ip=$_GET['ip'];
|
||||
}
|
||||
elseif(isset($_SESSION['server_ip']))
|
||||
{
|
||||
$ip=$_SESSION['server_ip'];
|
||||
}
|
||||
if(!isset($port))
|
||||
{
|
||||
$port=$whoami['virtualserver_port'];
|
||||
}
|
||||
$count=0;
|
||||
|
||||
$ft=$ts3->ftGetFileList(0, '', '/icons');
|
||||
|
||||
if(is_dir('icons/'.$ip.'-'.$port.'/'))
|
||||
{
|
||||
$handler=@opendir('icons/'.$ip.'-'.$port.'/');
|
||||
}
|
||||
else
|
||||
{
|
||||
if(@mkdir('icons/'.$ip.'-'.$port.'/', 0777))
|
||||
{
|
||||
$handler=@opendir('icons/'.$ip.'-'.$port.'/');
|
||||
}
|
||||
else
|
||||
{
|
||||
$error.=$lang['iconfoldererr']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
while($datei=readdir($handler))
|
||||
{
|
||||
$icon_arr[]=$datei;
|
||||
}
|
||||
|
||||
$noIcon=0;
|
||||
if(!empty($ft['data']))
|
||||
{
|
||||
foreach($ft['data'] AS $key2=>$value2)
|
||||
{
|
||||
$foundIcons[]=$value2['name'];
|
||||
}
|
||||
}
|
||||
foreach($icon_arr AS $key=>$value)
|
||||
{
|
||||
if(!empty($ft['data']))
|
||||
{
|
||||
if($value!="." AND $value!=".." AND in_array($value, $foundIcons))
|
||||
{
|
||||
$noIcon=1;
|
||||
break;
|
||||
}
|
||||
if($noIcon==0)
|
||||
{
|
||||
if(@unlink('icons/'.$ip.'-'.$port.'/'.$value))
|
||||
{
|
||||
$count_del++;
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif(strpos($ft['errors'][0], 'ErrorID: 2568 | Message: insufficient client permissions failed_permid')===false)
|
||||
{
|
||||
if($value!="." AND $value!="..")
|
||||
{
|
||||
if(@unlink('icons/'.$ip.'-'.$port.'/'.$value))
|
||||
{
|
||||
$count_del++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($ft['data']))
|
||||
{
|
||||
foreach($ft['data'] AS $key=>$value)
|
||||
{
|
||||
if(substr($value['name'], 0, 5)=='icon_')
|
||||
{
|
||||
if(!in_array($value['name'], $icon_arr))
|
||||
{
|
||||
$count++;
|
||||
$ft2=$ts3->ftInitDownload("/".$value['name'], 0);
|
||||
if($ft2['success']!==false AND !empty($ft2['data']['port']))
|
||||
{
|
||||
$con_ft=@fsockopen($ip, $ft2['data']['port'], $errnum, $errstr, 10);
|
||||
if($con_ft)
|
||||
{
|
||||
fputs($con_ft, $ft2['data']['ftkey']);
|
||||
$data='';
|
||||
while (!feof($con_ft))
|
||||
{
|
||||
$data.= fgets($con_ft, 4096);
|
||||
}
|
||||
$handler2=@fopen('icons/'.$ip.'-'.$port.'/'.$value['name'], "w+");
|
||||
if($handler2!==false)
|
||||
{
|
||||
fwrite($handler2, $data);
|
||||
fclose($handler2);
|
||||
}
|
||||
else
|
||||
{
|
||||
$error.=sprintf($lang['iconerr'], $ip, $port, $value['name'])."<br />";
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error.= $lang['ftconerr']."<br />";
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error.=$ft2['errors'][0]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($count!=0 AND empty($error))
|
||||
{
|
||||
$noerror .= sprintf($lang['countnewicon'], $count)."<br />";
|
||||
}
|
||||
}
|
||||
if($count_del!=0)
|
||||
{
|
||||
$noerror .= sprintf($lang['countdelicon'], $count_del)."<br />";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
$error='';
|
||||
$noerror='';
|
||||
if(isset($_POST['upload']))
|
||||
{
|
||||
$icon=@getimagesize($_FILES['thefile']['tmp_name']);
|
||||
if($icon!=false)
|
||||
{
|
||||
if($icon[0]<=16 or $icon[1]<=16)
|
||||
{
|
||||
$filename="icon_".mt_rand(1000000000, 2147483647);
|
||||
if(move_uploaded_file($_FILES['thefile']['tmp_name'],"temp/".$filename))
|
||||
{
|
||||
$noerror .= $lang['iconadd']."<br />";
|
||||
}
|
||||
$ft2=$ts3->getElement('data', $ts3->ftInitUpload("/".$filename, 0, $_FILES['thefile']['size']));
|
||||
$file=file_get_contents("temp/".$filename);
|
||||
$con_ft=fsockopen($_SESSION['server_ip'], $ft2['port'], $errnum, $errstr, 10);
|
||||
fputs($con_ft, $ft2['ftkey']);
|
||||
fputs($con_ft, $file);
|
||||
unlink("temp/".$filename);
|
||||
fclose($con_ft);
|
||||
}
|
||||
else
|
||||
{
|
||||
$error .= $lang['iconmaxsize']."<br />";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error .= $lang['notapic']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['delicons']) AND !empty($_POST['delicons']))
|
||||
{
|
||||
$ts3->ftDeleteFile(0, '', $_POST['delicons']);
|
||||
foreach($_POST['delicons'] AS $key=>$value)
|
||||
{
|
||||
@unlink('icons/'.$_SESSION['server_ip'].'-'.$whoami['virtualserver_port'].'/'.$value);
|
||||
}
|
||||
}
|
||||
|
||||
$handler2=@opendir('icons/'.$_SESSION['server_ip'].'-'.$whoami['virtualserver_port'].'/');
|
||||
if($handler2)
|
||||
{
|
||||
while($datei=readdir($handler2))
|
||||
{
|
||||
if($datei!='.' AND $datei!='..')
|
||||
{
|
||||
$icon_id=str_replace("icon_", "", $datei);
|
||||
$allicons[$datei]['name']=$icon_id;
|
||||
$allicons[$datei]['id']=sprintf('%u', $icon_id & 0xffffffff);
|
||||
$allicons[$datei]['info']=getimagesize('icons/'.$_SESSION['server_ip'].'-'.$whoami['virtualserver_port'].'/'.$datei);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("port", $whoami['virtualserver_port']);
|
||||
$smarty->assign("allicons", $allicons);
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
?>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
$footer2="Teamspeak 3 Web Interface ";
|
||||
$footer3="<br /> © by <a href='http://www.ts3.cs-united.de'>Psychokiller</a><br />";
|
||||
$footer4=$footer2.($show_version == true ? $wiversion:'').$footer3;
|
||||
$smarty->assign("footer", $footer4);
|
||||
?>
|
||||
|
|
@ -1 +0,0 @@
|
|||
<?php
/*
*Copyright (C) 2012-2013 Psychokiller
*
*This program is free software; you can redistribute it and/or modify it under the terms of
*the GNU General Public License as published by the Free Software Foundation; either
*version 3 of the License, or any later version.
*
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*See the GNU General Public License for more details.
*
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
if(!defined("SECURECHECK")) {die("Error: The file can not be executed alone");}
$error='';
if($serverstatus===false)
{
$debuglog=$ts3->getDebugLog();
foreach($debuglog AS $value)
{
$error .= $value."<br />";
}
}
elseif($hoststatus===false AND isset($_POST['sendloginhost']))
{
$error .= $lang['loginerror']."<br />";
}
elseif($hoststatus===true AND $loginstatus===false AND isset($_POST['sendlogin']))
{
$debuglog=$ts3->getDebugLog();
foreach($debuglog AS $value)
{
$error .= $value."<br />";
}
}
elseif($hoststatus===true AND $loginstatus===true AND isset($_POST['sendlogin']))
{
header("Location: index.php?site=server");
exit;
}
elseif($hoststatus===true AND $loginstatus===true)
{
$error .= $lang['alreadylogin']."<br />";
}
if(!empty($error))
{
$smarty->assign("error", $error);
}
?>
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
$error = '';
|
||||
$noerror = '';
|
||||
|
||||
if(isset($_POST['editinstance']))
|
||||
{
|
||||
$instance_edit=$ts3->instanceEdit($_POST['newsettings']);
|
||||
|
||||
if($instance_edit['success']!==false)
|
||||
{
|
||||
$noerror = $lang['servereditok'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$error .= $lang['editincomplete']."<br />";
|
||||
for($i=0; $i+1==count($instance_edit['errors']); $i++)
|
||||
{
|
||||
$error .= $instance_edit['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['editshowlist']))
|
||||
{
|
||||
foreach($_POST['list'] AS $key=>$value)
|
||||
{
|
||||
$ts3->selectServer($key, 'serverId');
|
||||
foreach($value AS $key2=>$value2);
|
||||
{
|
||||
$websetting['virtualserver_weblist_enabled']=$value2;
|
||||
$server_edit=$ts3->serverEdit($websetting);
|
||||
if($server_edit['success']===false)
|
||||
{
|
||||
for($i=0; $i+1==count($instance_edit['errors']); $i++)
|
||||
{
|
||||
$error .= $server_edit['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(empty($error))
|
||||
{
|
||||
$noerror = $lang['weblisteditok'];
|
||||
}
|
||||
}
|
||||
|
||||
$instanceinfo=$ts3->getElement('data', $ts3->instanceInfo());
|
||||
$instanceinfo['serverinstance_max_download_total_bandwidth'] == '18446744073709551615' ? $instanceinfo['serverinstance_max_download_total_bandwidth'] = -1:'';
|
||||
$instanceinfo['serverinstance_max_upload_total_bandwidth'] == '18446744073709551615' ? $instanceinfo['serverinstance_max_upload_total_bandwidth'] = -1:'';
|
||||
|
||||
$serverlist=$ts3->getElement('data', $ts3->serverList());
|
||||
if(!empty($serverlist))
|
||||
{
|
||||
foreach($serverlist AS $key=>$value)
|
||||
{
|
||||
$ts3->selectServer($value['virtualserver_port']);
|
||||
$serverinfo=$ts3->getElement('data', $ts3->serverInfo());
|
||||
$serverlist[$key]['virtualserver_weblist_enabled']=$serverinfo['virtualserver_weblist_enabled'];
|
||||
$serverlist[$key]=secure($serverlist[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("instanceinfo", $instanceinfo);
|
||||
$smarty->assign("serverlist", $serverlist);
|
||||
?>
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
error_reporting(E_ALL & ~E_NOTICE);
|
||||
session_start();
|
||||
define("SECURECHECK", 1);
|
||||
|
||||
require('../config.php');
|
||||
require('lang.php');
|
||||
require('../ts3admin.class.php');
|
||||
require('../functions.inc.php');
|
||||
require_once('../libs/Smarty/libs/Smarty.class.php');
|
||||
|
||||
if(!isset($_SESSION['logged']) OR isset($_SESSION['logged']) AND $_SESSION['logged']!=true OR empty($_GET['sid'])) {die($lang['error_file_alone']);}
|
||||
|
||||
$smarty=new Smarty();
|
||||
|
||||
$smarty->template_dir = '..'.DS.'templates/';
|
||||
$smarty->compile_dir = '..'.DS.'templates_c/';
|
||||
$smarty->config_dir = '..'.DS.'configs/';
|
||||
$smarty->cache_dir = '..'.DS.'cache/';
|
||||
|
||||
if(!file_exists('..'.DS.'templates'.DS.$style))
|
||||
{
|
||||
$style="default";
|
||||
}
|
||||
|
||||
$smarty->assign("tmpl", $style);
|
||||
|
||||
$ts3=new ts3admin($_SESSION['server_ip'], $_SESSION['server_tport']);
|
||||
$ts3->connect();
|
||||
$ts3->login($_SESSION['loginuser'], unserialize(base64_decode($_SESSION['loginpw'])));
|
||||
$ts3->selectServer($_GET['sid'], 'serverId');
|
||||
|
||||
$channellist=$ts3->getElement('data', $ts3->channelList("-limits"));
|
||||
|
||||
$servergrouplist=$ts3->getElement('data', $ts3->serverGroupList());
|
||||
$channelgrouplist=$ts3->getElement('data', $ts3->channelGroupList());
|
||||
|
||||
|
||||
|
||||
$smarty->assign("lang", $lang);
|
||||
|
||||
$smarty->assign("channellist", $channellist);
|
||||
$smarty->assign("servergrouplist", $servergrouplist);
|
||||
$smarty->assign("channelgrouplist", $channelgrouplist);
|
||||
$smarty->display($style.DS.'interactive.tpl');
|
||||
?>
|
||||
|
|
@ -1,195 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2010-2011 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined('SECURECHECK')) {die($lang['error_file_alone']);}
|
||||
if($hoststatus===false) { echo $lang['nohoster']; } else {
|
||||
|
||||
if(!is_dir('site/backups/server/'.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'))
|
||||
{
|
||||
mkdir('site/backups/server/'.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/',0777);
|
||||
}
|
||||
if(!is_dir('site/backups/server/hostbackups/'.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'))
|
||||
{
|
||||
mkdir('site/backups/server/hostbackups/'.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/',0777);
|
||||
}
|
||||
|
||||
$error = '';
|
||||
$noerror = '';
|
||||
$files='';
|
||||
$serverlist=$ts3->serverList();
|
||||
|
||||
if(isset($_POST['hostbackup']))
|
||||
{
|
||||
$path='site/backups/server/hostbackups/';
|
||||
}
|
||||
else
|
||||
{
|
||||
$path='site/backups/server/';
|
||||
}
|
||||
|
||||
if(isset($_POST['create']))
|
||||
{
|
||||
if($serverlist['success']===true)
|
||||
{
|
||||
foreach($serverlist['data'] AS $key=>$value)
|
||||
{
|
||||
$selectserver=$ts3->selectServer($value['virtualserver_port'], 'port', true);
|
||||
if($selectserver['success']===true)
|
||||
{
|
||||
$snapshotcreate=$ts3->serverSnapshotCreate();
|
||||
if($snapshotcreate['success']===true)
|
||||
{
|
||||
if(!is_dir($path.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'.date("d-m-Y", time()).'/'))
|
||||
{
|
||||
mkdir($path.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'.date("d-m-Y", time()).'/',0777);
|
||||
}
|
||||
$handler=fopen($path.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'.date("d-m-Y", time()).'/server_'.time().'_'.$_SESSION['server_ip'].'-'.$value['virtualserver_port'].'.txt', 'a+');
|
||||
fwrite($handler, $snapshotcreate['data']);
|
||||
fclose($handler);
|
||||
$noerror .= sprintf($lang['serverbackupok'], $_SESSION['server_ip'], $value['virtualserver_port']).'<br />';
|
||||
}
|
||||
else
|
||||
{
|
||||
$error .= sprintf($lang['serverbackuperr'], $_SESSION['server_ip'], $value['virtualserver_port']).'<br />';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error .= sprintf($lang['serverbackuperr'], $_SESSION['server_ip'], $value['virtualserver_port']).'<br />';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error .= $lang['serverlistcallerr'].'<br />';
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['deploy']))
|
||||
{
|
||||
$handler=file($path.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'.$_POST['backupdate'].'/server_'.$_POST['backupid'].'_'.$_POST['fileport'].'.txt');
|
||||
$selectserver=$ts3->selectServer($_POST['deployon'], 'port', true);
|
||||
if($selectserver['success']===true)
|
||||
{
|
||||
$snapshot_deploy=$ts3->serverSnapshotDeploy($handler[0]);
|
||||
if($snapshot_deploy['success']===false)
|
||||
{
|
||||
for($i=0; $i+1==count($snapshot_deploy['errors']); $i++)
|
||||
{
|
||||
$error .= $snapshot_deploy['errors'][$i].'<br />';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$noerror .= $lang['serverbackdeployok'].'<br />';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($selectserver['errors']); $i++)
|
||||
{
|
||||
$error .= $selectserver['errors'][$i].'<br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['delete']))
|
||||
{
|
||||
if(@unlink($path.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'.$_POST['backupdate'].'/server_'.$_POST['backupid'].'_'.$_POST['fileport'].'.txt'))
|
||||
{
|
||||
$noerror .= $lang['serverbackdelok'].'<br />';
|
||||
}
|
||||
else
|
||||
{
|
||||
$error .= $lang['serverbackdelerr'].'<br />';
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['backupdate']))
|
||||
{
|
||||
$handler=@opendir('site/backups/server/'.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'.$_POST['backupdate'].'/');
|
||||
while($datei=@readdir($handler))
|
||||
{
|
||||
if($datei!='.' AND $datei!='..' AND $datei!='hostbackups')
|
||||
{
|
||||
$datei=str_replace('.txt', '', $datei);
|
||||
$datei_info=explode('_', $datei);
|
||||
$files[0][]=array('timestamp'=>$datei_info[1], 'server'=>$datei_info[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$handler=@opendir('site/backups/server/hostbackups/'.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/');
|
||||
while($datei=@readdir($handler))
|
||||
{
|
||||
if($datei!='.' AND $datei!='..')
|
||||
{
|
||||
$folder[1][]=$datei;
|
||||
}
|
||||
}
|
||||
$handler=@opendir('site/backups/server/'.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/');
|
||||
while($datei=@readdir($handler))
|
||||
{
|
||||
if($datei!='.' AND $datei!='..')
|
||||
{
|
||||
$folder[2][]=$datei;
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['backupdate']))
|
||||
{
|
||||
$handler=@opendir('site/backups/server/hostbackups/'.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'.$_POST['backupdate'].'/');
|
||||
while($datei=@readdir($handler))
|
||||
{
|
||||
if($datei!='.' AND $datei!='..')
|
||||
{
|
||||
$datei=str_replace('.txt', '', $datei);
|
||||
$datei_info=explode('_', $datei);
|
||||
$files[1][]=array('timestamp'=>$datei_info[1], 'server'=>$datei_info[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($serverlist['data']))
|
||||
{
|
||||
foreach($serverlist['data'] AS $key=>$value)
|
||||
{
|
||||
$serverlist['data'][$key]=secure($serverlist['data'][$key]);
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($folder[1]))
|
||||
{
|
||||
foreach($folder[1] AS $key=>$value)
|
||||
{
|
||||
$getdate=explode('-', $value);
|
||||
$newdate=mktime(0,0,0, $getdate[1], $getdate[0], $getdate[2]);
|
||||
$folder[1][$key]=$newdate;
|
||||
}
|
||||
rsort($folder[1]);
|
||||
foreach($folder[1] AS $key=>$value)
|
||||
{
|
||||
$newdate=date("d-m-Y", $value);
|
||||
$folder[1][$key]=$newdate;
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign('error', $error);
|
||||
$smarty->assign('noerror', $noerror);
|
||||
$smarty->assign('serverlist', $serverlist['data']);
|
||||
if(isset($files)) $smarty->assign('files', $files);
|
||||
if(isset($folder)) $smarty->assign('folder', $folder);
|
||||
}
|
||||
?>
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,64 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
|
||||
$error='';
|
||||
|
||||
if($serverstatus===false)
|
||||
{
|
||||
$debuglog=$ts3->getDebugLog();
|
||||
foreach($debuglog AS $value)
|
||||
{
|
||||
$error .= $value."<br />";
|
||||
}
|
||||
session_destroy();
|
||||
}
|
||||
elseif($loginstatus===true AND $hoststatus===false AND isset($_POST['sendlogin']))
|
||||
{
|
||||
header("Location: index.php?site=serverview&sid=".$_SESSION['loginsid']);
|
||||
|
||||
exit;
|
||||
}
|
||||
elseif($loginstatus===true AND $hoststatus===true AND isset($_POST['sendlogin']))
|
||||
{
|
||||
header("Location: index.php?site=server");
|
||||
|
||||
exit;
|
||||
}
|
||||
elseif($loginstatus===false AND isset($_POST['sendlogin']))
|
||||
{
|
||||
$debuglog=$ts3->getDebugLog();
|
||||
foreach($debuglog AS $value)
|
||||
{
|
||||
$error .= $value."<br />";
|
||||
}
|
||||
session_destroy();
|
||||
}
|
||||
elseif($loginstatus===true AND !isset($_POST['sendlogin']))
|
||||
{
|
||||
$error .= $lang['alreadylogin']."<br />";
|
||||
}
|
||||
|
||||
if($show_motd==true)
|
||||
{
|
||||
$motd=implode("", file('motd.txt'));
|
||||
$smarty->assign("motd", $motd);
|
||||
}
|
||||
|
||||
if(!empty($error))
|
||||
{
|
||||
$smarty->assign("error", $error);
|
||||
}
|
||||
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
|
||||
if(isset($_POST['begin_pos']))
|
||||
{
|
||||
$begin_pos=' begin_pos='.$_POST['begin_pos'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$begin_pos='';
|
||||
}
|
||||
if(empty($sid))
|
||||
{
|
||||
$instance=' instance=1';
|
||||
}
|
||||
else
|
||||
{
|
||||
$instance=' instance=0';
|
||||
}
|
||||
$getlog=$ts3->execOwnCommand('2', 'logview lines=100 reverse=1'.$instance.$begin_pos);
|
||||
|
||||
$begin_pos=$getlog['data'][0]['last_pos'];
|
||||
if(!empty($getlog['data']))
|
||||
{
|
||||
foreach($getlog['data'] AS $key=>$value)
|
||||
{
|
||||
$log[]=explode('|', $value['l'], 5);
|
||||
}
|
||||
}
|
||||
$smarty->assign("serverlog", $log);
|
||||
$smarty->assign("begin_pos", $begin_pos);
|
||||
?>
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
|
||||
$error='';
|
||||
$permexport='';
|
||||
if(isset($_POST['sourcemode']) AND $_POST['sourcemode']==1)
|
||||
{
|
||||
$permissions=$ts3->getElement('data', $ts3->serverGroupPermList($_POST['sourceid']));
|
||||
}
|
||||
elseif(isset($_POST['sourcemode']) AND $_POST['sourcemode']==2)
|
||||
{
|
||||
$permissions=$ts3->getElement('data', $ts3->channelGroupPermList($_POST['sourceid']));
|
||||
}
|
||||
elseif(isset($_POST['sourcemode']) AND $_POST['sourcemode']==3)
|
||||
{
|
||||
$permissions=$ts3->getElement('data', $ts3->channelPermList($_POST['sourceid']));
|
||||
}
|
||||
elseif(isset($_POST['sourcemode']) AND $_POST['sourcemode']==4)
|
||||
{
|
||||
$permissions=$ts3->getElement('data', $ts3->clientPermList($_POST['sourceid']));
|
||||
}
|
||||
if(isset($permissions) AND $permissions===false)
|
||||
{
|
||||
$error .= 'Source target nicht gefunden';
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isset($_POST['showcommands']))
|
||||
{
|
||||
$editperms='';
|
||||
if(!empty($permissionlist))
|
||||
{
|
||||
foreach($permissionlist AS $key=>$value)
|
||||
{
|
||||
foreach($permissions AS $key2=>$value2)
|
||||
{
|
||||
if($value['permid']==$value2['permid'])
|
||||
{
|
||||
$editperms[$value['permid']]['value']=$value2['permvalue'];
|
||||
$editperms[$value['permid']]['skip']=$value2['permskip'];
|
||||
$editperms[$value['permid']]['negated']=$value2['permnegated'];
|
||||
$editperms[$value['permid']]['delete']=0;
|
||||
}
|
||||
}
|
||||
if(!isset($editperms[$value['permid']]))
|
||||
{
|
||||
$editperms[$value['permid']]['delete']=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!empty($editperms))
|
||||
{
|
||||
$permexport=getPermsCommand($_POST['targetmode'], $_POST['targetid'], $editperms);
|
||||
}
|
||||
else
|
||||
{
|
||||
$permexport=$lang['nopermsfound'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("permexport", $permexport);
|
||||
|
|
@ -1,190 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($hoststatus===true) {
|
||||
$error = '';
|
||||
$noerror = '';
|
||||
|
||||
$sortby="virtualserver_id";
|
||||
$sorttype=SORT_ASC;
|
||||
|
||||
if(isset($_GET['sortby']))
|
||||
{
|
||||
if($_GET['sortby']=="id")
|
||||
{
|
||||
$sortby="virtualserver_id";
|
||||
}
|
||||
elseif($_GET['sortby']=="uptime")
|
||||
{
|
||||
$sortby="virtualserver_uptime";
|
||||
}
|
||||
elseif($_GET['sortby']=="name")
|
||||
{
|
||||
$sortby="virtualserver_name";
|
||||
}
|
||||
elseif($_GET['sortby']=="status")
|
||||
{
|
||||
$sortby="virtualserver_status";
|
||||
}
|
||||
elseif($_GET['sortby']=="port")
|
||||
{
|
||||
$sortby="virtualserver_port";
|
||||
}
|
||||
elseif($_GET['sortby']=="clients")
|
||||
{
|
||||
$sortby="virtualserver_clientsonline";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sortby="virtualserver_id";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_GET['sorttype']))
|
||||
{
|
||||
if($_GET['sorttype']=="asc")
|
||||
{
|
||||
$sorttype=SORT_ASC;
|
||||
}
|
||||
elseif($_GET['sorttype']=="desc")
|
||||
{
|
||||
$sorttype=SORT_DESC;
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['sendmsg']))
|
||||
{
|
||||
$_POST['msgtoall']=str_replace("\\", "\\\\", $_POST['msgtoall']);
|
||||
$gm=$ts3->gm($_POST['msgtoall']);
|
||||
if($gm['success']===false)
|
||||
{
|
||||
for($i=0; $i+1==count($gm['errors']); $i++)
|
||||
{
|
||||
$error .= $gm['errors'][$i];
|
||||
}
|
||||
}
|
||||
elseif($gm['success']===true)
|
||||
{
|
||||
$noerror = $lang['msgsendok']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['massaction']))
|
||||
{
|
||||
$serverlist=$ts3->getElement('data', $ts3->serverList());
|
||||
foreach($_POST['caction'] AS $key=>$value)
|
||||
{
|
||||
foreach($serverlist AS $key2=>$value2)
|
||||
{
|
||||
if($value2['virtualserver_id']==$key)
|
||||
{
|
||||
if(empty($value['auto']) AND $value2['virtualserver_autostart']==1 OR $value['auto']==1 AND $value2['virtualserver_autostart']==0)
|
||||
{
|
||||
$ts3->selectServer($value2['virtualserver_port'], 'port', true);
|
||||
$autostart_edit=$ts3->serverEdit(array('virtualserver_autostart'=>$value['auto']));
|
||||
if($autostart_edit['success']===false)
|
||||
{
|
||||
for($i=0; $i+1==count($autostart_edit['errors']); $i++)
|
||||
{
|
||||
$error .= $autostart_edit['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
$ts3->selectServer('0', 'serverId', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if($value['action']=='start')
|
||||
{
|
||||
$server_start=$ts3->serverStart($key);
|
||||
if($server_start['success']===false)
|
||||
{
|
||||
for($i=0; $i+1==count($server_start['errors']); $i++)
|
||||
{
|
||||
$error .= $server_start['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
elseif($server_start['success']===true)
|
||||
{
|
||||
$noerror = $lang['serverstartok']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
if($value['action']=='stop')
|
||||
{
|
||||
$server_stop=$ts3->serverStop($key);
|
||||
if($server_stop['success']===false)
|
||||
{
|
||||
for($i=0; $i+1==count($server_stop['errors']); $i++)
|
||||
{
|
||||
$error .= $server_stop['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
elseif($server_stop['success']===true)
|
||||
{
|
||||
$noerror = $lang['serverstopok']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
if($value['action']=='del')
|
||||
{
|
||||
$server_delete=$ts3->serverDelete($key);
|
||||
if($server_delete['success']===false)
|
||||
{
|
||||
for($i=0; $i+1==count($server_delete['errors']); $i++)
|
||||
{
|
||||
$error .= $server_delete['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
elseif($server_delete['success']===true)
|
||||
{
|
||||
$noerror = $lang['serverdelok']."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$serverlist=$ts3->getElement('data', $ts3->serverList());
|
||||
|
||||
$allslots='';
|
||||
$allusedslots='';
|
||||
if(!empty($serverlist))
|
||||
{
|
||||
foreach($serverlist AS $key => $value)
|
||||
{
|
||||
$allslots=$allslots+$value['virtualserver_maxclients'];
|
||||
$allusedslots=$allusedslots+$value['virtualserver_clientsonline'];
|
||||
$conv_time=$ts3->convertSecondsToArrayTime($value['virtualserver_uptime']);
|
||||
$serverlist[$key]['virtualserver_uptime']=$conv_time['days'].$lang['days']." ".$conv_time['hours'].$lang['hours']." ".$conv_time['minutes'].$lang['minutes']." ".$conv_time['seconds'].$lang['seconds'];
|
||||
$serverlist[$key]=secure($serverlist[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($serverlist))
|
||||
{
|
||||
foreach($serverlist AS $key=>$value)
|
||||
{
|
||||
|
||||
$sort[]=$value[$sortby];
|
||||
}
|
||||
|
||||
array_multisort($sort, $sorttype, $serverlist);
|
||||
}
|
||||
|
||||
$smarty->assign("sortby", $sortby);
|
||||
$smarty->assign("sorttype", $sorttype);
|
||||
$smarty->assign("serverstats", sprintf($lang['serverstats'], count($serverlist), $allslots, $allusedslots));
|
||||
$smarty->assign("serverlist", $serverlist);
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
} ?>
|
||||
|
|
@ -1,176 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
|
||||
if(!is_dir("site/backups/server/".$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'))
|
||||
{
|
||||
mkdir("site/backups/server/".$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/',0777);
|
||||
}
|
||||
if(!is_dir("site/backups/server/hostbackups/".$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'))
|
||||
{
|
||||
mkdir("site/backups/server/hostbackups/".$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/',0777);
|
||||
}
|
||||
|
||||
if($hoststatus===false) { echo $lang['nohoster']; } else {
|
||||
$error = '';
|
||||
$noerror = '';
|
||||
$files='';
|
||||
$serverlist=$ts3->serverList();
|
||||
|
||||
if(isset($_POST['hostbackup']))
|
||||
{
|
||||
$path="site/backups/server/hostbackups/";
|
||||
}
|
||||
else
|
||||
{
|
||||
$path="site/backups/server/";
|
||||
}
|
||||
|
||||
if(isset($_POST['create']))
|
||||
{
|
||||
$serversnapshot=$ts3->serverSnapshotCreate();
|
||||
if($serversnapshot['success']!==false)
|
||||
{
|
||||
if(!is_dir($path.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'.date("d-m-Y", time()).'/'))
|
||||
{
|
||||
mkdir($path.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'.date("d-m-Y", time()).'/',0777);
|
||||
}
|
||||
$handler=fopen($path.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'.date("d-m-Y", time()).'/server_'.time().'_'.$_SESSION['server_ip'].'-'.$whoami['virtualserver_port'].'.txt', 'a+');
|
||||
fwrite($handler, $serversnapshot['data']);
|
||||
fclose($handler);
|
||||
$noerror .= sprintf($lang['serverbackupok'], $_SESSION['server_ip'], $whoami['virtualserver_port'])."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
$error .= sprintf($lang['serverbackuperr'], $_SESSION['server_ip'], $whoami['virtualserver_port'])."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['deploy']))
|
||||
{
|
||||
$handler=file($path.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'.$_POST['backupdate'].'/server_'.$_POST['backupid'].'_'.$_POST['fileport'].'.txt');
|
||||
$snapshot_deploy=$ts3->serverSnapshotDeploy($handler[0]);
|
||||
if($snapshot_deploy['success']===false)
|
||||
{
|
||||
for($i=0; $i+1==count($snapshot_deploy['errors']); $i++)
|
||||
{
|
||||
echo $snapshot_deploy['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$noerror .= $lang['serverbackdeployok']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['delete']))
|
||||
{
|
||||
if(@unlink($path.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'.$_POST['backupdate'].'/server_'.$_POST['backupid'].'_'.$_POST['fileport'].'.txt'))
|
||||
{
|
||||
$noerror .= $lang['serverbackdelok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
$error .= $lang['serverbackdelerr']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['deleteall']))
|
||||
{
|
||||
$handler=opendir($path.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'.$_POST['backupdate'].'/');
|
||||
while($datei=readdir($handler))
|
||||
{
|
||||
if($datei!='.' AND $datei!='..')
|
||||
{
|
||||
@unlink($path.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'.$_POST['backupdate'].'/'.$datei);
|
||||
}
|
||||
}
|
||||
if(@rmdir($path.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'.$_POST['backupdate'].'/'))
|
||||
{
|
||||
$noerror .= $lang['serverbackdelok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
$error .= $lang['serverbackdelerr']."<br />";
|
||||
}
|
||||
unset($_POST['backupdate']);
|
||||
}
|
||||
if(isset($_POST['backupdate']))
|
||||
{
|
||||
$handler=@opendir('site/backups/server/'.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'.$_POST['backupdate'].'/');
|
||||
while($datei=@readdir($handler))
|
||||
{
|
||||
if($datei!='.' AND $datei!='..' AND $datei!='hostbackups')
|
||||
{
|
||||
$datei=str_replace('.txt', '', $datei);
|
||||
$datei_info=explode('_', $datei);
|
||||
$files[0][]=array('timestamp'=>$datei_info[1], 'server'=>$datei_info[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
$handler=@opendir('site/backups/server/hostbackups/'.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/');
|
||||
while($datei=@readdir($handler))
|
||||
{
|
||||
if($datei!='.' AND $datei!='..')
|
||||
{
|
||||
$folder[1][]=$datei;
|
||||
}
|
||||
}
|
||||
$handler=@opendir('site/backups/server/'.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/');
|
||||
while($datei=@readdir($handler))
|
||||
{
|
||||
if($datei!='.' AND $datei!='..')
|
||||
{
|
||||
$folder[2][]=$datei;
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['backupdate']))
|
||||
{
|
||||
$handler=@opendir('site/backups/server/hostbackups/'.$_SESSION['server_ip'].'-'.$_SESSION['server_tport'].'/'.$_POST['backupdate'].'/');
|
||||
while($datei=@readdir($handler))
|
||||
{
|
||||
if($datei!='.' AND $datei!='..')
|
||||
{
|
||||
$datei=str_replace('.txt', '', $datei);
|
||||
$datei_info=explode('_', $datei);
|
||||
$files[1][]=array('timestamp'=>$datei_info[1], 'server'=>$datei_info[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($folder[1]))
|
||||
{
|
||||
foreach($folder[1] AS $key=>$value)
|
||||
{
|
||||
$getdate=explode('-', $value);
|
||||
$newdate=mktime(0,0,0, $getdate[1], $getdate[0], $getdate[2]);
|
||||
$folder[1][$key]=$newdate;
|
||||
}
|
||||
rsort($folder[1]);
|
||||
foreach($folder[1] AS $key=>$value)
|
||||
{
|
||||
$newdate=date("d-m-Y", $value);
|
||||
$folder[1][$key]=$newdate;
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("files", $files);
|
||||
$smarty->assign('folder', $folder);
|
||||
$smarty->assign("getserverip", $_SESSION['server_ip']."-".$whoami['virtualserver_port']);
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,149 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($sid===false OR empty($sid)) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
|
||||
$error='';
|
||||
$err_msg='';
|
||||
$noerror='';
|
||||
if(isset($_POST['editserver']))
|
||||
{
|
||||
if(!empty($_POST['newsettings']))
|
||||
{
|
||||
if($_POST['newsettings']['virtualserver_icon_id']<0)
|
||||
{
|
||||
$_POST['newsettings']['virtualserver_icon_id']=sprintf('%u', $serverinfo['virtualserver_icon_id'] & 0xffffffff);
|
||||
}
|
||||
if(!isset($_POST['newsettings']['virtualserver_log_client']) or empty($_POST['newsettings']['virtualserver_log_client']))
|
||||
{
|
||||
$_POST['newsettings']['virtualserver_log_client']=0;
|
||||
}
|
||||
if(!isset($_POST['newsettings']['virtualserver_log_query']) or empty($_POST['newsettings']['virtualserver_log_query']))
|
||||
{
|
||||
$_POST['newsettings']['virtualserver_log_query']=0;
|
||||
}
|
||||
if(!isset($_POST['newsettings']['virtualserver_log_channel']) or empty($_POST['newsettings']['virtualserver_log_channel']))
|
||||
{
|
||||
$_POST['newsettings']['virtualserver_log_channel']=0;
|
||||
}
|
||||
if(!isset($_POST['newsettings']['virtualserver_log_permissions']) or empty($_POST['newsettings']['virtualserver_log_permissions']))
|
||||
{
|
||||
$_POST['newsettings']['virtualserver_log_permissions']=0;
|
||||
}
|
||||
if(!isset($_POST['newsettings']['virtualserver_log_server']) or empty($_POST['newsettings']['virtualserver_log_server']))
|
||||
{
|
||||
$_POST['newsettings']['virtualserver_log_server']=0;
|
||||
}
|
||||
if(!isset($_POST['newsettings']['virtualserver_log_filetransfer']) or empty($_POST['newsettings']['virtualserver_log_filetransfer']))
|
||||
{
|
||||
$_POST['newsettings']['virtualserver_log_filetransfer']=0;
|
||||
}
|
||||
foreach($_POST['newsettings'] AS $key=>$value)
|
||||
{
|
||||
$server_edit=$ts3->serverEdit(array($key=>$value));
|
||||
|
||||
if($server_edit['success']===false)
|
||||
{
|
||||
for($i=0; $i+1==count($server_edit['errors']); $i++)
|
||||
{
|
||||
$err_msg .= $server_edit['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
if(empty($err_msg))
|
||||
{
|
||||
$noerror .= $lang['servereditok'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$error .= $lang['editincomplete']."<br />".$err_msg;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isset($_POST['editpw']))
|
||||
{
|
||||
$server_edit=$ts3->serverEdit($_POST['newsettings']);
|
||||
if($server_edit['success']!==false)
|
||||
{
|
||||
$noerror .=$lang['passwordsetok'];
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($server_edit['errors']); $i++)
|
||||
{
|
||||
$error .= $server_edit['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$serverinfo=$ts3->getElement('data', $ts3->serverInfo());
|
||||
$servergroups=$ts3->getElement('data', $ts3->serverGroupList());
|
||||
$channelgroups=$ts3->getElement('data', $ts3->channelGroupList());
|
||||
|
||||
//Bearbeitung der Ausgabe!
|
||||
if(!empty($serverinfo))
|
||||
{
|
||||
$serverinfo=secure($serverinfo);
|
||||
$conv_time=$ts3->convertSecondsToArrayTime($serverinfo['virtualserver_uptime']);
|
||||
$serverinfo['virtualserver_uptime']=$conv_time['days'].$lang['days']." ".$conv_time['hours'].$lang['hours']." ".$conv_time['minutes'].$lang['minutes']." ".$conv_time['seconds'].$lang['seconds'];
|
||||
|
||||
if($serverinfo['virtualserver_icon_id']<0)
|
||||
{
|
||||
$serverinfo['virtualserver_icon_id']=sprintf('%u', $serverinfo['virtualserver_icon_id'] & 0xffffffff);
|
||||
}
|
||||
if($serverinfo['virtualserver_max_upload_total_bandwidth']==18446744073709551615)
|
||||
{
|
||||
$serverinfo['virtualserver_max_upload_total_bandwidth']=-1;
|
||||
}
|
||||
if($serverinfo['virtualserver_upload_quota']==18446744073709551615)
|
||||
{
|
||||
$serverinfo['virtualserver_upload_quota']=-1;
|
||||
}
|
||||
if($serverinfo['virtualserver_max_download_total_bandwidth']==18446744073709551615)
|
||||
{
|
||||
$serverinfo['virtualserver_max_download_total_bandwidth']=-1;
|
||||
}
|
||||
if($serverinfo['virtualserver_download_quota']==18446744073709551615)
|
||||
{
|
||||
$serverinfo['virtualserver_download_quota']=-1;
|
||||
}
|
||||
$serverinfo['virtualserver_welcomemessage']=str_replace('\r\n', "\r\n", $serverinfo['virtualserver_welcomemessage']);
|
||||
$serverinfo['virtualserver_hostmessage']=str_replace('\r\n', "\r\n", $serverinfo['virtualserver_hostmessage']);
|
||||
}
|
||||
|
||||
if(!empty($servergroups))
|
||||
{
|
||||
foreach($servergroups AS $key=>$value)
|
||||
{
|
||||
$servergroups[$key]=secure($servergroups[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($channelgroups))
|
||||
{
|
||||
foreach($channelgroups AS $key=>$value)
|
||||
{
|
||||
$channelgroups[$key]=secure($channelgroups[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("serverinfo", $serverinfo);
|
||||
$smarty->assign("servergroups", $servergroups);
|
||||
$smarty->assign("channelgroups", $channelgroups);
|
||||
|
||||
} ?>
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if(!isset($sid))
|
||||
{
|
||||
$hostinfo=$ts3->getElement('data', $ts3->hostInfo());
|
||||
if(!empty($hostinfo))
|
||||
{
|
||||
$hostinfo['connection_bytes_received_total']=conv_traffic($hostinfo['connection_bytes_received_total']);
|
||||
$hostinfo['connection_bytes_sent_total']=conv_traffic($hostinfo['connection_bytes_sent_total']);
|
||||
$hostinfo['connection_bandwidth_received_last_second_total']=conv_traffic($hostinfo['connection_bandwidth_received_last_second_total']);
|
||||
$hostinfo['connection_bandwidth_sent_last_second_total']=conv_traffic($hostinfo['connection_bandwidth_sent_last_second_total']);
|
||||
$hostinfo['connection_bandwidth_received_last_minute_total']=conv_traffic($hostinfo['connection_bandwidth_received_last_minute_total']);
|
||||
$hostinfo['connection_bandwidth_sent_last_minute_total']=conv_traffic($hostinfo['connection_bandwidth_sent_last_minute_total']);
|
||||
$hostinfo['connection_filetransfer_bandwidth_received']=conv_traffic($hostinfo['connection_filetransfer_bandwidth_received']);
|
||||
$hostinfo['connection_filetransfer_bandwidth_sent']=conv_traffic($hostinfo['connection_filetransfer_bandwidth_sent']);
|
||||
}
|
||||
$smarty->assign("hostinfo", $hostinfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
$serverinfo=$ts3->getElement('data', $ts3->serverInfo());
|
||||
if(!empty($serverinfo))
|
||||
{
|
||||
$serverinfo['connection_bytes_received_total']=conv_traffic($serverinfo['connection_bytes_received_total']);
|
||||
$serverinfo['connection_bytes_sent_total']=conv_traffic($serverinfo['connection_bytes_sent_total']);
|
||||
$serverinfo['connection_bandwidth_received_last_second_total']=conv_traffic($serverinfo['connection_bandwidth_received_last_second_total']);
|
||||
$serverinfo['connection_bandwidth_sent_last_second_total']=conv_traffic($serverinfo['connection_bandwidth_sent_last_second_total']);
|
||||
$serverinfo['connection_bandwidth_received_last_minute_total']=conv_traffic($serverinfo['connection_bandwidth_received_last_minute_total']);
|
||||
$serverinfo['connection_bandwidth_sent_last_minute_total']=conv_traffic($serverinfo['connection_bandwidth_sent_last_minute_total']);
|
||||
$serverinfo['connection_filetransfer_bandwidth_received']=conv_traffic($serverinfo['connection_filetransfer_bandwidth_received']);
|
||||
$serverinfo['connection_filetransfer_bandwidth_sent']=conv_traffic($serverinfo['connection_filetransfer_bandwidth_sent']);
|
||||
}
|
||||
$smarty->assign("serverinfo", $serverinfo);
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,455 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
$error = '';
|
||||
$noerror = '';
|
||||
if(isset($_POST['sendmassmove']))
|
||||
{
|
||||
$clientlist=$ts3->clientList("-groups");
|
||||
if($clientlist['success']!=false)
|
||||
{
|
||||
if(isset($_POST['moveall']) AND $_POST['moveall']==1)
|
||||
{
|
||||
foreach($clientlist['data'] AS $key=>$value)
|
||||
{
|
||||
if($value['client_type']!=1)
|
||||
{
|
||||
$client_move=$ts3->clientMove($value['clid'], $_POST['cid']);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$clients_to_move=array();
|
||||
if(isset($_POST['movebysgroup']))
|
||||
{
|
||||
foreach($clientlist['data'] AS $key=>$value)
|
||||
{
|
||||
$client_sgroups=explode(",", $value['client_servergroups']);
|
||||
foreach($_POST['movebysgroup'] AS $key2=>$value2)
|
||||
{
|
||||
if(!in_array($value['clid'], $clients_to_move))
|
||||
{
|
||||
if(in_array($value2, $client_sgroups))
|
||||
{
|
||||
if($value['client_type']!=1)
|
||||
{
|
||||
$clients_to_move[]=$value['clid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['movebycgroup']))
|
||||
{
|
||||
foreach($clientlist['data'] AS $key=>$value)
|
||||
{
|
||||
if(!in_array($value['clid'], $clients_to_move))
|
||||
{
|
||||
if(in_array($value['client_channel_group_id'], $_POST['movebycgroup']))
|
||||
{
|
||||
if($value['client_type']!=1)
|
||||
{
|
||||
$clients_to_move[]=$value['clid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['movebycid']))
|
||||
{
|
||||
foreach($clientlist['data'] AS $key=>$value)
|
||||
{
|
||||
if(!in_array($value['clid'], $clients_to_move))
|
||||
{
|
||||
if(in_array($value['cid'], $_POST['movebycid']))
|
||||
{
|
||||
if($value['client_type']!=1)
|
||||
{
|
||||
$clients_to_move[]=$value['clid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($clients_to_move AS $key=>$value)
|
||||
{
|
||||
$client_move=$ts3->clientMove($value, $_POST['cid']);
|
||||
}
|
||||
}
|
||||
/**
|
||||
$debuglog=$ts3->getDebugLog();
|
||||
if(!empty($debuglog))
|
||||
{
|
||||
foreach($debuglog AS $key=>$value)
|
||||
{
|
||||
$error.=$value."<br />";
|
||||
}
|
||||
}
|
||||
**/
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['sendmasskick']))
|
||||
{
|
||||
$clientlist=$ts3->clientList("-groups");
|
||||
if($clientlist['success']!=false)
|
||||
{
|
||||
if(isset($_POST['kickall']) AND $_POST['kickall']==1)
|
||||
{
|
||||
foreach($clientlist['data'] AS $key=>$value)
|
||||
{
|
||||
if($value['client_type']!=1)
|
||||
{
|
||||
$client_kick=$ts3->clientKick($value['clid'], 'server', $_POST['kickmsg']);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$clients_to_kick=array();
|
||||
if(isset($_POST['kickbysgroup']))
|
||||
{
|
||||
foreach($clientlist['data'] AS $key=>$value)
|
||||
{
|
||||
$client_sgroups=explode(",", $value['client_servergroups']);
|
||||
foreach($_POST['kickbysgroup'] AS $key2=>$value2)
|
||||
{
|
||||
if(!in_array($value['clid'], $clients_to_kick))
|
||||
{
|
||||
if(in_array($value2, $client_sgroups))
|
||||
{
|
||||
if($value['client_type']!=1)
|
||||
{
|
||||
$clients_to_kick[]=$value['clid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['kickbycgroup']))
|
||||
{
|
||||
foreach($clientlist['data'] AS $key=>$value)
|
||||
{
|
||||
if(!in_array($value['clid'], $clients_to_kick))
|
||||
{
|
||||
if(in_array($value['client_channel_group_id'], $_POST['kickbycgroup']))
|
||||
{
|
||||
if($value['client_type']!=1)
|
||||
{
|
||||
$clients_to_kick[]=$value['clid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['kickbycid']))
|
||||
{
|
||||
foreach($clientlist['data'] AS $key=>$value)
|
||||
{
|
||||
if(!in_array($value['clid'], $clients_to_kick))
|
||||
{
|
||||
if(in_array($value['cid'], $_POST['kickbycid']))
|
||||
{
|
||||
if($value['client_type']!=1)
|
||||
{
|
||||
$clients_to_kick[]=$value['clid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($clients_to_kick AS $key=>$value)
|
||||
{
|
||||
$client_kick=$ts3->clientKick($value, 'server', $_POST['kickmsg']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['sendmassban']))
|
||||
{
|
||||
$clientlist=$ts3->clientList("-groups");
|
||||
if($clientlist['success']!=false)
|
||||
{
|
||||
if(isset($_POST['banall']) AND $_POST['banall']==1)
|
||||
{
|
||||
foreach($clientlist['data'] AS $key=>$value)
|
||||
{
|
||||
if($value['client_type']!=1)
|
||||
{
|
||||
$client_ban=$ts3->banClient($value['clid'], $_POST['bantime'], $_POST['banmsg']);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$clients_to_ban=array();
|
||||
if(isset($_POST['banbysgroup']))
|
||||
{
|
||||
foreach($clientlist['data'] AS $key=>$value)
|
||||
{
|
||||
$client_sgroups=explode(",", $value['client_servergroups']);
|
||||
foreach($_POST['banbysgroup'] AS $key2=>$value2)
|
||||
{
|
||||
if(!in_array($value['clid'], $clients_to_ban))
|
||||
{
|
||||
if(in_array($value2, $client_sgroups))
|
||||
{
|
||||
if($value['client_type']!=1)
|
||||
{
|
||||
$clients_to_ban[]=$value['clid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['banbycgroup']))
|
||||
{
|
||||
foreach($clientlist['data'] AS $key=>$value)
|
||||
{
|
||||
if(!in_array($value['clid'], $clients_to_ban))
|
||||
{
|
||||
if(in_array($value['client_channel_group_id'], $_POST['banbycgroup']))
|
||||
{
|
||||
if($value['client_type']!=1)
|
||||
{
|
||||
$clients_to_ban[]=$value['clid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['banbycid']))
|
||||
{
|
||||
foreach($clientlist['data'] AS $key=>$value)
|
||||
{
|
||||
if(!in_array($value['clid'], $clients_to_ban))
|
||||
{
|
||||
if(in_array($value['cid'], $_POST['banbycid']))
|
||||
{
|
||||
if($value['client_type']!=1)
|
||||
{
|
||||
$clients_to_ban[]=$value['clid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($clients_to_ban AS $key=>$value)
|
||||
{
|
||||
$client_ban=$ts3->banClient($value, $_POST['bantime'], $_POST['banmsg']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['sendkick']))
|
||||
{
|
||||
$client_kick=$ts3->clientKick($_POST['clid'], 'server', $_POST['kickmsg']);
|
||||
if($client_kick['success']===false)
|
||||
{
|
||||
for($i=0; $i+1==count($client_kick['errors']); $i++)
|
||||
{
|
||||
$error .= $client_kick['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$noerror .= $lang['clientkickok']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['sendban']))
|
||||
{
|
||||
$client_ban=$ts3->banClient($_POST['clid'], $_POST['bantime'], $_POST['banmsg']);
|
||||
if($client_ban['success']===false)
|
||||
{
|
||||
for($i=0; $i+1==count($client_ban['errors']); $i++)
|
||||
{
|
||||
$error .= $client_ban['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$noerror .= $lang['clientbanok']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['sendpoke']))
|
||||
{
|
||||
$client_poke=$ts3->clientPoke($_POST['clid'], $_POST['pokemsg']);
|
||||
if($client_poke['success']===false)
|
||||
{
|
||||
for($i=0; $i+1==count($client_poke['errors']); $i++)
|
||||
{
|
||||
$error .= $client_poke['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$noerror .= $lang['clientpokeok']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['sendmove']))
|
||||
{
|
||||
$client_move=$ts3->clientMove($_POST['clid'], $_POST['cid']);
|
||||
if($client_move['success']===false)
|
||||
{
|
||||
for($i=0; $i+1==count($client_move['errors']); $i++)
|
||||
{
|
||||
$error .= $client_move['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$noerror .= $lang['clientmoveok']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['sendmsg']))
|
||||
{
|
||||
$_POST['msgtoserver']=str_replace("\\", "\\\\", $_POST['msgtoserver']);
|
||||
$send_message=$ts3->sendMessage('3', $_POST['sid'], $_POST['msgtoserver']);
|
||||
if($send_message['success']===false)
|
||||
{
|
||||
for($i=0; $i+1==count($send_message['errors']); $i++)
|
||||
{
|
||||
$error .= $send_message['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$noerror .= $lang['msgsendok']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['start']))
|
||||
{
|
||||
$server_start=$ts3->serverStart($_POST['sid']);
|
||||
if($server_start['success']===false)
|
||||
{
|
||||
for($i=0; $i+1==count($server_start['errors']); $i++)
|
||||
{
|
||||
$error .= $server_start['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$noerror .= $lang['serverstartok']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['stop']))
|
||||
{
|
||||
$server_stop=$ts3->serverStop($_POST['sid']);
|
||||
if($server_stop['success']===false)
|
||||
{
|
||||
for($i=0; $i+1==count($server_stop['errors']); $i++)
|
||||
{
|
||||
$error .= $server_stop['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$noerror .= $lang['serverstopok']."<br />";
|
||||
}
|
||||
$ts3->selectServer($sid, 'serverId', true);
|
||||
}
|
||||
|
||||
$serverinfo=$ts3->getElement('data', $ts3->serverInfo());
|
||||
$servergroups=$ts3->getElement('data', $ts3->serverGroupList());
|
||||
$channelgroups=$ts3->getElement('data', $ts3->channelGroupList());
|
||||
$newserverversion=check_server_version($serverinfo['virtualserver_version'], $seversionurl);
|
||||
|
||||
$getpath=explode("index.php", $_SERVER['REQUEST_URI']);
|
||||
|
||||
if($_SERVER['SERVER_PORT']==443)
|
||||
{
|
||||
$gethttp="https://";
|
||||
}
|
||||
else
|
||||
{
|
||||
$gethttp="http://";
|
||||
}
|
||||
$pubtsview=secure("<iframe allowtransparency=\"true\" src=\"".$gethttp.$_SERVER['HTTP_HOST'].$getpath[0]."tsviewpub.php?skey=".$_SESSION['skey']."&sid=".$sid."&showicons=right&bgcolor=ffffff&fontcolor=000000\" style=\"height:100%;width:100%\" scrolling=\"auto\" frameborder=\"0\">Your Browser will not show Iframes</iframe>");
|
||||
|
||||
//Bearbeitung der Ausgabe!
|
||||
|
||||
if(!empty($serverinfo))
|
||||
{
|
||||
$serverinfo=secure($serverinfo);
|
||||
|
||||
$conv_time=$ts3->convertSecondsToArrayTime($serverinfo['virtualserver_uptime']);
|
||||
$serverinfo['virtualserver_uptime']=$conv_time['days'].$lang['days']." ".$conv_time['hours'].$lang['hours']." ".$conv_time['minutes'].$lang['minutes']." ".$conv_time['seconds'].$lang['seconds'];
|
||||
|
||||
if($serverinfo['virtualserver_icon_id']<0)
|
||||
{
|
||||
$serverinfo['virtualserver_icon_id']=sprintf('%u', $serverinfo['virtualserver_icon_id'] & 0xffffffff);
|
||||
}
|
||||
if($serverinfo['virtualserver_max_upload_total_bandwidth']==18446744073709551615)
|
||||
{
|
||||
$serverinfo['virtualserver_max_upload_total_bandwidth']=-1;
|
||||
}
|
||||
if($serverinfo['virtualserver_upload_quota']==18446744073709551615)
|
||||
{
|
||||
$serverinfo['virtualserver_upload_quota']=-1;
|
||||
}
|
||||
if($serverinfo['virtualserver_max_download_total_bandwidth']==18446744073709551615)
|
||||
{
|
||||
$serverinfo['virtualserver_max_download_total_bandwidth']=-1;
|
||||
}
|
||||
if($serverinfo['virtualserver_download_quota']==18446744073709551615)
|
||||
{
|
||||
$serverinfo['virtualserver_download_quota']=-1;
|
||||
}
|
||||
|
||||
if($serverinfo['virtualserver_icon_id']<0)
|
||||
{
|
||||
$serverinfo['virtualserver_icon_id']=sprintf('%u', $serverinfo['virtualserver_icon_id'] & 0xffffffff);
|
||||
}
|
||||
|
||||
$sversion=explode(' ', $serverinfo['virtualserver_version']);
|
||||
$sversion2=date('d.m.Y H:i:s',str_replace(']', '', $sversion[2]));
|
||||
$serverinfo['virtualserver_version']=$sversion[0].' '.$sversion[1].' '.$sversion2.']';
|
||||
|
||||
$serverinfo['virtualserver_welcomemessage']=parse_bbcode(str_replace('\r\n', '<br />', $serverinfo['virtualserver_welcomemessage']));
|
||||
$serverinfo['virtualserver_hostmessage']=parse_bbcode(str_replace('\r\n', '<br />', $serverinfo['virtualserver_hostmessage']));
|
||||
}
|
||||
|
||||
include("site/tsview.php");
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("pubtsview", $pubtsview);
|
||||
$smarty->assign("serverinfo", $serverinfo);
|
||||
$smarty->assign("servergroups", $servergroups);
|
||||
$smarty->assign("channelgroups", $channelgroups);
|
||||
$smarty->assign("newserverversion", $newserverversion);
|
||||
|
||||
?>
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
|
||||
$error='';
|
||||
$noerror='';
|
||||
|
||||
if(isset($_POST['addgroup']))
|
||||
{
|
||||
if(!empty($_POST['name']))
|
||||
{
|
||||
if(!empty($_POST['copyfrom']))
|
||||
{
|
||||
empty($_POST['type']) ? $type=0:$type=$_POST['type'];
|
||||
$creategroup=$ts3->serverGroupCopy($_POST['copyfrom'], $_POST['overwrite'], $_POST['name'], $type);
|
||||
if($creategroup['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['groupcreatedok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($creategroup['errors']); $i++)
|
||||
{
|
||||
$error .= $creategroup['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
empty($_POST['type']) ? $type=0:$type=$_POST['type'];
|
||||
$creategroup=$ts3->serverGroupAdd($_POST['name'], $type);
|
||||
if($creategroup['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['groupcreatedok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($creategroup['errors']); $i++)
|
||||
{
|
||||
$error .= $creategroup['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error .= $lang['groupnameempty']."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
$servergroups=$ts3->getElement('data', $ts3->serverGroupList());
|
||||
if(!empty($servergroups))
|
||||
{
|
||||
foreach($servergroups AS $key => $value)
|
||||
{
|
||||
if ($hoststatus===false AND $value['type']=='2' OR $hoststatus===false AND $value['type']=='0')
|
||||
{
|
||||
unset($servergroups[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("servergroups", $servergroups);
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($sid===false OR empty($sid)) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
|
||||
$error='';
|
||||
$noerror='';
|
||||
|
||||
if(isset($_POST['kickclient']))
|
||||
{
|
||||
$sgroup_del_client=$ts3->serverGroupDeleteClient($sgid, $_POST['cldbid']);
|
||||
if($sgroup_del_client['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['clientremoveok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($sgroup_del_client['errors']); $i++)
|
||||
{
|
||||
$error .= $sgroup_del_client['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isset($_POST['addclient']))
|
||||
{
|
||||
$sgroup_add_client=$ts3->serverGroupAddClient($sgid, $_POST['cldbid']);
|
||||
if($sgroup_add_client['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['clientaddok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($sgroup_add_client['errors']); $i++)
|
||||
{
|
||||
$error .= $sgroup_add_client['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
$servergroups=$ts3->getElement('data', $ts3->serverGroupList());
|
||||
|
||||
$groupclients=$ts3->getElement('data', $ts3->serverGroupClientList($sgid, true));
|
||||
foreach($servergroups AS $value)
|
||||
{
|
||||
if($sgid==$value['sgid'])
|
||||
{
|
||||
$sgroupid=$value['sgid'];
|
||||
$sgroupname=$value['name'];
|
||||
}
|
||||
}
|
||||
$start_while=0;
|
||||
$duration_while=100;
|
||||
if(!isset($groupclients[0]['']) AND !empty($groupclients))
|
||||
{
|
||||
while($clientdblist=$ts3->getElement('data', $ts3->clientDbList($start_while, $duration_while)))
|
||||
{
|
||||
foreach($groupclients AS $key=>$value)
|
||||
{
|
||||
foreach($clientdblist AS $value2)
|
||||
{
|
||||
if($value['cldbid']==$value2['cldbid'])
|
||||
{
|
||||
$groupclients[$key]['client_unique_identifier']=$value2['client_unique_identifier'];
|
||||
$groupclients[$key]['client_nickname']=secure($value2['client_nickname']);
|
||||
$groupclients[$key]['client_created']=$value2['client_created'];
|
||||
$groupclients[$key]['client_lastconnected']=$value2['client_lastconnected'];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
$start_while=$start_while+$duration_while;
|
||||
}
|
||||
}
|
||||
elseif(isset($groupclients[0]['']))
|
||||
{
|
||||
unset ($groupclients);
|
||||
}
|
||||
|
||||
if(isset($_POST['searchby']) AND $_POST['searchby']=='cldbid' AND !empty($_POST['search']) AND !empty($groupclients))
|
||||
{
|
||||
foreach ($groupclients AS $key => $value)
|
||||
{
|
||||
if($_POST['search']!=$value['cldbid'])
|
||||
{
|
||||
unset($groupclients[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif(isset($_POST['searchby']) AND $_POST['searchby']=='name' AND !empty($_POST['search']) AND !empty($groupclients))
|
||||
{
|
||||
foreach ($groupclients AS $key => $value)
|
||||
{
|
||||
if(strpos(strtolower($value['client_nickname']),strtolower($_POST['search']))===false)
|
||||
{
|
||||
unset($groupclients[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("sgroupid", $sgroupid);
|
||||
$smarty->assign("sgroupname", secure($sgroupname));
|
||||
$smarty->assign("groupclients", $groupclients);
|
||||
?>
|
||||
|
|
@ -1,183 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($sid===false OR empty($sid) AND $sgid!=3) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
$error='';
|
||||
$servergroups=$ts3->getElement('data', $ts3->serverGroupList());
|
||||
$serverinfo=$ts3->getElement('data', $ts3->serverInfo());
|
||||
$get_build=explode(' ', $serverinfo['virtualserver_version']);
|
||||
$get_build=str_replace(']', '', $get_build[2]);
|
||||
|
||||
foreach($servergroups AS $value)
|
||||
{
|
||||
if($sgid==$value['sgid'])
|
||||
{
|
||||
$sgroupname=$value['name'];
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['showmyperms']) AND $_POST['showmyperms']==1)
|
||||
{
|
||||
$showmyperms=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$showmyperms=0;
|
||||
}
|
||||
|
||||
if($showmyperms==1 or !empty($_POST['searchperms']))
|
||||
{
|
||||
$display="block";
|
||||
$disp_pic="minus";
|
||||
}
|
||||
else
|
||||
{
|
||||
$display="none";
|
||||
$disp_pic="plus";
|
||||
}
|
||||
|
||||
if (isset($_POST['editall']))
|
||||
{
|
||||
$delperms=array();
|
||||
$editperms=array();
|
||||
$allpermsedit=$_POST['perm'];
|
||||
|
||||
|
||||
foreach($allpermsedit AS $key => $value)
|
||||
{
|
||||
if(isset($_POST['granttoall']) AND isset($value['grant']) AND $value['grant']==1 AND isset($value['available']))
|
||||
{
|
||||
if($_POST['granttoall']===0 OR $_POST['granttoall']>0)
|
||||
{
|
||||
$value['value']=$_POST['granttoall'];
|
||||
}
|
||||
}
|
||||
if(isset($value['delperm']) AND $value['delperm']==1)
|
||||
{
|
||||
$delperms[]=$key;
|
||||
}
|
||||
elseif(isset($value['grant']) AND $value['grant']==1 AND !isset($value['available']) AND $value['value']==0)
|
||||
{
|
||||
|
||||
}
|
||||
elseif(isset($value['available']) OR !isset($value['available']) AND !empty($value['value']) OR !isset($value['available']) AND !empty($value['skip']) OR !isset($value['available']) AND !empty($value['negated']))
|
||||
{
|
||||
(!isset($value['value']) or empty($value['value'])) ? $editperms[$key][]='0' : $editperms[$key][]=$value['value'];
|
||||
(!isset($value['skip']) or empty($value['skip'])) ? $editperms[$key][]='0' : $editperms[$key][]=$value['skip'];
|
||||
(!isset($value['negated']) or empty($value['negated'])) ? $editperms[$key][]='0' : $editperms[$key][]=$value['negated'];
|
||||
}
|
||||
}
|
||||
|
||||
$sgrouplist=$ts3->getElement('data', $ts3->serverGroupPermList($sgid));
|
||||
if(!empty($sgrouplist))
|
||||
{
|
||||
foreach($sgrouplist AS $value)
|
||||
{
|
||||
foreach($editperms AS $key2=>$value2)
|
||||
{
|
||||
if($value['permid']==$key2 AND $value['permvalue']==$value2[0] AND $value['permskip']==$value2[1] AND $value['permnegated']==$value2[2])
|
||||
{
|
||||
unset($editperms[$key2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($editperms))
|
||||
{
|
||||
$ts3->serverGroupAddPerm($sgid, $editperms);
|
||||
$debug=$ts3->getDebugLog();
|
||||
foreach($debug AS $key=>$value)
|
||||
{
|
||||
$error.=$value."<br />";
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($delperms))
|
||||
{
|
||||
$ts3->serverGroupDeletePerm($sgid, $delperms);
|
||||
$debug=$ts3->getDebugLog();
|
||||
foreach($debug AS $key=>$value)
|
||||
{
|
||||
$error.=$value."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$sgrouplist=$ts3->getElement('data', $ts3->serverGroupPermList($sgid));
|
||||
|
||||
$allperms=$ts3->permissionList(true);
|
||||
|
||||
if(!empty($allperms))
|
||||
{
|
||||
if(!empty($sgrouplist))
|
||||
{
|
||||
foreach($sgrouplist AS $key => $value)
|
||||
{
|
||||
foreach($allperms AS $key2 => $value2)
|
||||
{
|
||||
if(isset($value2['permissions']))
|
||||
{
|
||||
foreach($value2['permissions'] AS $key3=>$value3)
|
||||
{
|
||||
if($value['permid']==$value3['permid'])
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['available']=1;
|
||||
$allperms[$key2]['permissions'][$key3]['permvalue']=$value['permvalue'];
|
||||
$allperms[$key2]['permissions'][$key3]['permnegated']=$value['permnegated'];
|
||||
$allperms[$key2]['permissions'][$key3]['permskip']=$value['permskip'];
|
||||
}
|
||||
elseif(!isset($allperms[$key2]['permissions'][$key3]['permvalue']))
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['available']=0;
|
||||
$allperms[$key2]['permissions'][$key3]['permvalue']=0;
|
||||
$allperms[$key2]['permissions'][$key3]['permnegated']=0;
|
||||
$allperms[$key2]['permissions'][$key3]['permskip']=0;
|
||||
}
|
||||
if($value['permid']==$value3['grantpermid'])
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['grantav']=1;
|
||||
$allperms[$key2]['permissions'][$key3]['grant']=$value['permvalue'];
|
||||
}
|
||||
elseif(!isset($allperms[$key2]['permissions'][$key3]['grant']))
|
||||
{
|
||||
$allperms[$key2]['permissions'][$key3]['grantav']=0;
|
||||
$allperms[$key2]['permissions'][$key3]['grant']=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error.="The permissions can't show complete because you don't have the permission to see the list!<br />Needed Permission: b_serverinstance_permission_list<br />";
|
||||
}
|
||||
|
||||
|
||||
if(isset($_POST['searchperms']))
|
||||
{
|
||||
$smarty->assign("searchperms", trim($_POST['searchperms']));
|
||||
}
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("showmyperms", $showmyperms);
|
||||
$smarty->assign("display", $display);
|
||||
$smarty->assign("disp_pic", $disp_pic);
|
||||
$smarty->assign("sgroupname", secure($sgroupname));
|
||||
$smarty->assign("allperms", $allperms);
|
||||
$smarty->assign("build", $get_build);
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($sid===false OR empty($sid)) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
|
||||
$error='';
|
||||
$noerror='';
|
||||
|
||||
if(isset($_POST['sendname']))
|
||||
{
|
||||
if(!empty($_POST['name']))
|
||||
{
|
||||
$sgroup_rename=$ts3->serverGroupRename($sgid, $_POST['name']);
|
||||
|
||||
if($sgroup_rename['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['groupnameeditok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($sgroup_rename['errors']); $i++)
|
||||
{
|
||||
$error .= $sgroup_rename['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error .= $lang['groupnameempty']."<br />";
|
||||
}
|
||||
}
|
||||
if(isset($_POST['delgroup']))
|
||||
{
|
||||
$sgroup_delete=$ts3->serverGroupDelete($sgid);
|
||||
if($sgroup_delete['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['groupremoveok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($sgroup_delete['errors']); $i++)
|
||||
{
|
||||
$error .= $sgroup_delete['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$servergroups=$ts3->getElement('data', $ts3->serverGroupList());
|
||||
if(!empty($servergroups))
|
||||
{
|
||||
foreach($servergroups AS $key => $value)
|
||||
{
|
||||
$servergroups[$key]=secure($servergroups[$key]);
|
||||
if ($hoststatus === false AND $value['type'] == '2' OR $hoststatus === false AND $value['type'] == '0')
|
||||
{
|
||||
unset($servergroups[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("servergroups", $servergroups);
|
||||
?>
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
error_reporting(E_ALL & ~E_NOTICE);
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="de">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Webinterface - All Icons</title>
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<?php
|
||||
$ip=$_GET['ip'];
|
||||
$port=$_GET['port'];
|
||||
$handler=opendir("../icons/");
|
||||
$handler2=opendir('../icons/'.$ip.'-'.$port.'/');
|
||||
|
||||
$count=0;
|
||||
if($handler)
|
||||
{
|
||||
while($datei=readdir($handler))
|
||||
{
|
||||
|
||||
if($datei!='.' AND $datei!='..' AND preg_match('/icon_/', $datei))
|
||||
{
|
||||
|
||||
$count++;
|
||||
$getid=str_replace("icon_", "", $datei);
|
||||
if($count==1)
|
||||
{
|
||||
echo "<tr><td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<td>";
|
||||
}
|
||||
|
||||
echo "<a href=\"#\" onclick=\"javascript:opener.document.getElementById('iconid').value = $getid;\"><img style=\"border:0\"src=\"showfile.php?name=icon_".$getid."\" alt=\"\" /></a><br />";
|
||||
|
||||
if($count==5)
|
||||
{
|
||||
$count=0;
|
||||
echo "</td></tr>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "</td>";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if($count<5 AND $count>0)
|
||||
{
|
||||
echo $count;
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
if($handler2)
|
||||
{
|
||||
while($datei=readdir($handler2))
|
||||
{
|
||||
|
||||
if($datei!='.' AND $datei!='..')
|
||||
{
|
||||
$count++;
|
||||
$getid=str_replace("icon_", "", $datei);
|
||||
if($count==1)
|
||||
{
|
||||
echo "<tr><td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<td>";
|
||||
}
|
||||
|
||||
echo "<a href=\"#\" onclick=\"javascript:opener.document.getElementById('iconid').value = $getid;\"><img style=\"border:0\"src=\"showfile.php?name=icon_".$getid."&port=".$port."\" alt=\"\" /></a><br />";
|
||||
|
||||
if($count==5)
|
||||
{
|
||||
$count=0;
|
||||
echo "</td></tr>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "</td>";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if($count<5 AND $count>0 )
|
||||
{
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
session_start();
|
||||
$ip='';
|
||||
if(isset($_SESSION['logged']) AND $_SESSION['logged']==true OR isset($_SESSION['pubviewer']) AND $_SESSION['pubviewer']==true)
|
||||
{
|
||||
if(isset($_GET['ip']))
|
||||
{
|
||||
$ip=$_GET['ip'];
|
||||
}
|
||||
elseif(isset($_SESSION['server_ip']))
|
||||
{
|
||||
$ip=$_SESSION['server_ip'];
|
||||
}
|
||||
$name=str_replace("\\","",$_REQUEST['name']);
|
||||
$name=str_replace("/","",$name);
|
||||
if(str_replace('icon_', '', $name)==100 OR str_replace('icon_', '', $name)==200 OR str_replace('icon_', '', $name)==300 OR str_replace('icon_', '', $name)==500 OR str_replace('icon_', '', $name)==600)
|
||||
{
|
||||
$path='../icons/';
|
||||
}
|
||||
else
|
||||
{
|
||||
$path='../icons/'.$ip.'-'.$_GET['port'].'/';
|
||||
}
|
||||
|
||||
$mime=getimagesize($path.$name);
|
||||
|
||||
if(strpos($mime['mime'], "image")===false)
|
||||
{
|
||||
die('error');
|
||||
}
|
||||
else
|
||||
{
|
||||
header('Content-type: '.$mime['mime']);
|
||||
|
||||
echo file_get_contents($path.$name);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "The file can not be executed alone.";
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
$newwiversion=check_wi_version($wiversion, $wiversionurl);
|
||||
if($loginstatus===true AND $newwiversion!==true)
|
||||
{
|
||||
$smarty->assign("newwiversion", $lang['wiupdateav'].$newwiversion);
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(isset($_POST['create']))
|
||||
{
|
||||
if($_POST['password']!='' AND $_POST['duration']!='')
|
||||
{
|
||||
if($ts3->getElement('success', $ts3->serverTemppasswordAdd($_POST['password'], $_POST['duration'], $_POST['tcid'], $_POST['description'])))
|
||||
{
|
||||
$noerror.=$lang['temppwcnoerr']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
$debug=$ts3->getDebugLog();
|
||||
foreach($debug AS $key=>$value)
|
||||
{
|
||||
$error.=$value."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['temppwdel']))
|
||||
{
|
||||
if($ts3->getElement('success', $ts3->serverTemppasswordDel($_POST['pw'])))
|
||||
{
|
||||
$noerror.=$lang['temppwdnoerr']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
$debug=$ts3->getDebugLog();
|
||||
foreach($debug AS $key=>$value)
|
||||
{
|
||||
$error.=$value."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$channellist=$ts3->getElement('data', $ts3->channelList());
|
||||
$temppwlist=$ts3->getElement('data', $ts3->serverTemppasswordList());
|
||||
$smarty->assign("channellist", $channellist);
|
||||
$smarty->assign("temppwlist", $temppwlist);
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
?>
|
||||
|
|
@ -1,123 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
if(!defined("SECURECHECK")) {die($lang['error_file_alone']);}
|
||||
if($sid===false OR empty($sid)) { echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php?site=server\">";} else {
|
||||
|
||||
$error='';
|
||||
$noerror='';
|
||||
$sgrouplist=$ts3->getElement('data', $ts3->serverGroupList());
|
||||
$cgrouplist=$ts3->getElement('data', $ts3->channelGroupList());
|
||||
$channellist=$ts3->getElement('data', $ts3->channelList());
|
||||
|
||||
if(isset($_POST['deltoken']))
|
||||
{
|
||||
foreach($_POST['token'] AS $key=>$value)
|
||||
{
|
||||
$token_delete=$ts3->tokenDelete($value);
|
||||
if($token_delete['success']!==false)
|
||||
{
|
||||
$noerror .= $lang['tokendeleteok']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($token_delete['errors']); $i++)
|
||||
{
|
||||
$error .= $token_delete['errors'][$i]."<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_POST['addtoken']))
|
||||
{
|
||||
if($_POST['tokentype']==0 AND $_POST['tokenid2']!=0)
|
||||
{
|
||||
$_POST['tokenid2']=0;
|
||||
}
|
||||
if($_POST['tokentype']==1 AND $_POST['tokenid2']==0)
|
||||
{
|
||||
$error .= $lang['nochannel']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
$_POST['tokentype']==0 ? $tokenid1=$_POST['tokenid1_1']:$tokenid1=$_POST['tokenid1_2'];
|
||||
$tokens='';
|
||||
for($i=1; $i<=$_POST['number']; $i++)
|
||||
{
|
||||
$token_add=$ts3->tokenAdd($_POST['tokentype'], $tokenid1, $_POST['tokenid2'], $_POST['description']);
|
||||
if($token_add['success']!==false)
|
||||
{
|
||||
$tokens .= $token_add['data']['token']."<br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
for($i=0; $i+1==count($token_add['errors']); $i++)
|
||||
{
|
||||
$error .= $token_add['errors'][$i]."<br />";
|
||||
}
|
||||
if(!empty($error))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!empty($tokens))
|
||||
{
|
||||
$noerror .= $lang['tokencreatedok'].":<br />".$tokens;
|
||||
}
|
||||
}
|
||||
}
|
||||
$tokenlist=$ts3->getElement('data', $ts3->tokenList());
|
||||
|
||||
if(!empty($tokenlist))
|
||||
{
|
||||
foreach($tokenlist AS $key=>$value)
|
||||
{
|
||||
$tokenlist[$key]=secure($tokenlist[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($channellist))
|
||||
{
|
||||
foreach($channellist AS $key=>$value)
|
||||
{
|
||||
$channellist[$key]=secure($channellist[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($cgrouplist))
|
||||
{
|
||||
foreach($cgrouplist AS $key=>$value)
|
||||
{
|
||||
$cgrouplist[$key]=secure($cgrouplist[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($sgrouplist))
|
||||
{
|
||||
foreach($sgrouplist AS $key=>$value)
|
||||
{
|
||||
$sgrouplist[$key]=secure($sgrouplist[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->assign("error", $error);
|
||||
$smarty->assign("noerror", $noerror);
|
||||
$smarty->assign("sgrouplist", $sgrouplist);
|
||||
$smarty->assign("cgrouplist", $cgrouplist);
|
||||
$smarty->assign("channellist", $channellist);
|
||||
$smarty->assign("tokenlist", $tokenlist);
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,337 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
*Copyright (C) 2012-2013 Psychokiller
|
||||
*
|
||||
*This program is free software; you can redistribute it and/or modify it under the terms of
|
||||
*the GNU General Public License as published by the Free Software Foundation; either
|
||||
*version 3 of the License, or any later version.
|
||||
*
|
||||
*This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
*without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*See the GNU General Public License for more details.
|
||||
*
|
||||
*You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
function create_tree($pid, $place, $alldata, $sid, $showicons)
|
||||
{
|
||||
global $lang;
|
||||
global $ts3;
|
||||
$gettree='';
|
||||
if(!empty($alldata['channel']))
|
||||
{
|
||||
foreach($alldata['channel'] AS $key=>$value)
|
||||
{
|
||||
if ($pid==$value['pid'])
|
||||
{
|
||||
$channelinfo = "<table class=\'border\' style=\'width:300px\'>";
|
||||
$channelinfo .= "<tr><td style=\'width:300px\' class=\'thead\' colspan=\'2\'>".str_replace("'", "\'", secure($value['channel_name']))."</td></tr>";
|
||||
$channelinfo .= "<tr><td style=\'width:150px\' class=\'green1 tooltip\'>".$lang['channelid']."</td><td style=\'width:150px\' class=\'green1\'>".$value['cid']."</td></tr>";
|
||||
$channelinfo .= "<tr><td style=\'width:150px\' class=\'green2 tooltip\'>".$lang['pid']."</td><td style=\'width:150px\' class=\'green2\'>".$value['pid']."</td></tr>";
|
||||
$channelinfo .= "<tr><td style=\'width:150px\' class=\'green1 tooltip\'>".$lang['chanorder']."</td><td style=\'width:150px\' class=\'green1\'>".$value['channel_order']."</td></tr>";
|
||||
$channelinfo .= "<tr><td style=\'width:150px\' class=\'green2 tooltip\'>".$lang['clients']."</td><td style=\'width:150px\' class=\'green2\'>".$value['total_clients']."/".($value['channel_maxclients']==-1 ? $alldata['server']['virtualserver_maxclients']:$value['channel_maxclients'])."</td></tr>";
|
||||
$channelinfo .= "<tr><td style=\'width:150px\' class=\'green1 tooltip\'>".$lang['familyclients']."</td><td style=\'width:150px\' class=\'green1\'>".$value['total_clients_family']."/".($value['channel_maxfamilyclients']==-1 ? $alldata['server']['virtualserver_maxclients']:$value['channel_maxfamilyclients'])."</td></tr>";
|
||||
$channelinfo .= "<tr><td style=\'width:150px\' class=\'green2 tooltip\'>".$lang['topic']."</td><td style=\'width:150px\' class=\'green2\'>".$value['channel_topic']."</td></tr>";
|
||||
$channelinfo .= "<tr><td style=\'width:150px\' class=\'green1 tooltip\'>".$lang['permanent']."</td><td style=\'width:150px\' class=\'green1\'>".($value['channel_flag_permanent']==1 ? $lang['yes']:$lang['no'])."</td></tr>";
|
||||
$channelinfo .= "<tr><td style=\'width:150px\' class=\'green2 tooltip\'>".$lang['semipermanent']."</td><td style=\'width:150px\' class=\'green2\'>".($value['channel_flag_semi_permanent']==1 ? $lang['yes']:$lang['no'])."</td></tr>";
|
||||
$channelinfo .= "<tr><td style=\'width:150px\' class=\'green1 tooltip\'>".$lang['default']."</td><td style=\'width:150px\' class=\'green1\'>".($value['channel_flag_default']==1 ? $lang['yes']:$lang['no'])."</td></tr>";
|
||||
$channelinfo .= "<tr><td style=\'width:150px\' class=\'green2 tooltip\'>".$lang['password']."</td><td style=\'width:150px\' class=\'green2\'>".($value['channel_flag_password']==1 ? $lang['yes']:$lang['no'])."</td></tr>";
|
||||
$channelinfo .= "<tr><td style=\'width:150px\' class=\'green1 tooltip\'>".$lang['codec']."</td><td style=\'width:150px\' class=\'green1\'>".($value['channel_codec']==0 ? $lang['codec0']:($value['channel_codec']==1 ? $lang['codec1']:($value['channel_codec']==2 ? $lang['codec2']:($value['channel_codec']==3 ? $lang['codec3']:($value['channel_codec']==4 ? $lang['codec4']:($value['channel_codec']==5 ? $lang['codec5']:''))))))."</td></tr>";
|
||||
$channelinfo .= "<tr><td style=\'width:150px\' class=\'green2 tooltip\'>".$lang['codecquality']."</td><td style=\'width:150px\' class=\'green2\'>".$value['channel_codec_quality']."</td></tr>";
|
||||
$channelinfo .= "<tr><td style=\'width:150px\' class=\'green1 tooltip\'>".$lang['neededtalkpower']."</td><td style=\'width:150px\' class=\'green1\'>".$value['channel_needed_talk_power']."</td></tr>";
|
||||
$channelinfo .= "<tr><td style=\'width:150px\' class=\'green2 tooltip\'>".$lang['iconid']."</td><td style=\'width:150px\' class=\'green2\'>".$value['channel_icon_id']."</td></tr>";
|
||||
$channelinfo .= "</table>";
|
||||
|
||||
$chan_img='';
|
||||
|
||||
if(preg_match("^\[(.*)spacer([\w\p{L}\d]+)?\]^u", $value['channel_name'], $treffer) AND $value['pid']==0 AND $value['channel_flag_permanent']==1)
|
||||
{
|
||||
$getspacer=explode($treffer[0], $value['channel_name']);
|
||||
$checkspacer=$getspacer[1][0].$getspacer[1][0].$getspacer[1][0];
|
||||
if($treffer[1]=="*" or strlen($getspacer[1])==3 AND $checkspacer==$getspacer[1])
|
||||
{
|
||||
$spacer='';
|
||||
for($i=0; $i<=50; $i++)
|
||||
{
|
||||
if(strlen($spacer)<50)
|
||||
{
|
||||
$spacer.=$getspacer[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
$gettree .= "<div class='channel'><div class='place'></div><div class='channame'>".$spacer."</div></div><div class='clear'></div>";
|
||||
}
|
||||
elseif($treffer[1]=="c")
|
||||
{
|
||||
$spacer=explode($treffer[0], $value['channel_name']);
|
||||
$gettree .= "<div class='channel'><div class='place'></div><div class='channame' style=\"width:90%;text-align:center\">".$spacer[1]."</div></div><div class='clear'></div>";
|
||||
}
|
||||
elseif($treffer[1]=="r")
|
||||
{
|
||||
$spacer=explode($treffer[0], $value['channel_name']);
|
||||
$gettree .= "<div class='channel'><div class='place'></div><div class='channame' style=\"float:right\">".$spacer[1]."</div></div><div class='clear'></div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$spacer=explode($treffer[0], $value['channel_name']);
|
||||
$gettree .= "<div class='channel'><div class='place'></div><div class='channame'>".$spacer[1]."</div></div><div class='clear'></div>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$chanmaxclient=($value['channel_maxclients']=="-1" ? $alldata['server']['virtualserver_maxclients']:$value['channel_maxclients']);
|
||||
|
||||
if($value['channel_flag_password']==1)
|
||||
{
|
||||
$chan_img="<img style=\"height:16px;width:16px\" src=\"gfx/images/password.png\" alt=\"\" />";
|
||||
}
|
||||
if($value['channel_flag_default']==1)
|
||||
{
|
||||
$chan_img.="<img style=\"height:16px;width:16px\" src=\"gfx/images/default.png\" alt=\"\" />";
|
||||
}
|
||||
if($value['channel_codec']==3 OR $value['channel_codec']==5)
|
||||
{
|
||||
$chan_img.="<img style=\"height:13px;width:16px\" src=\"gfx/images/music.png\" alt=\"\" />";
|
||||
}
|
||||
if($value['channel_needed_talk_power']>0)
|
||||
{
|
||||
$chan_img.="<img style=\"height:14px;width:14px\" src=\"gfx/images/moderated.png\" alt=\"\" />";
|
||||
}
|
||||
|
||||
if($value['channel_icon_id']!=0)
|
||||
{
|
||||
if($value['channel_icon_id']<0)
|
||||
{
|
||||
$value['channel_icon_id']=sprintf('%u', $value['channel_icon_id'] & 0xffffffff);
|
||||
}
|
||||
if($value['channel_icon_id']!=100 AND $value['channel_icon_id']!=200 AND $value['channel_icon_id']!=300 AND $value['channel_icon_id']!=500 AND $value['channel_icon_id']!=600)
|
||||
{
|
||||
if(file_exists('icons/'.$_SESSION['server_ip'].'-'.$alldata['server']['virtualserver_port'].'/icon_'.$value['channel_icon_id']))
|
||||
{
|
||||
$chan_img.="<img style=\"height:16px;width:16px\" src=\"site/showfile.php?name=icon_".$value['channel_icon_id']."&port=".$alldata['server']['virtualserver_port']."\" alt=\"\" />";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$chan_img.="<img style=\"height:16px;width:16px\" src=\"site/showfile.php?name=icon_".$value['channel_icon_id']."\" alt=\"\" />";
|
||||
}
|
||||
}
|
||||
|
||||
if($chanmaxclient<=$value['total_clients'] AND $value['channel_flag_password']==1)
|
||||
{
|
||||
$gettree .= "<div class='channel'>".$place."<div class='fullimg'></div><div class='channame' onmouseover=\"return escape('".$channelinfo."')\"><a href=\"javascript:oeffnefenster('site/filebrowser.php?sid=".$sid."&cid=".$value['cid']."&path=/');\" >".secure($value['channel_name'])."</a> </div><div style=\"float:".$showicons."\">".$chan_img."</div><div class='clear'></div></div>\n";
|
||||
}
|
||||
elseif($chanmaxclient<=$value['total_clients'])
|
||||
{
|
||||
$gettree .= "<div class='channel'>".$place."<div class='fullimg'></div><div class='channame' onmouseover=\"return escape('".$channelinfo."')\"><a href=\"javascript:oeffnefenster('site/filebrowser.php?sid=".$sid."&cid=".$value['cid']."&path=/');\" >".secure($value['channel_name'])."</a> </div><div style=\"float:".$showicons."\">".$chan_img."</div><div class='clear'></div></div>\n";
|
||||
}
|
||||
elseif($value['channel_flag_password']==1)
|
||||
{
|
||||
$gettree .= "<div class='channel'>".$place."<div class='pwchanimg'></div><div class='channame' onmouseover=\"return escape('".$channelinfo."')\"><a href=\"javascript:oeffnefenster('site/filebrowser.php?sid=".$sid."&cid=".$value['cid']."&path=/');\" >".secure($value['channel_name'])."</a> </div><div style=\"float:".$showicons."\">".$chan_img."</div><div class='clear'></div></div>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$gettree .= "<div class='channel'>".$place."<div class='chanimg'></div><div class='channame' onmouseover=\"return escape('".$channelinfo."')\"><a href=\"javascript:oeffnefenster('site/filebrowser.php?sid=".$sid."&cid=".$value['cid']."&path=/');\" >".secure($value['channel_name'])."</a> </div><div style=\"float:".$showicons."\">".$chan_img."</div><div class='clear'></div></div>\n";
|
||||
}
|
||||
}
|
||||
if($value['total_clients']>=1)
|
||||
{
|
||||
if(!empty($alldata['clients']))
|
||||
{
|
||||
foreach($alldata['clients'] AS $u_key=>$u_value)
|
||||
{
|
||||
if($value['cid'] == $u_value['cid'] AND $u_value['client_type']!="1")
|
||||
{
|
||||
|
||||
$clientinfo = "<table class=\'border\' style=\'width:300px\'>";
|
||||
$clientinfo .= "<tr><td style=\'width:300px\' class=\'thead\' colspan=\'2\'>".str_replace("'", "\'", secure($u_value['client_nickname']))."</td></tr>";
|
||||
$clientinfo .= "<tr><td style=\'width:150px\' class=\'green1 tooltip\'>".$lang['clid']."</td><td style=\'width:150px\' class=\'green1\'>".$u_value['clid']."</td></tr>";
|
||||
$clientinfo .= "<tr><td style=\'width:150px\' class=\'green2 tooltip\'>".$lang['channelid']."</td><td style=\'width:150px\' class=\'green2\'>".$u_value['cid']."</td></tr>";
|
||||
$clientinfo .= "<tr><td style=\'width:150px\' class=\'green1 tooltip\'>".$lang['cldbid']."</td><td style=\'width:150px\' class=\'green1\'>".$u_value['client_database_id']."</td></tr>";
|
||||
$clientinfo .= "<tr><td style=\'width:150px\' class=\'green2 tooltip\'>".$lang['uniqueid']."</td><td style=\'width:150px\' class=\'green2\'>".$u_value['client_unique_identifier']."</td></tr>";
|
||||
$clientinfo .= "<tr><td style=\'width:150px\' class=\'green1 tooltip\'>".$lang['away']."</td><td style=\'width:150px\' class=\'green1\'>".($u_value['client_away']==1 ? ($lang['yes']." ".$u_value['client_away_message']):$lang['no'])."</td></tr>";
|
||||
$clientinfo .= "<tr><td style=\'width:150px\' class=\'green1 tooltip\'>".$lang['version']."</td><td style=\'width:150px\' class=\'green1\'>".$u_value['client_version']."</td></tr>";
|
||||
$clientinfo .= "<tr><td style=\'width:150px\' class=\'green2 tooltip\'>".$lang['platform']."</td><td style=\'width:150px\' class=\'green2\'>".$u_value['client_platform']."</td></tr>";
|
||||
$clientinfo .= "<tr><td style=\'width:150px\' class=\'green1 tooltip\'>".$lang['talkpower']."</td><td style=\'width:150px\' class=\'green1\'>".$u_value['client_talk_power']."</td></tr>";
|
||||
$clientinfo .= "<tr><td style=\'width:150px\' class=\'green2 tooltip\'>".$lang['idle']."</td><td style=\'width:150px\' class=\'green2\'>".$ts3->convertSecondsToStrTime($u_value['client_idle_time']/1000)."</td></tr>";
|
||||
$clientinfo .= "<tr><td style=\'width:150px\' class=\'green1 tooltip\'>".$lang['lastonline']."</td><td style=\'width:150px\' class=\'green1\'>".date("d.m.Y", $u_value['client_lastconnected'])."</td></tr>";
|
||||
$clientinfo .= "<tr><td style=\'width:150px\' class=\'green2 tooltip\'>".$lang['created']."</td><td style=\'width:150px\' class=\'green2\'>".date("d.m.Y", $u_value['client_created'])."</td></tr>";
|
||||
$clientinfo .= "<tr><td style=\'width:150px\' class=\'green1 tooltip\'>".$lang['iconid']."</td><td style=\'width:150px\' class=\'green1\'>".$u_value['client_icon_id']."</td></tr>";
|
||||
$clientinfo .= "</table>";
|
||||
|
||||
$u_away_msg="";
|
||||
|
||||
if($u_value['client_away']=="1")
|
||||
{
|
||||
$u_status="away";
|
||||
if(!empty($u_value['client_away_message']))
|
||||
{
|
||||
$u_away_msg="<div class='away_msg'>(".secure($u_value['client_away_message']).")</div>";
|
||||
}
|
||||
}
|
||||
elseif($u_value['client_output_hardware']=="0")
|
||||
{
|
||||
$u_status="hwhead";
|
||||
}
|
||||
elseif($u_value['client_input_hardware']=="0")
|
||||
{
|
||||
$u_status="hwmic";
|
||||
}
|
||||
elseif($u_value['client_output_muted']=="1")
|
||||
{
|
||||
$u_status="head";
|
||||
}
|
||||
elseif($u_value['client_input_muted']=="1")
|
||||
{
|
||||
$u_status="mic";
|
||||
}
|
||||
elseif($u_value['client_flag_talking']=="0" AND $u_value['client_is_channel_commander']=="1")
|
||||
{
|
||||
$u_status="player_command";
|
||||
}
|
||||
elseif($u_value['client_flag_talking']=="1" AND $u_value['client_is_channel_commander']=="1")
|
||||
{
|
||||
$u_status="player_command_on";
|
||||
}
|
||||
elseif($u_value['client_flag_talking']=="1")
|
||||
{
|
||||
$u_status="player_on";
|
||||
}
|
||||
else
|
||||
{
|
||||
$u_status="player";
|
||||
}
|
||||
$g_img='';
|
||||
if(!empty($alldata['cgroups']))
|
||||
{
|
||||
foreach($alldata['cgroups'] AS $key=>$cg_value)
|
||||
{
|
||||
if($cg_value['cgid']==$u_value['client_channel_group_id'])
|
||||
{
|
||||
$iconid=$cg_value['iconid'];
|
||||
if($iconid<0)
|
||||
{
|
||||
$iconid=sprintf('%u', $iconid & 0xffffffff);
|
||||
}
|
||||
if($iconid!=0)
|
||||
{
|
||||
if($iconid!=100 AND $iconid!=200 AND $iconid!=300 AND $iconid!=500 AND $iconid!=600)
|
||||
{
|
||||
if(file_exists('icons/'.$_SESSION['server_ip'].'-'.$alldata['server']['virtualserver_sid'].'/icon_'.$iconid))
|
||||
{
|
||||
$g_img.="<img title=\"".$cg_value['name']."\" src=\"site/showfile.php?name=icon_".$iconid."&port=".$alldata['server']['virtualserver_port']."\" alt=\"\" />";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$g_img.="<img title=\"".$cg_value['name']."\" src=\"site/showfile.php?name=icon_".$iconid."\" alt=\"\" />";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$getsgroups=explode(',', trim($u_value['client_servergroups']));
|
||||
if(!empty($alldata['sgroups']))
|
||||
{
|
||||
foreach($alldata['sgroups'] AS $key=>$sg_value)
|
||||
{
|
||||
if(in_array($sg_value['sgid'], $getsgroups))
|
||||
{
|
||||
$iconid=$sg_value['iconid'];
|
||||
if($iconid<0)
|
||||
{
|
||||
$iconid=sprintf('%u', $iconid & 0xffffffff);
|
||||
}
|
||||
if($iconid!=0)
|
||||
{
|
||||
if($iconid!=100 AND $iconid!=200 AND $iconid!=300 AND $iconid!=500 AND $iconid!=600)
|
||||
{
|
||||
if(file_exists('icons/'.$_SESSION['server_ip'].'-'.$alldata['server']['virtualserver_port'].'/icon_'.$iconid))
|
||||
{
|
||||
$g_img.="<img title=\"".$sg_value['name']."\" src=\"site/showfile.php?name=icon_".$iconid."&port=".$alldata['server']['virtualserver_port']."\" alt=\"\" />";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$g_img.="<img title=\"".$sg_value['name']."\" src=\"site/showfile.php?name=icon_".$iconid."\" alt=\"\" />";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($u_value['client_icon_id']!=0)
|
||||
{
|
||||
if($u_value['client_icon_id']<0)
|
||||
{
|
||||
$u_value['client_icon_id']=sprintf('%u', $u_value['client_icon_id'] & 0xffffffff);
|
||||
}
|
||||
if($u_value['client_icon_id']!=100 AND $u_value['client_icon_id']!=200 AND $u_value['client_icon_id']!=300 AND $u_value['client_icon_id']!=500 AND $u_value['client_icon_id']!=600)
|
||||
{
|
||||
if(file_exists('icons/'.$_SESSION['server_ip'].'-'.$alldata['server']['virtualserver_port'].'/icon_'.$u_value['client_icon_id']))
|
||||
{
|
||||
$g_img.="<img title=\"Client Icon\" src=\"site/showfile.php?name=icon_".$u_value['client_icon_id']."&port=".$alldata['server']['virtualserver_port']."\" alt=\"\" />";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$g_img.="<img title=\"Client Icon\" src=\"site/showfile.php?name=icon_".$u_value['client_icon_id']."\" alt=\"\" />";
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($u_value['client_country']))
|
||||
{
|
||||
$g_img.="<img src=\"gfx/images/countries/".strtolower($u_value['client_country']).".png\" alt=\"\" />";
|
||||
}
|
||||
|
||||
$gettree .= "<div class='client'>".$place."<div class='place'> </div><div class='".$u_status."_img'></div><div class='clientnick'><a onmouseover=\"return escape('".$clientinfo."')\" href=\"javascript:oeffnefenster('site/interactive.php?sid=".$sid."&clid=".$u_value['clid']."&nick=".str_replace("'", "\'", secure($u_value['client_nickname']))."&action=action');\">".secure($u_value['client_nickname'])."</a> </div><div style=\"float:".$showicons."\">".$g_img."</div>".$u_away_msg."<div style='clear:both'></div></div>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$gettree .= create_tree($value['cid'], $place."<div class='place'></div>", $alldata, $sid, $showicons);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $gettree;
|
||||
}
|
||||
$tree='';
|
||||
$geticons=1;
|
||||
include("site/filetransfer.php");
|
||||
|
||||
$alldata=array();
|
||||
$alldata['server']=$ts3->getElement('data', $ts3->serverInfo());
|
||||
$alldata['channel']=$ts3->getElement('data', $ts3->channelList("-topic -flags -voice -limits -icon"));
|
||||
$alldata['clients']=$ts3->getElement('data', $ts3->clientList("-uid -away -voice -times -groups -info -icon -country"));
|
||||
$alldata['sgroups']=$ts3->getElement('data', $ts3->serverGroupList());
|
||||
$alldata['cgroups']=$ts3->getElement('data', $ts3->channelGroupList());
|
||||
|
||||
if(empty($alldata['server']) or empty($alldata['channel']) or empty($alldata['clients']))
|
||||
{
|
||||
$tree="<div>Server Offline</div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
if($alldata['server']['virtualserver_icon_id']<0)
|
||||
{
|
||||
$alldata['server']['virtualserver_icon_id']=sprintf('%u', $alldata['server']['virtualserver_icon_id'] & 0xffffffff);
|
||||
}
|
||||
|
||||
if($alldata['server']['virtualserver_icon_id']!=100 AND $alldata['server']['virtualserver_icon_id']!=200 AND $alldata['server']['virtualserver_icon_id']!=300 AND $alldata['server']['virtualserver_icon_id']!=500 AND $alldata['server']['virtualserver_icon_id']!=600)
|
||||
{
|
||||
$servericon=true;
|
||||
if(!file_exists('icons/'.$ip.'-'.$alldata['server']['virtualserver_port'].'/icon_'.$alldata['server']['virtualserver_icon_id']))
|
||||
{
|
||||
$servericon=false;
|
||||
}
|
||||
}
|
||||
|
||||
$tree.="<div class='server_img'></div><div class='servername'><a href=\"javascript:oeffnefenster('site/interactive.php?sid=".$sid."&action=action');\">".secure($alldata['server']['virtualserver_name'])."</a> </div><div style='float:".$showicons.";width:16px'>".(($alldata['server']['virtualserver_icon_id']!=0) ? "<img src='site/showfile.php?name=icon_".$alldata['server']['virtualserver_icon_id']."&port=".$alldata['server']['virtualserver_port']."' alt=\"\" />":'')."</div><div class='clear'></div>";
|
||||
$tree.=create_tree(0, "<div class='place'></div>", $alldata, $sid, $showicons);
|
||||
}
|
||||
$smarty->assign("tree", $tree);
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue