mirror of
https://github.com/easy-wi/developer.git
synced 2025-02-20 11:23:28 +08:00
#335 Add banlist for users to TS3
This commit is contained in:
parent
6ae3c194cc
commit
b8be8986a5
@ -7,6 +7,14 @@
|
||||
<backup>Backup</backup>
|
||||
<backups>Backups</backups>
|
||||
<backupname>Backupname</backupname>
|
||||
<ban>Bannen</ban>
|
||||
<banAdd>Bann hinzufügen</banAdd>
|
||||
<banErrorData>Kann Daten nicht für einen Bann verwenden</banErrorData>
|
||||
<banList>Bann Liste</banList>
|
||||
<banReason>Banngrund</banReason>
|
||||
<banTime>Banndauer</banTime>
|
||||
<banType>Bann Typ</banType>
|
||||
<blocked>Geblockt</blocked>
|
||||
<date>Datum</date>
|
||||
<defaultdns>Standard TSDNS</defaultdns>
|
||||
<defaulthostbanner_gfx_url>Standard Hostbanner GFX URL</defaulthostbanner_gfx_url>
|
||||
@ -21,6 +29,8 @@
|
||||
<description>Beschreibung</description>
|
||||
<dns>Aktueller TSDNS</dns>
|
||||
<dnsError>Server DNS nicht erlaubt</dnsError>
|
||||
<duration>Dauer</duration>
|
||||
<ends>Endet</ends>
|
||||
<enter>Eingabe</enter>
|
||||
<externalDefaultDNS>Externe default TSDNS nutzen</externalDefaultDNS>
|
||||
<filetransferport>Filetransferport</filetransferport>
|
||||
@ -73,6 +83,7 @@
|
||||
<recover>Wiederherstellen</recover>
|
||||
<reset>Reset</reset>
|
||||
<rootserver>Rootserver</rootserver>
|
||||
<seconds>Sekunden</seconds>
|
||||
<server>Server</server>
|
||||
<serverdir>Pfad zum Server</serverdir>
|
||||
<slots>Serverslots</slots>
|
||||
|
@ -7,6 +7,14 @@
|
||||
<backup>Sikkerhedskopi</backup>
|
||||
<backups>Sikkerhedskopi</backups>
|
||||
<backupname>Backupnavn</backupname>
|
||||
<ban>Ban</ban>
|
||||
<banAdd>Add ban</banAdd>
|
||||
<banList>Banlist</banList>
|
||||
<banErrorData>Cannot use this data for a ban</banErrorData>
|
||||
<banReason>Banreason</banReason>
|
||||
<banTime>Ban time</banTime>
|
||||
<banType>Bann type</banType>
|
||||
<blocked>Blocked</blocked>
|
||||
<date>Dato</date>
|
||||
<defaultdns>Standard TSDNS</defaultdns>
|
||||
<defaulthostbanner_gfx_url>Standard Hostbanner GFX URL</defaulthostbanner_gfx_url>
|
||||
@ -21,6 +29,8 @@
|
||||
<description>Beskrivelse</description>
|
||||
<dns>Server TSDNS</dns>
|
||||
<dnsError>Server TSDNS ikke tilladt</dnsError>
|
||||
<duration>Duration</duration>
|
||||
<ends>Ends</ends>
|
||||
<enter>Indtaste</enter>
|
||||
<externalDefaultDNS>Brug eksterne standard TSDNS</externalDefaultDNS>
|
||||
<filetransferport>File Transfer Port</filetransferport>
|
||||
@ -65,6 +75,7 @@
|
||||
<reset>Nulstil</reset>
|
||||
<rootserver>Rootserver</rootserver>
|
||||
<server>Server</server>
|
||||
<seconds>Seconds</seconds>
|
||||
<serverdir>Sti til server</serverdir>
|
||||
<slots>Serverslots</slots>
|
||||
<ssh_ip>SSH IP</ssh_ip>
|
||||
|
@ -7,6 +7,14 @@
|
||||
<backup>Backup</backup>
|
||||
<backups>Backups</backups>
|
||||
<backupname>Backupname</backupname>
|
||||
<banAdd>Add ban</banAdd>
|
||||
<ban>Ban</ban>
|
||||
<banList>Banlist</banList>
|
||||
<banReason>Banreason</banReason>
|
||||
<banErrorData>Cannot use this data for a ban</banErrorData>
|
||||
<banTime>Ban time</banTime>
|
||||
<banType>Bann type</banType>
|
||||
<blocked>Blocked</blocked>
|
||||
<date>Datum</date>
|
||||
<defaultdns>Default TSDNS</defaultdns>
|
||||
<defaulthostbanner_gfx_url>Default Hostbanner GFX URL</defaulthostbanner_gfx_url>
|
||||
@ -21,6 +29,8 @@
|
||||
<description>Description</description>
|
||||
<dns>Strøm TSDNS</dns>
|
||||
<dnsError>Server TSDNS not allowed</dnsError>
|
||||
<duration>Duration</duration>
|
||||
<ends>Ends</ends>
|
||||
<enter>enter</enter>
|
||||
<externalDefaultDNS>Use external default TSDNS</externalDefaultDNS>
|
||||
<filetransferport>Filetransferport</filetransferport>
|
||||
@ -73,6 +83,7 @@
|
||||
<recover>Recover</recover>
|
||||
<reset>Reset</reset>
|
||||
<rootserver>Rootserver</rootserver>
|
||||
<seconds>Seconds</seconds>
|
||||
<server>Server</server>
|
||||
<serverdir>Path to server</serverdir>
|
||||
<slots>Serverslots</slots>
|
||||
|
@ -47,13 +47,18 @@ include(EASYWIDIR . '/stuff/keyphrasefile.php');
|
||||
if (!isset($user_id) and !isset($admin_id)) {
|
||||
header('Location: login.php');
|
||||
die('Please allow redirection');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($resellerLockupID)) {
|
||||
$reseller_id = $resellerLockupID;
|
||||
}
|
||||
|
||||
if ($ui->id('id', 10, 'get')) {
|
||||
|
||||
if (isset($admin_id)) {
|
||||
|
||||
$query = $sql->prepare("SELECT u.`id`,u.`cname` FROM `gsswitch` g LEFT JOIN `userdata` u ON g.`userid`=u.`id` WHERE g.`id`=? AND g.`resellerid`=? LIMIT 1");
|
||||
$query->execute(array($ui->id('id', 10, 'get'), $resellerLockupID));
|
||||
$query->execute(array($ui->id('id', 10, 'get'), $reseller_id));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
$username = $row['cname'];
|
||||
$user_id = $row['id'];
|
||||
@ -64,7 +69,7 @@ if ($ui->id('id', 10, 'get')) {
|
||||
}
|
||||
|
||||
$query = $sql->prepare("SELECT g.`id`,g.`newlayout`,g.`rootID`,g.`serverip`,g.`port`,g.`protected`,AES_DECRYPT(g.`ftppassword`,?) AS `dftppass`,AES_DECRYPT(g.`ppassword`,?) AS `decryptedftppass`,s.`servertemplate`,t.`binarydir`,t.`shorten` FROM `gsswitch` g LEFT JOIN `serverlist` s ON g.`serverid`=s.`id` LEFT JOIN `servertypes` t ON s.`servertype`=t.`id` WHERE g.`id`=? AND g.`userid`=? AND g.`resellerid`=? LIMIT 1");
|
||||
$query->execute(array($aeskey, $aeskey, $ui->id('id', 10, 'get'), $user_id, $resellerLockupID));
|
||||
$query->execute(array($aeskey, $aeskey, $ui->id('id', 10, 'get'), $user_id, $reseller_id));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
$protected = $row['protected'];
|
||||
$servertemplate = $row['servertemplate'];
|
||||
@ -94,7 +99,7 @@ if ($ui->id('id', 10, 'get')) {
|
||||
if (isset($rootID)) {
|
||||
|
||||
$query = $sql->prepare("SELECT `ip`,`ftpport` FROM `rserverdata` WHERE `id`=? AND `resellerid`=? LIMIT 1");
|
||||
$query->execute(array($rootID, $resellerLockupID));
|
||||
$query->execute(array($rootID, $reseller_id));
|
||||
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
|
||||
|
||||
$ftpport = $row['ftpport'];
|
||||
@ -115,7 +120,7 @@ if ($ui->id('id', 10, 'get')) {
|
||||
|
||||
}
|
||||
|
||||
if (isset($ftpConnect)) {
|
||||
if (isset($ip)) {
|
||||
|
||||
echo (isset($error)) ? $error : '<html><head><title>' . $ewCfg['title'] . ' ' . $serverip .':' . $port . '</title><meta http-equiv="refresh" content="3"></head><body>' . nl2br($ftpConnect->getTempFileContent()) . '</body></html>';
|
||||
|
||||
@ -123,11 +128,11 @@ if ($ui->id('id', 10, 'get')) {
|
||||
$ftpConnect = null;
|
||||
|
||||
} else {
|
||||
echo 'Error: ID';
|
||||
echo 'Error: wrong rootID';
|
||||
}
|
||||
|
||||
} else {
|
||||
echo 'Error: ID';
|
||||
echo 'Error: No rootID';
|
||||
}
|
||||
}
|
||||
$sql = null;
|
@ -814,6 +814,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
|
||||
}
|
||||
|
||||
$newtraffic = 0;
|
||||
$addedtraffic = 0;
|
||||
|
||||
if ($newtrafficdata > $lastfiletraffic) {
|
||||
$addedtraffic = $newtrafficdata - $lastfiletraffic;
|
||||
@ -822,7 +823,7 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
|
||||
$newtraffic = $filetraffic;
|
||||
} else if ($newtrafficdata < $lastfiletraffic) {
|
||||
$addedtraffic = $newtrafficdata;
|
||||
$newtraffic = $filetraffic+$addedtraffic;
|
||||
$newtraffic = $filetraffic + $addedtraffic;
|
||||
}
|
||||
|
||||
$newtrafficmb = round($newtraffic / 1024);
|
||||
@ -1022,8 +1023,8 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
|
||||
$connection->StopServer($virtualserver_id);
|
||||
}
|
||||
}
|
||||
$query = $sql->prepare("INSERT INTO `voice_server_stats` (`sid`,`mid`,`installed`,`used`,`date`,`uid`,`resellerid`) VALUES (?,?,?,?,?,?,?) ON DUPLICATE KEY UPDATE `used`=(`used`*(`count`/(`count`+1))+(VALUES(`used`)*(1/(`count`+1)))),`installed`=(`installed`*(`count`/(`count`+1))+(VALUES(`installed`)*(1/(`count`+1)))),`count`=`count`+1");
|
||||
$query->execute(array($ts3id, $ts3masterid, $server['virtualserver_maxclients'], $usedslots, $dayAndZeroHour, $userid, $resellerid));
|
||||
$query = $sql->prepare("INSERT INTO `voice_server_stats` (`sid`,`mid`,`installed`,`used`,`traffic`,`date`,`uid`,`resellerid`) VALUES (?,?,?,?,?,?,?,?) ON DUPLICATE KEY UPDATE `traffic`=`traffic`+VALUES(`traffic`),`used`=(`used`*(`count`/(`count`+1))+(VALUES(`used`)*(1/(`count`+1)))),`installed`=(`installed`*(`count`/(`count`+1))+(VALUES(`installed`)*(1/(`count`+1)))),`count`=`count`+1");
|
||||
$query->execute(array($ts3id, $ts3masterid, $server['virtualserver_maxclients'], $usedslots, $addedtraffic, $dayAndZeroHour, $userid, $resellerid));
|
||||
} else if (isset($ts3id)) {
|
||||
$uptime = 1;
|
||||
$usedslots = 0;
|
||||
|
@ -43,7 +43,7 @@ class TS3 {
|
||||
|
||||
public $errorcode = false, $socketConnected = false;
|
||||
|
||||
private function ReplaceToTS3 ($value) {
|
||||
public function ReplaceToTS3 ($value) {
|
||||
$return = str_replace(array('\\', '/', ' ', '|'), array('\\\\', '\/', '\s', '\p'), $value);
|
||||
return $return;
|
||||
}
|
||||
@ -930,7 +930,7 @@ class TS3 {
|
||||
}
|
||||
}
|
||||
|
||||
$return=json_encode($channels);
|
||||
$return = json_encode($channels);
|
||||
|
||||
} else {
|
||||
$return = $useserver;
|
||||
@ -939,4 +939,94 @@ class TS3 {
|
||||
return $return;
|
||||
|
||||
}
|
||||
|
||||
public function getClientList ($virtualserver_id) {
|
||||
|
||||
$useserver = $this->UseServer($virtualserver_id);
|
||||
|
||||
if (isset($useserver[0]['msg']) and strtolower($useserver[0]['msg']) == 'ok') {
|
||||
|
||||
$returnRaw = $this->SendCommand('clientlist client_type=0');
|
||||
|
||||
if (is_array($returnRaw)) {
|
||||
|
||||
$return = array();
|
||||
|
||||
foreach ($returnRaw as $row) {
|
||||
if ($row['client_type'] == 0) {
|
||||
$return[] = array('cid' => $row['cid'], 'clid' => $row['clid'], 'client_nickname' => $row['client_nickname']);
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
public function banList ($virtualserver_id) {
|
||||
|
||||
$useserver = $this->UseServer($virtualserver_id);
|
||||
|
||||
if (isset($useserver[0]['msg']) and strtolower($useserver[0]['msg']) == 'ok') {
|
||||
|
||||
$rawReturn = $this->SendCommand('banlist');
|
||||
|
||||
if (is_array($rawReturn)) {
|
||||
|
||||
$return = array();
|
||||
|
||||
foreach ($rawReturn as $r) {
|
||||
if (isset($r['banid'])) {
|
||||
$return[$r['banid']] = array('ip' => $r['ip'], 'name' => $r['name'], 'lastnickname' => $r['lastnickname'], 'blocked' => $r['enforcements'], 'duration' => $r['duration'], 'ends' => date('Y-m-d H:m:s', ($r['created'] + $r['duration'])));
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return array();
|
||||
|
||||
}
|
||||
|
||||
public function banAdd ($virtualserver_id, $cmd) {
|
||||
|
||||
$useserver = $this->UseServer($virtualserver_id);
|
||||
|
||||
if (isset($useserver[0]['msg']) and strtolower($useserver[0]['msg']) == 'ok') {
|
||||
return $this->SendCommand($cmd);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public function banDel ($virtualserver_id, $bandID) {
|
||||
|
||||
$useserver = $this->UseServer($virtualserver_id);
|
||||
|
||||
if (isset($useserver[0]['msg']) and strtolower($useserver[0]['msg']) == 'ok') {
|
||||
return $this->SendCommand('bandel banid=' . $bandID);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public function clientKick ($virtualserver_id, $userID) {
|
||||
|
||||
$useserver = $this->UseServer($virtualserver_id);
|
||||
|
||||
if (isset($useserver[0]['msg']) and strtolower($useserver[0]['msg']) == 'ok') {
|
||||
return $this->SendCommand('clientkick clid=' . $userID . ' reasonid=5');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
@ -1482,6 +1482,7 @@ $query = "CREATE TABLE IF NOT EXISTS `voice_server_stats` (
|
||||
`mid` int(10) unsigned NOT NULL,
|
||||
`installed` decimal(6,2) unsigned NOT NULL,
|
||||
`used` decimal(6,2) unsigned NOT NULL,
|
||||
`traffic` bigint(19) unsigned NOT NULL,
|
||||
`date` datetime DEFAULT NULL,
|
||||
`uid` int(10) unsigned DEFAULT NULL,
|
||||
`count` bigint(19) unsigned DEFAULT 0,
|
||||
@ -1496,6 +1497,7 @@ $query = "CREATE TABLE IF NOT EXISTS `voice_server_stats_hours` (
|
||||
`mid` int(10) unsigned NOT NULL,
|
||||
`installed` decimal(6,2) unsigned NOT NULL,
|
||||
`used` decimal(6,2) unsigned NOT NULL,
|
||||
`traffic` bigint(19) unsigned NOT NULL,
|
||||
`date` datetime DEFAULT NULL,
|
||||
`uid` int(10) unsigned DEFAULT NULL,
|
||||
`count` bigint(19) unsigned DEFAULT 0,
|
||||
|
@ -1224,6 +1224,7 @@ $defined['voice_server_stats'] = array('sid' => array("Type"=>"int(10) unsigned"
|
||||
'mid' => array("Type"=>"int(10) unsigned","Null"=>"NO","Key"=>"MUL","Default"=>"","Extra"=>""),
|
||||
'installed' => array("Type"=>"decimal(6,2) unsigned","Null"=>"NO","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'used' => array("Type"=>"decimal(6,2) unsigned","Null"=>"NO","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'traffic' => array("Type"=>"bigint(19) unsigned","Null"=>"NO","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'uid' => array("Type"=>"int(10) unsigned","Null"=>"YES","Key"=>"MUL","Default"=>"","Extra"=>""),
|
||||
'count' => array("Type"=>"bigint(19) unsigned","Null"=>"YES","Key"=>"","Default"=>"1","Extra"=>""),
|
||||
'resellerid' => array("Type"=>"int(10) unsigned","Null"=>"YES","Key"=>"MUL","Default"=>"0","Extra"=>"")
|
||||
@ -1234,6 +1235,7 @@ $defined['voice_server_stats_hours'] = array('sid' => array("Type"=>"int(10) uns
|
||||
'mid' => array("Type"=>"int(10) unsigned","Null"=>"NO","Key"=>"MUL","Default"=>"","Extra"=>""),
|
||||
'installed' => array("Type"=>"decimal(6,2) unsigned","Null"=>"NO","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'used' => array("Type"=>"decimal(6,2) unsigned","Null"=>"NO","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'traffic' => array("Type"=>"bigint(19) unsigned","Null"=>"NO","Key"=>"","Default"=>"","Extra"=>""),
|
||||
'uid' => array("Type"=>"int(10) unsigned","Null"=>"YES","Key"=>"MUL","Default"=>"","Extra"=>""),
|
||||
'count' => array("Type"=>"bigint(19) unsigned","Null"=>"YES","Key"=>"","Default"=>"1","Extra"=>""),
|
||||
'resellerid' => array("Type"=>"int(10) unsigned","Null"=>"YES","Key"=>"MUL","Default"=>"0","Extra"=>"")
|
||||
|
@ -45,7 +45,11 @@ include(EASYWIDIR . '/stuff/functions_gs.php');
|
||||
include(EASYWIDIR . '/stuff/functions_ssh_exec.php');
|
||||
include(EASYWIDIR . '/stuff/keyphrasefile.php');
|
||||
|
||||
$sprache = getlanguagefile('gserver',$user_language,$reseller_id);
|
||||
if (isset($resellerLockupID)) {
|
||||
$reseller_id = $resellerLockupID;
|
||||
}
|
||||
|
||||
$sprache = getlanguagefile('gserver', $user_language, $reseller_id);
|
||||
$loguserid = $user_id;
|
||||
$logusername = getusername($user_id);
|
||||
$logusertype = 'user';
|
||||
@ -59,10 +63,6 @@ if (isset($admin_id)) {
|
||||
$logsubuser = 0;
|
||||
}
|
||||
|
||||
if (isset($resellerLockupID)) {
|
||||
$reseller_id = $resellerLockupID;
|
||||
}
|
||||
|
||||
if ($ui->w('action', 4, 'post') and !token(true)) {
|
||||
$template_file = $spracheResponse->token;
|
||||
|
||||
|
@ -37,8 +37,8 @@
|
||||
*/
|
||||
|
||||
if ((!isset($user_id) or $main != 1) or (isset($user_id) and !$pa['voiceserver'])) {
|
||||
header('Location: userpanel.php');
|
||||
die('No acces');
|
||||
header('Location: userpanel.php');
|
||||
die('No acces');
|
||||
}
|
||||
|
||||
include(EASYWIDIR . '/stuff/keyphrasefile.php');
|
||||
@ -53,11 +53,11 @@ $logusertype = 'user';
|
||||
$logreseller = 0;
|
||||
|
||||
if (isset($admin_id)) {
|
||||
$logsubuser = $admin_id;
|
||||
$logsubuser = $admin_id;
|
||||
} else if (isset($subuser_id)) {
|
||||
$logsubuser = $subuser_id;
|
||||
$logsubuser = $subuser_id;
|
||||
} else {
|
||||
$logsubuser = 0;
|
||||
$logsubuser = 0;
|
||||
}
|
||||
|
||||
if ($ui->st('d', 'get') == 'bu' and $ui->id('id', 10, 'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'), $substituteAccess['vo']))) {
|
||||
@ -98,6 +98,7 @@ if ($ui->st('d', 'get') == 'bu' and $ui->id('id', 10, 'get') and (!isset($_SESSI
|
||||
$queryip = $query->fetchColumn();
|
||||
}
|
||||
}
|
||||
|
||||
$query = $sql->prepare("SELECT `voice_maxbackup` FROM `settings` WHERE `resellerid`=? LIMIT 1");
|
||||
$query->execute(array($reseller_id));
|
||||
$voice_maxbackup = $query->fetchColumn();
|
||||
@ -128,14 +129,14 @@ if ($ui->st('d', 'get') == 'bu' and $ui->id('id', 10, 'get') and (!isset($_SESSI
|
||||
$toomuch = $backupcount + 1 - $voice_maxbackup;
|
||||
|
||||
if ($toomuch > 0) {
|
||||
$query = $sql->prepare("SELECT `id` FROM `voice_server_backup` WHERE `sid`=? AND `uid`=? AND `resellerid`=? ORDER BY `id` ASC LIMIT $toomuch");
|
||||
$query = $sql->prepare("SELECT `id` FROM `voice_server_backup` WHERE `sid`=? AND `uid`=? AND `resellerid`=? ORDER BY `id` ASC LIMIT " . $toomuch);
|
||||
$query->execute(array($id, $user_id, $reseller_id));
|
||||
foreach ($query->fetchall(PDO::FETCH_ASSOC) as $row) {
|
||||
|
||||
$delete = $sql->prepare("DELETE FROM `voice_server_backup` WHERE `id`=? AND `uid`=? AND `resellerid`=? LIMIT 1");
|
||||
$delete->execute(array($row['id'], $user_id, $reseller_id));
|
||||
|
||||
tsbackup('delete', $ssh2user, $serverdir, $masterserver, $volocalserverid, $row['id']);
|
||||
tsbackup('delete', $ssh2user, $serverdir, $masterserver, $volocalserverid, $row['id']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -162,7 +163,7 @@ if ($ui->st('d', 'get') == 'bu' and $ui->id('id', 10, 'get') and (!isset($_SESSI
|
||||
$query = $sql->prepare("INSERT INTO `voice_server_backup` (`sid`,`uid`,`name`,`snapshot`,`channels`,`date`,`resellerid`) VALUES(?,?,?,?,?,NOW(),?)");
|
||||
$query->execute(array($id, $user_id, $name, $snapshot, $channelSnapshot, $reseller_id));
|
||||
|
||||
$return = tsbackup('create', $ssh2user, $serverdir, $masterserver, $volocalserverid, $sql->lastInsertId());
|
||||
$return = tsbackup('create', $ssh2user, $serverdir, $masterserver, $volocalserverid, $sql->lastInsertId());
|
||||
|
||||
if ($return == 'ok') {
|
||||
|
||||
@ -195,7 +196,7 @@ if ($ui->st('d', 'get') == 'bu' and $ui->id('id', 10, 'get') and (!isset($_SESSI
|
||||
$query = $sql->prepare("DELETE FROM `voice_server_backup` WHERE `id`=? AND `uid`=? AND `resellerid`=? LIMIT 1");
|
||||
$query->execute(array($ui->id('id',10, 'post'), $user_id, $reseller_id));
|
||||
|
||||
tsbackup('delete', $ssh2user, $serverdir, $masterserver, $volocalserverid, $ui->id('id',10, 'post'));
|
||||
tsbackup('delete', $ssh2user, $serverdir, $masterserver, $volocalserverid, $ui->id('id',10, 'post'));
|
||||
|
||||
$query = $sql->prepare("SELECT CONCAT(`ip`,':',`port`) AS `address` FROM `voice_server` WHERE `id`=? AND `userid`=? AND `resellerid`=? LIMIT 1");
|
||||
$query->execute(array($sid, $user_id, $reseller_id));
|
||||
@ -763,6 +764,116 @@ if ($ui->st('d', 'get') == 'bu' and $ui->id('id', 10, 'get') and (!isset($_SESSI
|
||||
$template_file = 'userpanel_404.tpl';
|
||||
}
|
||||
|
||||
} else if ($ui->st('d', 'get') == 'bl' and $ui->id('id', 10, 'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'), $substituteAccess['vo']))) {
|
||||
|
||||
$id = $ui->id('id', 10, 'get');
|
||||
|
||||
$query = $sql->prepare("SELECT v.`id`,v.`ip`,v.`port`,v.`dns`,v.`localserverid`,v.`masterserver`,m.`type`,m.`queryport`,AES_DECRYPT(m.`querypassword`,:aeskey) AS `decryptedquerypassword`,m.`rootid`,m.`addedby`,m.`ssh2ip`,m.`type`,m.`usedns`,m.`publickey`,m.`ssh2ip`,AES_DECRYPT(m.`ssh2port`,:aeskey) AS `decryptedssh2port`,AES_DECRYPT(m.`ssh2user`,:aeskey) AS `decryptedssh2user`,AES_DECRYPT(m.`ssh2password`,:aeskey) AS `decryptedssh2password`,m.`serverdir`,m.`keyname`,m.`notified` FROM `voice_server` v LEFT JOIN `voice_masterserver` m ON v.`masterserver`=m.`id` WHERE v.`active`='Y' AND m.`active`='Y' AND v.`backup`='Y' AND v.`id`=:server_id AND v.`userid`=:user_id AND v.`resellerid`=:reseller_id LIMIT 1");
|
||||
$query->execute(array(':aeskey' => $aeskey,':server_id' => $id,':user_id' => $user_id,':reseller_id' => $reseller_id));
|
||||
foreach ($query->fetchall(PDO::FETCH_ASSOC) as $row) {
|
||||
|
||||
if ($row['type'] == 'ts3') {
|
||||
$type = $sprache->ts3;
|
||||
$server=($row['usedns'] == 'N' or $row['dns']==null or $row['dns'] == '') ? $row['ip'] . ':' . $row['port'] : $row['dns'] . ' (' . $row['ip'] . ':' . $row['port'] . ')';
|
||||
}
|
||||
|
||||
$dns = $row['dns'];
|
||||
$serverdir = $row['serverdir'];
|
||||
$addedby = $row['addedby'];
|
||||
$queryport = $row['queryport'];
|
||||
$querypassword = $row['decryptedquerypassword'];
|
||||
$volocalserverid = $row['localserverid'];
|
||||
$notified = $row['notified'];
|
||||
$masterserver = $row['masterserver'];
|
||||
|
||||
if ($addedby==2) {
|
||||
|
||||
$queryip = $row['ssh2ip'];
|
||||
$publickey = $row['publickey'];
|
||||
$queryip = $row['ssh2ip'];
|
||||
$ssh2port = $row['decryptedssh2port'];
|
||||
$ssh2user = $row['decryptedssh2user'];
|
||||
$ssh2password = $row['decryptedssh2password'];
|
||||
$keyname = $row['keyname'];
|
||||
|
||||
} else if ($addedby == 1) {
|
||||
$query = $sql->prepare("SELECT `ip` FROM `rserverdata` WHERE `id`=? AND `resellerid`=? LIMIT 1");
|
||||
$query->execute(array($row['rootid'], $reseller_id));
|
||||
$queryip = $query->fetchColumn();
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($queryip, $volocalserverid)) {
|
||||
|
||||
$connection = new TS3($queryip, $queryport,'serveradmin', $querypassword);
|
||||
$errorcode = $connection->errorcode;
|
||||
|
||||
if (strpos($errorcode,'error id=0') === false) {
|
||||
$template_file = $spracheResponse->error_ts_query_connect . $errorcode;
|
||||
|
||||
} else {
|
||||
|
||||
if ($ui->st('action', 'post') == 'dl') {
|
||||
|
||||
$template_file = $connection->banDel($volocalserverid, $ui->id('bannID', 19, 'post'));
|
||||
|
||||
} else if ($ui->st('action', 'post') == 'ad') {
|
||||
|
||||
if ($ui->w('banType', 1 , 'post') == 'I' and $ui->ip4('ip', 'post')) {
|
||||
|
||||
$banCmd = 'banadd ip=' . $ui->ip4('ip', 'post');
|
||||
|
||||
} else if ($ui->w('banType', 1 , 'post') == 'N' and strlen($ui->escaped('name', 'post')) > 0) {
|
||||
|
||||
$banCmd = 'banadd name=' . $connection->ReplaceToTS3($ui->escaped('name', 'post'));
|
||||
|
||||
} else if ($ui->w('banType', 1 , 'post') == 'U' and $ui->id('clientUID', 19, 'post')) {
|
||||
|
||||
$banCmd = 'banclient clid=' . $ui->id('clientUID', 19, 'post');
|
||||
|
||||
}
|
||||
|
||||
if (isset($banCmd)) {
|
||||
|
||||
if ($ui->id('time', 19, 'post') > 0) {
|
||||
$banCmd .= ' time=' . $ui->id('time', 19, 'post');
|
||||
}
|
||||
|
||||
if (strlen($ui->escaped('name', 'post')) > 0) {
|
||||
|
||||
$banCmd .= ' banreason=' . $connection->ReplaceToTS3($ui->escaped('banReason', 'post'));
|
||||
}
|
||||
|
||||
$connection->banAdd($volocalserverid, $banCmd);
|
||||
|
||||
if ($ui->w('banType', 1 , 'post') == 'U') {
|
||||
$return = $connection->clientKick($volocalserverid, $ui->id('clientUID', 19, 'post'));
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$error = $sprache->banErrorData;
|
||||
$template_file = 'userpanel_voiceserver_ban_ad.tpl';
|
||||
}
|
||||
|
||||
} else if (!$ui->st('action', 'post') and $ui->st('e', 'get') == 'ad') {
|
||||
|
||||
$userList = $connection->getClientList($volocalserverid);
|
||||
|
||||
$template_file = 'userpanel_voiceserver_ban_ad.tpl';
|
||||
|
||||
} else {
|
||||
|
||||
$banList = $connection->banList($volocalserverid);
|
||||
|
||||
$template_file = 'userpanel_voiceserver_ban_list.tpl';
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$template_file = 'userpanel_404.tpl';
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$table = array();
|
||||
|
69
web/template/default/userpanel_voiceserver_ban_ad.tpl
Normal file
69
web/template/default/userpanel_voiceserver_ban_ad.tpl
Normal file
@ -0,0 +1,69 @@
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="userpanel.php">Home</a> <span class="divider">/</span></li>
|
||||
<li><a href="userpanel.php?w=vo"><?php echo $gsprache->voiceserver;?></a> <span class="divider">/</span></li>
|
||||
<li><?php echo $sprache->banAdd;?> <span class="divider">/</span></li>
|
||||
<li class="active"><?php echo $server;?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="span8">
|
||||
<form class="form-horizontal" action="userpanel.php?w=vo&d=bl&e=ad&id=<?php echo $id;?>&r=vo" onsubmit="return confirm('<?php echo $gsprache->sure;?>');" method="post">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputBanType"><?php echo $sprache->banType;?></label>
|
||||
<div class="controls">
|
||||
<select id="inputBanType" name="banType" onchange="SwitchShowHideRows(this.value)">
|
||||
<option value="U">clientUID</option>
|
||||
<option value="I"><?php echo $sprache->ip;?></option>
|
||||
<option value="N"><?php echo $sprache->user;?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="U switch control-group">
|
||||
<label class="control-label" for="inputUser">clientUID</label>
|
||||
<div class="controls">
|
||||
<select id="inputUser" name="clientUID">
|
||||
<?php foreach($userList as $r) echo '<option value="'.$r['clid'].'">'.$r['client_nickname'].' ('.$r['clid'].')</option>';?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="I switch control-group display_none">
|
||||
<label class="control-label" for="inputIP"><?php echo $sprache->ip;?></label>
|
||||
<div class="controls">
|
||||
<input id="inputIP" type="text" name="ip">
|
||||
</div>
|
||||
</div>
|
||||
<div class="N switch control-group display_none">
|
||||
<label class="control-label" for="inputIP"><?php echo $sprache->user;?></label>
|
||||
<div class="controls">
|
||||
<input id="inputIP" type="text" name="name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputTime"><?php echo $sprache->banTime;?></label>
|
||||
<div class="controls">
|
||||
<div class="input-append">
|
||||
<input id="inputTime" type="number" name="time" value="3600">
|
||||
<span class="add-on"><?php echo $sprache->seconds;?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputBanReason"><?php echo $sprache->banReason;?></label>
|
||||
<div class="controls">
|
||||
<input id="inputBanReason" type="text" name="banReason" value="Web ban">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputEdit"></label>
|
||||
<div class="controls">
|
||||
<button class="btn btn-primary" id="inputEdit" type="submit"><i class="icon-white icon-plus-sign"></i> <?php echo $sprache->ban;?></button>
|
||||
<input type="hidden" name="action" value="ad">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
49
web/template/default/userpanel_voiceserver_ban_list.tpl
Normal file
49
web/template/default/userpanel_voiceserver_ban_list.tpl
Normal file
@ -0,0 +1,49 @@
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="userpanel.php">Home</a> <span class="divider">/</span></li>
|
||||
<li><a href="userpanel.php?w=vo"><?php echo $gsprache->voiceserver;?></a> <span class="divider">/</span></li>
|
||||
<li><?php echo $sprache->banList;?> <span class="divider">/</span></li>
|
||||
<li class="active"><?php echo $server;?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row-fluid">
|
||||
<a href="userpanel.php?w=vo&d=bl&e=ad&id=<?php echo $id;?>"><span class="btn btn-primary btn-mini"><i class="icon-white icon-plus-sign"></i> <?php echo $sprache->banAdd;?></span></a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row-fluid">
|
||||
<div class="span11">
|
||||
<table class="table table-bordered table-condensed table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $sprache->user;?></th>
|
||||
<th><?php echo $sprache->ip;?></th>
|
||||
<th><?php echo $sprache->duration.' '.$sprache->seconds;?></th>
|
||||
<th><?php echo $sprache->ends;?></th>
|
||||
<th><?php echo $sprache->blocked;?></th>
|
||||
<th class="span1"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($banList as $k => $row) { ?>
|
||||
<tr>
|
||||
<td><?php echo $row['lastnickname'];?></td>
|
||||
<td><?php echo $row['ip'];?></td>
|
||||
<td><?php echo $row['duration'];?></td>
|
||||
<td><?php echo $row['ends'];?></td>
|
||||
<td><?php echo $row['blocked'];?></td>
|
||||
<td class="span1">
|
||||
<form method="post" action="userpanel.php?w=vo&d=bl&id=<?php echo $id;?>&r=vo" name="form" onsubmit="return confirm('<?php echo $gsprache->sure;?>');">
|
||||
<button class="btn btn-danger btn-mini" id="inputEdit" type="submit"><i class="fa fa-trash-o"></i> <?php echo $gsprache->del;?></button>
|
||||
<input type="hidden" name="action" value="dl">
|
||||
<input type="hidden" name="bannID" value="<?php echo $k;?>">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
@ -18,6 +18,7 @@
|
||||
<a href="userpanel.php?w=vo&d=st&id=<?php echo $table_row['id'];?>&action=re&r=vo" onclick="return confirm('<?php echo $table_row['address'];?>: <?php echo $sprache->confirm_restart;?>');"><button class="btn btn-mini btn-success"><i class="icon-white icon-play"></i> <?php echo $gsprache->start;?></button></a>
|
||||
<a href="userpanel.php?w=vo&d=st&id=<?php echo $table_row['id'];?>&action=so&r=vo" onclick="return confirm('<?php echo $table_row['address'];?>: <?php echo $sprache->confirm_stop;?>');"><button class="btn btn-mini btn-danger"><i class="fa fa-power-off"></i> <?php echo $gsprache->stop;?></button></a>
|
||||
<a href="userpanel.php?w=vo&d=pk&id=<?php echo $table_row['id'];?>"><span class="btn btn-mini btn-primary"><i class="fa fa-key"></i> Token</span></a>
|
||||
<a href="userpanel.php?w=vo&d=bl&id=<?php echo $table_row['id'];?>"><span class="btn btn-mini btn-primary"><i class="fa fa-ban"></i> <?php echo $sprache->banList;?></span></a>
|
||||
<?php if($table_row['backup']=='Y'){ ?><a href="userpanel.php?w=vo&d=bu&id=<?php echo $table_row['id'];?>"><span class="btn btn-mini btn-primary"><i class="fa fa-floppy-o"></i> <?php echo $sprache->backup;?></span></a><?php } ?>
|
||||
<a href="userpanel.php?w=vo&d=md&id=<?php echo $table_row['id'];?>"><span class="btn btn-mini btn-primary"><i class="fa fa-cog"></i> <?php echo $gsprache->settings;?></span></a>
|
||||
<a href="userpanel.php?w=vo&d=rs&id=<?php echo $table_row['id'];?>&action=rs&r=vo" onclick="return confirm('<?php echo $table_row['address'];?>: <?php echo $sprache->confirm_restart;?>');"><button class="btn btn-mini btn-warning"><i class="fa fa-refresh"></i> <?php echo $sprache->reset;?></button></a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user