Show banlist on you website

kalle

high minded
Contributor
Oct 28, 2015
411
253
178
I could create this in a few minutes, but what the real problem is teamspeak instances. No test production could be made rip
 

kalle

high minded
Contributor
Oct 28, 2015
411
253
178
I already said that I cant reproduce real TS3 enviorment so I am unable to create that script. But will see, if I make one will post it here for sure.
 

XARON

get over here!
Restricted
Nov 24, 2016
162
161
118
Enjoy it. Tested with single no licensed latest version teamspeak server, php7 w/ apache2 on windows. Just need ts3admin.class


Code:
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
    <title>Document</title>
</head>
<body>
    <?php
    /**
     * Created by PhpStorm.
     * User: XARON
     * Date: 17.11.2018
     * Time: 19:04
     */
    ini_set('display_errors', 1);
    ini_set('display_startup_errors', 1);
    error_reporting(E_ALL);
    define('MAIN', true);
    date_default_timezone_set('Europe/London');
    ini_set('default_charset', 'UTF-8');
    setlocale(LC_ALL, 'UTF-8');
    require_once('./ts3admin.class.php');

    $query = new ts3admin('127.0.0.1', 10011);
    if($query->getElement('success', $query->connect())) {
        $query->login('serveradmin', 'kU9dj+kw');
        $bans = array();
        foreach($query->serverList()['data'] as $k => $server) {
            $query->selectServer($server['virtualserver_port']);
            $query->setName(urlencode('Swallalala.'.rand(0, 1337)));
            array_push($bans, array('serverId' => $server['virtualserver_id'], 'serverName' => $server['virtualserver_name'], 'serverPort' => $server['virtualserver_port'], 'bans' => array()));
            foreach($query->getElement('data', $query->banList()) as $ban) {
                array_push($bans[$k]['bans'], array('banId' => (isset($ban['banid']) ? $ban['banid'] : null), 'ip' => (isset($ban['ip']) ? $ban['ip'] : null), 'name' => (isset($ban['name']) ? $ban['name'] : null), 'uid' => (isset($ban['uid']) ? $ban['uid'] : null), 'mytsid' => (isset($ban['mytsid']) ? $ban['mytsid'] : null), 'lastnickname' => (isset($ban['lastnickname']) ? $ban['lastnickname'] : null), 'created' => (isset($ban['created']) ? date('d.m.Y H:i:s a', $ban['created']) : null), 'duration' => (isset($ban['duration']) ? $ban['duration'] : null), 'invokername' => (isset($ban['invokername']) ? $ban['invokername'] : null), 'invokercldbid' => (isset($ban['invokercldbid']) ? $ban['lastnickname'] : null), 'invokeruid' => (isset($ban['invokeruid']) ? $ban['invokeruid'] : null), 'reason'  => (isset($ban['reason']) ? $ban['reason'] : null), 'enforcements' => (isset($ban['enforcements']) ? $ban['enforcements'] : null)));
            }
        }
    }
    ?>
    <?php
    foreach($bans as $ban) {
    ?>
        <h1 style="text-align: center !important;">Ban List From (#<?=$ban['serverId'].' - '.$ban['serverName'].' - '.$ban['serverPort']?>)</h1>
        <table class="table">
            <thead class="thead-dark">
            <tr>
                <th scope="col" style="text-align: center !important;">ID</th>
                <th scope="col" style="text-align: center !important;">IP</th>
                <th scope="col" style="text-align: center !important;">Name</th>
                <th scope="col" style="text-align: center !important;">Duration</th>
                <th scope="col" style="text-align: center !important;">Invoker</th>
                <th scope="col" style="text-align: center !important;">Reason</th>
            </tr>
            </thead>
            <tbody>
            <?php foreach($ban['bans'] as $user) { ?>
                <tr>
                    <th scope="row" style="text-align: center !important;"><?=($user['banId'] ? $user['banId'] : '-')?></th>
                    <th scope="row" style="text-align: center !important;"><?=($user['ip'] ? $user['ip'] : '-')?></th>
                    <th scope="row" style="text-align: center !important;"><?=($user['lastnickname'] ? $user['lastnickname'] : '-')?></th>
                    <th scope="row" style="text-align: center !important;"><?=($user['duration'] ? $user['duration'] : '-')?></th>
                    <th scope="row" style="text-align: center !important;"><?=($user['invokername'] ? $user['invokername'] : '-')?></th>
                    <th scope="row" style="text-align: center !important;"><?=($user['reason'] ? $user['reason'] : 'No Reason')?></th>
                </tr>
            <?php } ?>
            </tbody>
        </table>
    <?php } ?>
    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
</body>
</html>

@BIOS ,@kalle ,@Asphyxia
 
Last edited:

XARON

get over here!
Restricted
Nov 24, 2016
162
161
118
Yeah, GitHub is great otherwise there is also GitLab and Bitbucket. Use your tools, be smart!

If you are going to share code, use code sharing tools. Do you think this sounds too difficult? I can create a tutorial for you.

I'm using gitlab for free priv8 repos but not using for small codes. thanks for this xd, Just look at your priv8 discord messages
 

Asphyxia

Owner
Administrator
Apr 25, 2015
1,845
2
2,199
327
I'm using gitlab for free priv8 repos but not using for small codes. thanks for this xd, Just look at your priv8 discord messages

You can create a a junk/misc (miscellaneous) repository for sharing random snippets of code. Nothing wrong with that! It is far safer to exchange code repository links than unknown files. Do you understand the security concern with this? If that sounds like too much work, I understand that but then use Pastebin instead. No reason to send RAR files for some simple code.
 

XARON

get over here!
Restricted
Nov 24, 2016
162
161
118
You can create a a junk/misc (miscellaneous) repository for sharing random snippets of code. Nothing wrong with that! It is far safer to exchange code repository links than unknown files. Do you understand the security concern with this?

Some paste sites is blocked by Turkey Police Department, we can not access. I have just access paste.laravel.io and i have very bad internet connection and library have very big lines. I can not paste/upload code. Browser is crashing or not working. >.<
 
Top