-1

I am looking for a way to create a privilege key for a Teamspeak 3 server that my client owns so that upon completion of a users registration, an email is sent welcoming them, but also contains a key for them to use, if they want to, to easily connect to the TS Sever and uptain the needed permissions without an admin needing to be present. Unfortunately, I have no idea where to start. I think this would utilize JavaScript but now that I think about it may be better to use php. I think this would make it more secure. Please help.

2 Answers2

0

When Teamspeak 3 server is first run, it generates a privilege key to gain administrator access. This key is stored in the log file generated in logs/ts3server_ followed by date of the log.

In order to get the key, you should read that log file. This code snippet prints out the privilege key, at least for me.

<?php
// Script in ts3 server's root directory, using PHP 5.4.4

error_reporting(0); // Prevent notices of nonexistent $matches[1], alternatively use array_key_exists before checking for matches[1]
$logs = scandir('logs');
foreach($logs as $log) // In case there are many log files
{
    $content = file_get_contents('logs/'.$log);
    preg_match('/token=(.+)/', $content, $matches); // Find privilege token and get it to $matches[1]
    if($matches[1]) break;
}
echo $matches[1];

Now you can easily use $matches[1] in mail() to send the user their privilege key.

3ventic
  • 1,023
  • 1
  • 20
  • 32
-1

I think 3ventic misunderstand what david is asking about.

Anyways, the way david said is more like to write a script that will auto generate a privilege key for a group like registered user which can bypass server password etc.

So in order to do what he's trying to do, you'll first have access to serverquery's server admin (that's what 3ventic is talking about), once inside, follow this url: https://freevps.us/thread-11350.html

I haven't touched TS3's serverquery with PHP for a long time, but this should get you in the right direction on how to do it.

  1. Connect to serverquery via PHP
  2. login serverquery's admin with login serveradmin password
  3. use command use sid=serverID to pick the virtual server you want to use
  4. followed by tokenadd tokentype=0 tokenid1=groupID tokenid2=0 to generate a privilege key for that particular group
  5. return the generated privilege key output back to the user
Willy_Sunny
  • 199
  • 3
  • 14