view tokens web

skreww

New Member
Aug 28, 2017
28
1
20
Name of the script: View token

Functions of the script: View token avalaible on a web page
Why do you want it: To put a function on my own teamspeak panel
Screenshots: don't have
Original source (if any): don't have
Other notes: I would like to see them.
 

skreww

New Member
Aug 28, 2017
28
1
20
hi @Kieran thanks for your answer, i would like to show the admin Token ( for get serveradmin group ) on my web panel. I can creat one with my panel but i can't see if others are avalaible to use.

I would like to show them on array list php script

Thank you
 
Last edited:

Kieran

Tag me
Contributor
Jan 1, 2016
459
286
122
hi @Kieran thanks for your answer, i would like to show the admin Token ( for get serveradmin group ) on my web panel. I can creat one with my panel but i can't see if others are avalaible to use.

I would like to show them on array list php script

Thank you
Is this what you are looking for?
I don't know what framework you're using but this should display all tokens if the query has enough permissions
https://docs.planetteamspeak.com/ts...server.html#a7dba6873e26fbac8c6d994a06232891b
 

skreww

New Member
Aug 28, 2017
28
1
20

Kieran

Tag me
Contributor
Jan 1, 2016
459
286
122
yes i'm looking for install this option on my own panel ^^
I will try it this night, i'm at the office and i don't have my laptop.

Thanks for your answer, i will try to install it.
Okay, good luck. I will try to help if there are problems
 

skreww

New Member
Aug 28, 2017
28
1
20
@Kieran

I think i will need your help to put it on my website ^^
I'm in for 4 hours, nearly i crush my head on the laptop x)
 

Kieran

Tag me
Contributor
Jan 1, 2016
459
286
122
@Kieran

I think i will need your help to put it on my website ^^
I'm in for 4 hours, nearly i crush my head on the laptop x)
PHP:
<?php
require_once("./TeamSpeak3/TeamSpeak3.php");

$config = array(); //Creates Config Array
$config["Username"] = "login"; //Query Login 
$config["Password"] = "passowrd"; //Query Password 
$config["IP"] = "1.1.1.1"; //Server IP/Domain
$config["Port"] = "9987"; //Server Port
$config["qPort"] = "10011"; // Query Port, Default 10011
$config["Nickname"] = rawurlencode("Query".rand(1,99)); // Convertes Botname to a URI friendly Format

function print_r2($val){
        echo '<pre>';
        print_r($val);
        echo  '</pre>';
}

try{
$ts3 = TeamSpeak3::factory("serverquery://" . $config["Username"] . ":" . $config["Password"] . "@" . $config["IP"] . ":" . $config["qPort"] . "/?server_port=" . $config["Port"] . "");

$tokens = $ts3->privilegeKeyList();
print_r2($tokens);

}
catch(TeamSpeak3_Exception $error)
{
 // print the error message returned by the server
 echo "Error " . $error->getCode() . ": " . $error->getMessage();
}
?>
This should give you something to work with. Try a foreach(){} when you know where you want to display it
 

skreww

New Member
Aug 28, 2017
28
1
20
yeah it works ^^ thx you @Kieran but i got too mutch information ^^ like this
 
Last edited:

Kieran

Tag me
Contributor
Jan 1, 2016
459
286
122
Alright. Replace privilegeKeyList() with privilegeKeyList(true);
Also, you should delete the data you posted because those are the tokes.

Replace print_r2() with
PHP:
foreach($tokens as $token){
echo $token['token_id1'] . " " . $token['token'];
 }
I think that should echo the group and token
 

skreww

New Member
Aug 28, 2017
28
1
20
i don't understand the second part of your solution
Code:
function print_r2($val){
        echo '<pre>';
        print_r($val);
        echo  '</pre>';
}

try{
$ts3 = TeamSpeak3::factory("serverquery://" . $config["Username"] . ":" . $config["Password"] . "@" . $config["IP"] . ":" . $config["qPort"] . "/?server_port=" . $config["Port"] . "");

$tokens = $ts3->privilegeKeyList(true);
print_r2($tokens);

}
catch(TeamSpeak3_Exception $error)
{
 // print the error message returned by the server
 echo "No token avalaible " . $error->getCode() . ": " . $error->getMessage();
}
?>

witch part i'v to change ? ty @Kieran
 

Kieran

Tag me
Contributor
Jan 1, 2016
459
286
122
i don't understand the second part of your solution
Code:
function print_r2($val){
        echo '<pre>';
        print_r($val);
        echo  '</pre>';
}

try{
$ts3 = TeamSpeak3::factory("serverquery://" . $config["Username"] . ":" . $config["Password"] . "@" . $config["IP"] . ":" . $config["qPort"] . "/?server_port=" . $config["Port"] . "");

$tokens = $ts3->privilegeKeyList(true);
print_r2($tokens);

}
catch(TeamSpeak3_Exception $error)
{
 // print the error message returned by the server
 echo "No token avalaible " . $error->getCode() . ": " . $error->getMessage();
}
?>

witch part i'v to change ? ty @Kieran
Sorry, change it to this:
PHP:
<?php
require_once("./TeamSpeak3/TeamSpeak3.php");

$config = array(); //Creates Config Array
$config["Username"] = "login"; //Query Login
$config["Password"] = "passowrd"; //Query Password
$config["IP"] = "1.1.1.1"; //Server IP/Domain
$config["Port"] = "9987"; //Server Port
$config["qPort"] = "10011"; // Query Port, Default 10011
$config["Nickname"] = rawurlencode("Query".rand(1,99)); // Convertes Botname to a URI friendly Format

try{
$ts3 = TeamSpeak3::factory("serverquery://" . $config["Username"] . ":" . $config["Password"] . "@" . $config["IP"] . ":" . $config["qPort"] . "/?server_port=" . $config["Port"] . "");

$tokens = $ts3->privilegeKeyList(true);

foreach($tokens as $token){
     echo $token['token_id1'] . " " . $token['token'];
}

}
catch(TeamSpeak3_Exception $error)
{
 // print the error message returned by the server
 echo "Error " . $error->getCode() . ": " . $error->getMessage();
}
?>
 

skreww

New Member
Aug 28, 2017
28
1
20
Yup because you can't read it when there is many keys; thanks you so mutch for your support you are ansome
 

Kieran

Tag me
Contributor
Jan 1, 2016
459
286
122
Yup because you can't read it when there is many keys; thanks you so mutch for your support you are ansome
Okay just put
PHP:
<?php
require_once("./TeamSpeak3/TeamSpeak3.php");
echo "<style>table {    font-family: arial, sans-serif;    border-collapse: collapse;    width: 100%;}td, th {    border: 1px solid #dddddd;    text-align: left;    padding: 8px;}tr:nth-child(even) {    background-color: #dddddd;}</style>"; //HTML for table

$config = array(); //Creates Config Array
$config["Username"] = "login"; //Query Login
$config["Password"] = "passowrd"; //Query Password
$config["IP"] = "1.1.1.1"; //Server IP/Domain
$config["Port"] = "9987"; //Server Port
$config["qPort"] = "10011"; // Query Port, Default 10011
$config["Nickname"] = rawurlencode("Query".rand(1,99)); // Convertes Botname to a URI friendly Format

try{
$ts3 = TeamSpeak3::factory("serverquery://" . $config["Username"] . ":" . $config["Password"] . "@" . $config["IP"] . ":" . $config["qPort"] . "/?server_port=" . $config["Port"] . "");

$tokens = $ts3->privilegeKeyList(true);

echo "<table><tr><th>Group</th><th>Token</th></tr>";
foreach($tokens as $token){
     echo "<tr><td>" . $token['token_id1'] . "</td><td>" . $token['token'] . "</td></tr>";
}
echo "</table>";

}
catch(TeamSpeak3_Exception $error)
{
 // print the error message returned by the server
 echo "Error " . $error->getCode() . ": " . $error->getMessage();
}
?>
If you execute this, it should display a table. I don't have time to test it but I hope it works.
If you want to have this on a already existing website, just put <div><?php require_once("[file name]");?></div> where you want the table. PHP in html has to be enabled on your server though.
 
Top