Skip to content

Commit

Permalink
Update to 1.3.14
Browse files Browse the repository at this point in the history
  • Loading branch information
lgund committed Oct 13, 2017
1 parent e1da50d commit 7f8459b
Show file tree
Hide file tree
Showing 8 changed files with 202 additions and 11 deletions.
2 changes: 1 addition & 1 deletion checkInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
*/
if(file_exists("install") && $verbindung == "done" && $users)
{
rmdir("install");
@rmdir("install");
};

if($verbindung != 'done' || !$users || !$permissions || file_exists("install") || !extension_loaded("soap"))
Expand Down
4 changes: 2 additions & 2 deletions iframeServerBanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@
/*
Get Teamspeak informations
*/
$tsAdmin = new ts3admin($ts3_server[0]['ip'], $ts3_server[0]['queryport']);
$tsAdmin = new ts3admin($ts3_server[$instanz]['ip'], $ts3_server[$instanz]['queryport']);

if($tsAdmin->getElement('success', $tsAdmin->connect()))
{
$tsAdmin->login($ts3_server[0]['user'], $ts3_server[0]['pw']);
$tsAdmin->login($ts3_server[$instanz]['user'], $ts3_server[$instanz]['pw']);
$tsAdmin->selectServer($port, "port");
$serverinfo = $tsAdmin->serverInfo();
$clients = $tsAdmin->clientList("-ip");
Expand Down
5 changes: 5 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
for help look http://first-coder.de/
*/

/*
Deactivate Errorlog (Just remove NOTICE logs)
*/
error_reporting(E_ALL & ~E_NOTICE);

/*
Includes
*/
Expand Down
185 changes: 185 additions & 0 deletions js/webinterface/bot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
/*
First-Coder Teamspeak 3 Webinterface for everyone
Copyright (C) 2017 by L.Gmann
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/>.
for help look http://first-coder.de/
*/

/*
Querybot: Save Botsettings
*/
function saveBotSettings(tablename)
{
switch(tablename)
{
case "bot_settigns_afk":
var postData = {
isAfkMoving: ($('#setAfkModul').is(':checked')) ? "1" : "0",
isMovingMicMuted: ($('#setAfkMicMuted').is(':checked')) ? "1" : "0",
isMovingHeadsetMuted: ($('#setAfkHeadsetMuted').is(':checked')) ? "1" : "0",
isMovingAway: ($('#setAfkAway').is(':checked')) ? "1" : "0",
AfkMovingChannel: $('#afkChannel').val(),
isMovingIdleTime: $('#setAfkIdleTime').val(),
isMovingIdleWarningMessage: ($('#setAfkIdleWarningMessage').is(':checked')) ? "1" : "0",
MovingIdleWarningMessage: $('#setAfkIdleMessage').val(),
afkMoveingImmunSgroups: JSON.stringify($('#setAfkImmunSgroups').tagsinput('items'))
};
break;
};

$.ajax({
type: "POST",
url: "./php/functions/functionsBotPost.php",
data: {
action: 'saveBotSettings',
botid: botid,
table: tablename,
data: JSON.stringify(postData)
},
success: function(data){
/*if(data == "done" && which == "language")
{
setNotifySuccess("Language set! Reload the page to see your site in the new language!");
}
else if(data == 'done')
{
setNotifySuccess(lang.settigns_saved);
}
else
{
setNotifyFailed("Ups, something Failed :/");
};*/
console.log(data);
}
});
};

/*
Querybot: Show Botdetails
*/
function showQueryBot(id, instanz, port)
{
$("#mainContent").fadeOut("fast", function()
{
$("#mainContent").load('./php/bot/web_bot_query_info.php', { "id" : id, "instanz" : instanz, "port" : port }, function()
{
$("#mainContent").fadeIn("fast");
});
});
};

/*
Querybot: Create Querybot
*/
function createQueryBot()
{
$.ajax({
type: "POST",
url: "./php/functions/functionsBotPost.php",
data: {
action: 'createQueryBot',
instanz: $('#selectCreateQueryBotInstance').val(),
port: $('#selectCreateQueryBotPort').val(),
name: encodeURIComponent($('#createQueryBotName').val())
},
success: function(data){
console.log(data);
}
});
};

/*
Querybot: Delete Querybot
*/
function deleteQueryBot(id)
{
$.ajax({
type: "POST",
url: "./php/functions/functionsBotPost.php",
data: {
action: 'deleteQueryBot',
id: id
},
success: function(data){
console.log(data);
}
});
};

/*
Querybot: Change Selectmenu on Querybot Create
*/
function addQueryBotChangePort()
{
var instanz = $('#selectCreateQueryBotInstance').val();

if(instanz != 'nope')
{
$.ajax({
type: "POST",
url: "./php/functions/functionsTeamspeakPost.php",
data: {
action: 'getTeamspeakPorts',
instanz: instanz
},
success: function(data){
var element = document.getElementById('selectCreateQueryBotPort');

while ( element.childNodes.length >= 1 )
{
element.removeChild(element.firstChild);
};

if(data != "[]")
{
var ports = JSON.parse(data);
for (i = 0; i < ports.length; i++)
{
port = document.createElement('option');
port.value = ports[i];
port.text = ports[i];
element.appendChild(port);
};

$('#bttnCreateQueryBot').prop("disabled", false);
}
else
{
nope = document.createElement('option');
nope.value = 'nope';
nope.text = unescape(lang.ts3_no_copy);
element.appendChild(nope);

$('#bttnCreateQueryBot').prop("disabled", true);
};
}
});
}
else
{
var element = document.getElementById('selectCreateQueryBotSid');

while ( element.childNodes.length >= 1 )
{
element.removeChild(element.firstChild);
};

nope = document.createElement('option');
nope.value = 'nope';
nope.text = unescape(lang.ts3_no_copy);
element.appendChild(nope);
};
};
2 changes: 1 addition & 1 deletion php/functions/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/*
Installed Webinterface version
*/
define("INTERFACE_VERSION", "1.3.13-OPEN-BETA");
define("INTERFACE_VERSION", "1.3.14-OPEN-BETA");

/*
Anti XSS
Expand Down
6 changes: 3 additions & 3 deletions php/functions/functionsBackupPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

$server = $tsAdmin->serverInfo();

if(((strpos($user_right['right_web_server_view'][$_POST['instanz']], $server['data']['virtualserver_port']) === false || strpos($user_right['right_web_server_backups'][$_POST['instanz']], $server['data']['virtualserver_port']) === false)
if(((!isPortPermission($user_right, $_POST['instanz'], $server['data']['virtualserver_port'], 'right_web_server_view') || !isPortPermission($user_right, $_POST['instanz'], $server['data']['virtualserver_port'], 'right_web_server_backups'))
&& $user_right['right_web_global_server']['key'] != $mysql_keys['right_web_global_server']) || $user_right['right_web']['key'] != $mysql_keys['right_web'])
{
exit();
Expand All @@ -79,15 +79,15 @@
/*
Create Backup
*/
if($_POST['action'] == 'createBackup' && $LoggedIn && (strpos($user_right['right_web_server_backups'][$_POST['instanz']], $_POST['port']) !== false || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']))
if($_POST['action'] == 'createBackup' && $LoggedIn && (isPortPermission($user_right, $_POST['instanz'], $_POST['port'], 'right_web_server_backups') || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']))
{
echo createBackup($tsAdmin, $_POST['instanz'], $_POST['port'], $_POST['kind'], $_POST['kindChannel']);
};

/*
Activate Channel Backup
*/
if($_POST['action'] == 'activateBackup' && $LoggedIn && (strpos($user_right['right_web_server_backups'][$_POST['instanz']], $_POST['port']) !== false || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']))
if($_POST['action'] == 'activateBackup' && $LoggedIn && (isPortPermission($user_right, $_POST['instanz'], $_POST['port'], 'right_web_server_backups') || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']))
{
if($_POST['subaction'] == "channelname")
{
Expand Down
7 changes: 4 additions & 3 deletions php/functions/functionsTeamspeak.php
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ function deleteFileFromFilelist($path, $cid, $port, $instanz)
$delfiles[] = $path;
$file_delete = $tsAdmin->ftDeleteFile($cid, "", $delfiles);

if($file_delete['succes'] !== false)
if($file_delete['success'] !== false)
{
writeInLog($_SESSION['user']['benutzer'], "Delete File From Server: ChannelId: ".$cid." ; Path: ".$path." ; Instanz: ".$instanz." Port: ".$port, true);

Expand Down Expand Up @@ -689,8 +689,6 @@ function addToken($type, $tokenid1, $tokenid2, $number, $description, $serverId,

if($token_add['success']!==false)
{
writeInLog($_SESSION['user']['benutzer'], "Create Token (".$token[$i]['token'].") Instanz: ".$instanz." Sid: ".$serverId, true);

$token['done'] = "true";
$token[$i] = array();
$token[$i]['token'] = $token_add['data']['token'];
Expand All @@ -705,6 +703,8 @@ function addToken($type, $tokenid1, $tokenid2, $number, $description, $serverId,
$token[$i]['type'] = $language['cgroup'];
$token[$i]['channel'] = "Channel ID: ".$tokenid2;
};

writeInLog($_SESSION['user']['benutzer'], "Create Token (".$token[$i]['token'].") Instanz: ".$instanz." Sid: ".$serverId, true);
}
else
{
Expand Down Expand Up @@ -1060,6 +1060,7 @@ function deleteIcon($id, $instanz, $serverId, $port)
function getTeamspeakIcons($tsAdmin, $port, $ip, $queryport, $username, $password)
{
$ft = $tsAdmin->ftGetFileList(0, '', '/icons');
$handler = null;

if(is_dir('../../images/ts_icons/'.$ip.'-'.$port.'/'))
{
Expand Down
2 changes: 1 addition & 1 deletion php/teamspeak/web_teamspeak_serverview.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
/*
No Client permission
*/
if((strpos($user_right['right_web_server_view'][$linkInformations['instanz']], $server['data']['virtualserver_port']) === false && $user_right['right_web_global_server']['key'] != $mysql_keys['right_web_global_server'])
if((!isPortPermission($user_right, $linkInformations['instanz'], $server['data']['virtualserver_port'], 'right_web_server_view') && $user_right['right_web_global_server']['key'] != $mysql_keys['right_web_global_server'])
|| $user_right['right_web']['key'] != $mysql_keys['right_web'])
{
reloadSite();
Expand Down

0 comments on commit 7f8459b

Please sign in to comment.