Community Forums Today's Posts     Member List     Archive    
Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2009
    Location
    Germany
    Posts
    32

    Create token by php script and mysql

    How can i create a token? Dont know parameters and if this contains MD5 decrypt and so on.

    I want to create a "Normal" Group token, via web page with php. With this token user get voice power in channel.

  2. #2
    Join Date
    Dec 2009
    Location
    Europe
    Posts
    184
    Write a PHP script around the following command sequence:

    (connection on serverquery port)
    ...TS3
    use 1
    ... error id=0 msg=ok
    login serveradmin PASSWORD
    ... error id=0 msg=ok
    tokenadd tokentype=0 tokenid1=7 tokenid2=0
    (create a token for the Normal server group (7))
    token=XXXXXXXXXXXXXXXXXXXX
    ... error id=0 msg=ok
    tokenadd tokentype=1 tokenid1=7 tokenid2=1
    (create a token for Voice (7) channel group in server channel (1))
    token=XXXXXXXXXXXXXXXXXXXX
    ... error id=0 msg=ok
    logout
    ... error id=0 msg=ok
    quit
    (disconnect)

  3. #3
    Join Date
    Dec 2009
    Location
    Germany
    Posts
    32
    OK, is there a direct way via php and mysql?

  4. #4
    Join Date
    Dec 2009
    Location
    Europe
    Posts
    184
    Do a search in this forum, if you feel that you cannot write the php code yourself:

    http://forum.teamspeak.com/forumdisplay.php?f=114

  5. #5
    Join Date
    Dec 2009
    Location
    Germany
    Posts
    32
    Yes, right i can coding but your solution is the bad way if you have full access to the database, right?

    I found a very easy to do that!

    Fill out all fields in mysqldb where the table token is. Just create a key by your self and thats it.

    This code are 3-5 lines if you have a contentsystem with a connected db.

    Why so complicated?

  6. #6
    Join Date
    Dec 2009
    Location
    Germany
    Posts
    32
    For someone who need a little script:

    PHP Code:
                  srand((double)microtime()*1000000);
            
    $tkey substr(md5(rand(0,9999999)),0,20);

            
    $tsinsert "INSERT INTO tokens (server_id, token_key, token_type, token_id1, token_id2) VALUES ('1', '$tkey', '0', '7', '0')";
            
    $tsdbinsert mysql_query($tsinsert); 
    It will generate a token on server(1) with user group normal(7). $tkey u can use this key to send it per mail or show it on website.

  7. #7
    Join Date
    Dec 2009
    Location
    Europe
    Posts
    184
    Thank you for sharing your code. Originally I was unaware of the fact that you wanted direct database interaction.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Linux + MySQL HOWTO with sys init script
    By SShaadd in forum Linux / FreeBSD
    Replies: 5
    Last Post: 22-12-2009, 17:25
  2. Teamspeak on Mysql , create and stat subserveur
    By andrelec1 in forum [TeamSpeak 2] Server Support
    Replies: 6
    Last Post: 03-09-2009, 17:38
  3. FreeBSD and MySQL
    By Paterson in forum [TeamSpeak 2] Server Support
    Replies: 1
    Last Post: 18-01-2006, 08:35
  4. MySql & PhP & Teamspeak
    By Samadhi in forum [TeamSpeak 2] Server Support
    Replies: 5
    Last Post: 29-09-2004, 13:59
  5. Help on SQLite script to create client
    By osward in forum [TeamSpeak 2] Server Support
    Replies: 0
    Last Post: 24-08-2004, 05:03

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •