Skip to content

Commit e1da50d

Browse files
committed
Update to 1.3.13
1 parent a2ed7b4 commit e1da50d

File tree

8 files changed

+99
-66
lines changed

8 files changed

+99
-66
lines changed

iframeServerBanner.php

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
$tsAdmin->selectServer($port, "port");
100100
$serverinfo = $tsAdmin->serverInfo();
101101
$clients = $tsAdmin->clientList("-ip");
102+
$ts3clients = array();
102103

103104
if(!empty($clients['data']))
104105
{
@@ -109,9 +110,13 @@
109110
$ts3clients[htmlentities($client['connection_client_ip'])] = htmlentities($client['client_nickname']);
110111
};
111112
};
112-
$clientcache = fopen('./images/ts_banner/'.$instanz.'_'.$port.'_clients.php', 'w+');
113-
fwrite($clientcache, '<?php $nicklist = json_decode(\''.str_replace("'", "\'", json_encode($ts3clients, 1)).'\',1);');
114-
fclose($clientcache);
113+
114+
if(!empty($ts3clients))
115+
{
116+
$clientcache = fopen('./images/ts_banner/'.$instanz.'_'.$port.'_clients.php', 'w+');
117+
fwrite($clientcache, '<?php $nicklist = json_decode(\''.str_replace("'", "\'", json_encode($ts3clients, 1)).'\',1);');
118+
fclose($clientcache);
119+
};
115120
};
116121
};
117122

@@ -145,6 +150,21 @@
145150
paintText($image, $textInfos['fontsize'], $textInfos['x'], $textInfos['y'], $textInfos['color'], $textInfos['fontfile'], $text);
146151
};
147152

153+
foreach ($packetmanager['custom'] AS $text=>$textInfos)
154+
{
155+
if (!file_exists($textInfos['fontfile']))
156+
{
157+
throw new Exception ('Font File not found! Searched at '.$textInfos['fontfile'].PHP_EOL.'You may need to set the absolute path (from root directory /var/www/...)');
158+
};
159+
160+
if (strpos($text, '%nickname%') !== FALSE)
161+
{
162+
continue;
163+
};
164+
165+
paintText($image, $textInfos['fontsize'], $textInfos['x'], $textInfos['y'], $textInfos['color'], $textInfos['fontfile'], $textInfos['text']);
166+
};
167+
148168
/*
149169
Clearing
150170
*/

php/admin/web_admin_logs.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,16 @@
7575
</div>
7676
<div class="card-block">
7777
<?php
78-
$logAvalible = explode("|", $systemLogs[0]);
7978
if(empty($systemLogs))
8079
{
8180
echo "<p style=\"text-align: center;\">".$language['no_entrys']."</p>";
8281
}
83-
else if(count($logAvalible) != 3)
82+
else
83+
{
84+
$logAvalible = explode("|", $systemLogs[0]);
85+
};
86+
87+
if(count($logAvalible) != 3)
8488
{
8589
echo "<p style=\"text-align: center;\">".$language['log_not_possible']."</p>";
8690
}

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.12-OPEN-BETA");
37+
define("INTERFACE_VERSION", "1.3.13-OPEN-BETA");
3838

3939
/*
4040
Anti XSS

php/functions/functionsTeamspeakPost.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@
508508
{
509509
if(isSet($_POST['instanz']))
510510
{
511-
echo json_encode(getTeamspeakslots($_POST['instanz'], $_POST['force']));
511+
echo json_encode(getTeamspeakslots($_POST['instanz'], (isset($_POST['force'])) ? $_POST['force'] : false));
512512
}
513513
else
514514
{

php/main/web_main_main.php

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -65,32 +65,34 @@
6565
$time = str_replace(".json", "", $datei);
6666
$cont = array();
6767
$json = file_get_contents("../../files/news/".$datei);
68-
$cont = json_decode($json, true); ?>
68+
$cont = json_decode($json, true);
6969

70-
<div class="card" id="<?php xssEcho($time); ?>">
71-
<div class="card-block card-block-header">
72-
<div style="float:left;">
73-
<h4 class="card-title"><i class="fa fa-newspaper-o"></i> <?php xssEcho($cont['title']); ?></h4>
70+
if(ctype_digit($time) != null) { ?>
71+
72+
<div class="card" id="<?php xssEcho($time); ?>">
73+
<div class="card-block card-block-header">
74+
<div style="float:left;">
75+
<h4 class="card-title"><i class="fa fa-newspaper-o"></i> <?php xssEcho($cont['title']); ?></h4>
76+
</div>
77+
<div style="float:right;">
78+
<?php echo date("d.m.Y (G:i)", $time); ?>
79+
</div>
80+
<h6 style="clear:both;" class="card-subtitle text-muted"><?php xssEcho($cont['subtitle']); ?></h6>
7481
</div>
75-
<div style="float:right;">
76-
<?php echo date("d.m.Y (G:i)", $time); ?>
82+
<div class="card-block">
83+
<p style="font-style:normal;">
84+
<?php echo $cont['content']; ?>
85+
</p>
86+
<?php if($LoggedIn && $user_right['right_hp_main'] == $mysql_keys['right_hp_main']) { ?>
87+
<div style="width:20%;float:right;">
88+
<button onClick="AreYouSure('<?php echo $language['delete_news']; ?>', 'deleteNews(\'<?php echo $time; ?>\');');" style="width:100%;" class="btn btn-danger btn-sm"><i class="fa fa-trash" aria-hidden="true"></i> <font class="hidden-xs-down"><?php echo $language['delete']; ?></font></button>
89+
</div>
90+
<div style="clear:both;"></div>
91+
<?php }; ?>
7792
</div>
78-
<h6 style="clear:both;" class="card-subtitle text-muted"><?php xssEcho($cont['subtitle']); ?></h6>
7993
</div>
80-
<div class="card-block">
81-
<p style="font-style:normal;">
82-
<?php echo $cont['content']; ?>
83-
</p>
84-
<?php if($LoggedIn && $user_right['right_hp_main'] == $mysql_keys['right_hp_main']) { ?>
85-
<div style="width:20%;float:right;">
86-
<button onClick="AreYouSure('<?php echo $language['delete_news']; ?>', 'deleteNews(\'<?php echo $time; ?>\');');" style="width:100%;" class="btn btn-danger btn-sm"><i class="fa fa-trash" aria-hidden="true"></i> <font class="hidden-xs-down"><?php echo $language['delete']; ?></font></button>
87-
</div>
88-
<div style="clear:both;"></div>
89-
<?php }; ?>
90-
</div>
91-
</div>
92-
93-
<?php };
94+
<?php };
95+
};
9496
};
9597
}
9698
else if(CUSTOM_NEWS_PAGE == "true")

php/teamspeak/web_teamspeak_server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142

143143
foreach($servers['data'] AS $number => $server)
144144
{
145-
if(strpos($user_right['right_web_server_view'][$instanz], $server['virtualserver_port']) !== false || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server'])
145+
if(isPortPermission($user_right, $instanz, $server['virtualserver_port'], 'right_web_server_view') || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server'])
146146
{
147147
$globalServers[$instanz][$number] = $server;
148148
$globalServerCount++;

php/teamspeak/web_teamspeak_server_requests.php

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,19 @@
8989
{
9090
if($datei != "." && $datei != "..")
9191
{
92-
$information = explode("_", $datei);
93-
$information[1] = str_replace(".txt", "", $information[1]);
94-
echo '<tr>
95-
<td>'.xssSafe($information[0]).'</td>
96-
<td>'.xssSafe($information[1]).'</td>
97-
<td>
98-
<button class="btn btn-success btn-sm mini-left-right-margin" onClick="showServerRequest(\''.$datei.'\');"><i class="fa fa-edit"></i> <font class="hidden-md-down">'.$language['edit'].'</font>
99-
<button class="btn btn-danger btn-sm mini-left-right-margin" onClick="deleteWantServer(\''.$datei.'\');"><i class="fa fa-trash"></i> <font class="hidden-md-down">'.strtolower($language['delete']).'</font>
100-
</td>
101-
</tr>';
92+
$information = explode("_", $datei);
93+
if(count($information) >= 2)
94+
{
95+
$information[1] = str_replace(".txt", "", $information[1]);
96+
echo '<tr>
97+
<td>'.xssSafe($information[0]).'</td>
98+
<td>'.xssSafe($information[1]).'</td>
99+
<td>
100+
<button class="btn btn-success btn-sm mini-left-right-margin" onClick="showServerRequest(\''.$datei.'\');"><i class="fa fa-edit"></i> <font class="hidden-md-down">'.$language['edit'].'</font>
101+
<button class="btn btn-danger btn-sm mini-left-right-margin" onClick="deleteWantServer(\''.$datei.'\');"><i class="fa fa-trash"></i> <font class="hidden-md-down">'.strtolower($language['delete']).'</font>
102+
</td>
103+
</tr>';
104+
};
102105
};
103106
};
104107
}; ?>

php/teamspeak/web_teamspeak_serverfilelist.php

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -95,41 +95,45 @@ function getChannelFiles($filelist, $cid, $path = "/")
9595
global $tsAdmin;
9696

9797
$returnFilelist = array();
98-
foreach($filelist AS $file)
98+
99+
if(!empty($filelist))
99100
{
100-
if(empty($file['path']))
101-
{
102-
$file['path'] = $path;
103-
};
104-
105-
if($file['size'] == 0)
101+
foreach($filelist AS $file)
106102
{
107-
foreach(getChannelFiles($tsAdmin->getElement('data', $tsAdmin->ftGetFileList($cid, "", $path.$file['name'])), $cid, $path.$file['name']."/") AS $subFile)
103+
if(empty($file['path']))
104+
{
105+
$file['path'] = $path;
106+
};
107+
108+
if($file['size'] == 0)
108109
{
109-
if(empty($subFile['cid']))
110+
foreach(getChannelFiles($tsAdmin->getElement('data', $tsAdmin->ftGetFileList($cid, "", $path.$file['name'])), $cid, $path.$file['name']."/") AS $subFile)
110111
{
111-
$subFile['cid'] = $cid;
112+
if(empty($subFile['cid']))
113+
{
114+
$subFile['cid'] = $cid;
115+
};
116+
117+
if(substr($subFile['path'], -1) != "/")
118+
{
119+
$subFile['path'] .= "/";
120+
};
121+
$returnFilelist[] = $subFile;
122+
};
123+
}
124+
else
125+
{
126+
if(empty($file['cid']))
127+
{
128+
$file['cid'] = $cid;
112129
};
113130

114-
if(substr($subFile['path'], -1) != "/")
131+
if(substr($file['path'], -1) != "/")
115132
{
116-
$subFile['path'] .= "/";
133+
$file['path'] .= "/";
117134
};
118-
$returnFilelist[] = $subFile;
119-
};
120-
}
121-
else
122-
{
123-
if(empty($file['cid']))
124-
{
125-
$file['cid'] = $cid;
126-
};
127-
128-
if(substr($file['path'], -1) != "/")
129-
{
130-
$file['path'] .= "/";
135+
$returnFilelist[] = $file;
131136
};
132-
$returnFilelist[] = $file;
133137
};
134138
};
135139

0 commit comments

Comments
 (0)