Skip to content

Commit 7f8459b

Browse files
committed
Update to 1.3.14
1 parent e1da50d commit 7f8459b

File tree

8 files changed

+202
-11
lines changed

8 files changed

+202
-11
lines changed

checkInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
*/
8080
if(file_exists("install") && $verbindung == "done" && $users)
8181
{
82-
rmdir("install");
82+
@rmdir("install");
8383
};
8484

8585
if($verbindung != 'done' || !$users || !$permissions || file_exists("install") || !extension_loaded("soap"))

iframeServerBanner.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@
9191
/*
9292
Get Teamspeak informations
9393
*/
94-
$tsAdmin = new ts3admin($ts3_server[0]['ip'], $ts3_server[0]['queryport']);
94+
$tsAdmin = new ts3admin($ts3_server[$instanz]['ip'], $ts3_server[$instanz]['queryport']);
9595

9696
if($tsAdmin->getElement('success', $tsAdmin->connect()))
9797
{
98-
$tsAdmin->login($ts3_server[0]['user'], $ts3_server[0]['pw']);
98+
$tsAdmin->login($ts3_server[$instanz]['user'], $ts3_server[$instanz]['pw']);
9999
$tsAdmin->selectServer($port, "port");
100100
$serverinfo = $tsAdmin->serverInfo();
101101
$clients = $tsAdmin->clientList("-ip");

index.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
for help look http://first-coder.de/
2020
*/
2121

22+
/*
23+
Deactivate Errorlog (Just remove NOTICE logs)
24+
*/
25+
error_reporting(E_ALL & ~E_NOTICE);
26+
2227
/*
2328
Includes
2429
*/

js/webinterface/bot.js

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
/*
2+
First-Coder Teamspeak 3 Webinterface for everyone
3+
Copyright (C) 2017 by L.Gmann
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
18+
for help look http://first-coder.de/
19+
*/
20+
21+
/*
22+
Querybot: Save Botsettings
23+
*/
24+
function saveBotSettings(tablename)
25+
{
26+
switch(tablename)
27+
{
28+
case "bot_settigns_afk":
29+
var postData = {
30+
isAfkMoving: ($('#setAfkModul').is(':checked')) ? "1" : "0",
31+
isMovingMicMuted: ($('#setAfkMicMuted').is(':checked')) ? "1" : "0",
32+
isMovingHeadsetMuted: ($('#setAfkHeadsetMuted').is(':checked')) ? "1" : "0",
33+
isMovingAway: ($('#setAfkAway').is(':checked')) ? "1" : "0",
34+
AfkMovingChannel: $('#afkChannel').val(),
35+
isMovingIdleTime: $('#setAfkIdleTime').val(),
36+
isMovingIdleWarningMessage: ($('#setAfkIdleWarningMessage').is(':checked')) ? "1" : "0",
37+
MovingIdleWarningMessage: $('#setAfkIdleMessage').val(),
38+
afkMoveingImmunSgroups: JSON.stringify($('#setAfkImmunSgroups').tagsinput('items'))
39+
};
40+
break;
41+
};
42+
43+
$.ajax({
44+
type: "POST",
45+
url: "./php/functions/functionsBotPost.php",
46+
data: {
47+
action: 'saveBotSettings',
48+
botid: botid,
49+
table: tablename,
50+
data: JSON.stringify(postData)
51+
},
52+
success: function(data){
53+
/*if(data == "done" && which == "language")
54+
{
55+
setNotifySuccess("Language set! Reload the page to see your site in the new language!");
56+
}
57+
else if(data == 'done')
58+
{
59+
setNotifySuccess(lang.settigns_saved);
60+
}
61+
else
62+
{
63+
setNotifyFailed("Ups, something Failed :/");
64+
};*/
65+
console.log(data);
66+
}
67+
});
68+
};
69+
70+
/*
71+
Querybot: Show Botdetails
72+
*/
73+
function showQueryBot(id, instanz, port)
74+
{
75+
$("#mainContent").fadeOut("fast", function()
76+
{
77+
$("#mainContent").load('./php/bot/web_bot_query_info.php', { "id" : id, "instanz" : instanz, "port" : port }, function()
78+
{
79+
$("#mainContent").fadeIn("fast");
80+
});
81+
});
82+
};
83+
84+
/*
85+
Querybot: Create Querybot
86+
*/
87+
function createQueryBot()
88+
{
89+
$.ajax({
90+
type: "POST",
91+
url: "./php/functions/functionsBotPost.php",
92+
data: {
93+
action: 'createQueryBot',
94+
instanz: $('#selectCreateQueryBotInstance').val(),
95+
port: $('#selectCreateQueryBotPort').val(),
96+
name: encodeURIComponent($('#createQueryBotName').val())
97+
},
98+
success: function(data){
99+
console.log(data);
100+
}
101+
});
102+
};
103+
104+
/*
105+
Querybot: Delete Querybot
106+
*/
107+
function deleteQueryBot(id)
108+
{
109+
$.ajax({
110+
type: "POST",
111+
url: "./php/functions/functionsBotPost.php",
112+
data: {
113+
action: 'deleteQueryBot',
114+
id: id
115+
},
116+
success: function(data){
117+
console.log(data);
118+
}
119+
});
120+
};
121+
122+
/*
123+
Querybot: Change Selectmenu on Querybot Create
124+
*/
125+
function addQueryBotChangePort()
126+
{
127+
var instanz = $('#selectCreateQueryBotInstance').val();
128+
129+
if(instanz != 'nope')
130+
{
131+
$.ajax({
132+
type: "POST",
133+
url: "./php/functions/functionsTeamspeakPost.php",
134+
data: {
135+
action: 'getTeamspeakPorts',
136+
instanz: instanz
137+
},
138+
success: function(data){
139+
var element = document.getElementById('selectCreateQueryBotPort');
140+
141+
while ( element.childNodes.length >= 1 )
142+
{
143+
element.removeChild(element.firstChild);
144+
};
145+
146+
if(data != "[]")
147+
{
148+
var ports = JSON.parse(data);
149+
for (i = 0; i < ports.length; i++)
150+
{
151+
port = document.createElement('option');
152+
port.value = ports[i];
153+
port.text = ports[i];
154+
element.appendChild(port);
155+
};
156+
157+
$('#bttnCreateQueryBot').prop("disabled", false);
158+
}
159+
else
160+
{
161+
nope = document.createElement('option');
162+
nope.value = 'nope';
163+
nope.text = unescape(lang.ts3_no_copy);
164+
element.appendChild(nope);
165+
166+
$('#bttnCreateQueryBot').prop("disabled", true);
167+
};
168+
}
169+
});
170+
}
171+
else
172+
{
173+
var element = document.getElementById('selectCreateQueryBotSid');
174+
175+
while ( element.childNodes.length >= 1 )
176+
{
177+
element.removeChild(element.firstChild);
178+
};
179+
180+
nope = document.createElement('option');
181+
nope.value = 'nope';
182+
nope.text = unescape(lang.ts3_no_copy);
183+
element.appendChild(nope);
184+
};
185+
};

php/functions/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
/*
3535
Installed Webinterface version
3636
*/
37-
define("INTERFACE_VERSION", "1.3.13-OPEN-BETA");
37+
define("INTERFACE_VERSION", "1.3.14-OPEN-BETA");
3838

3939
/*
4040
Anti XSS

php/functions/functionsBackupPost.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
$server = $tsAdmin->serverInfo();
6767

68-
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)
68+
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'))
6969
&& $user_right['right_web_global_server']['key'] != $mysql_keys['right_web_global_server']) || $user_right['right_web']['key'] != $mysql_keys['right_web'])
7070
{
7171
exit();
@@ -79,15 +79,15 @@
7979
/*
8080
Create Backup
8181
*/
82-
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']))
82+
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']))
8383
{
8484
echo createBackup($tsAdmin, $_POST['instanz'], $_POST['port'], $_POST['kind'], $_POST['kindChannel']);
8585
};
8686

8787
/*
8888
Activate Channel Backup
8989
*/
90-
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']))
90+
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']))
9191
{
9292
if($_POST['subaction'] == "channelname")
9393
{

php/functions/functionsTeamspeak.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ function deleteFileFromFilelist($path, $cid, $port, $instanz)
631631
$delfiles[] = $path;
632632
$file_delete = $tsAdmin->ftDeleteFile($cid, "", $delfiles);
633633

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

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

690690
if($token_add['success']!==false)
691691
{
692-
writeInLog($_SESSION['user']['benutzer'], "Create Token (".$token[$i]['token'].") Instanz: ".$instanz." Sid: ".$serverId, true);
693-
694692
$token['done'] = "true";
695693
$token[$i] = array();
696694
$token[$i]['token'] = $token_add['data']['token'];
@@ -705,6 +703,8 @@ function addToken($type, $tokenid1, $tokenid2, $number, $description, $serverId,
705703
$token[$i]['type'] = $language['cgroup'];
706704
$token[$i]['channel'] = "Channel ID: ".$tokenid2;
707705
};
706+
707+
writeInLog($_SESSION['user']['benutzer'], "Create Token (".$token[$i]['token'].") Instanz: ".$instanz." Sid: ".$serverId, true);
708708
}
709709
else
710710
{
@@ -1060,6 +1060,7 @@ function deleteIcon($id, $instanz, $serverId, $port)
10601060
function getTeamspeakIcons($tsAdmin, $port, $ip, $queryport, $username, $password)
10611061
{
10621062
$ft = $tsAdmin->ftGetFileList(0, '', '/icons');
1063+
$handler = null;
10631064

10641065
if(is_dir('../../images/ts_icons/'.$ip.'-'.$port.'/'))
10651066
{

php/teamspeak/web_teamspeak_serverview.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
/*
116116
No Client permission
117117
*/
118-
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'])
118+
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'])
119119
|| $user_right['right_web']['key'] != $mysql_keys['right_web'])
120120
{
121121
reloadSite();

0 commit comments

Comments
 (0)