Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Results 1 to 5 of 5
  1. #1
    Join Date
    December 2007
    Location
    Austria,Linz
    Posts
    214

    Solved [MySQL] Switch user to group offline

    Hello,

    I want to switch user with ID 4792 to group ID 23, but it doesn't work.
    What I do:
    Code:
    INSERT INTO `group_server_to_client` (`group_id`, `server_id`, `id1`, `id2`) VALUES (23, 1, 4792, 0);
    (the user is offline) - after the query I connect again, but I'm not at group 23.

    If I switch the user at the ts3 client, it's the same data at the group_server_to_client table as the query above.
    Do I have to reload something after database entries/changes?

  2. #2
    Join Date
    July 2006
    Posts
    1,600
    You _must_ use the serverquery interface.
    Modifying the database directly can corrupt your server setup.

  3. #3
    Join Date
    December 2007
    Location
    Austria,Linz
    Posts
    214
    Thank you, thats easy with php!

  4. #4
    Join Date
    January 2010
    Location
    Secret Base in Arctic Region
    Posts
    1,671
    Besides maxis advice, if you edit the database directly you have to restart your TS-Server-Instance to make the changes take effect.

  5. #5
    Join Date
    December 2007
    Location
    Austria,Linz
    Posts
    214
    Thanks for information alcazar.

    I made an php script, if someone need this, here is how to execute:
    Code:
    <?php
    $host = "127.0.0.1";
    $port = 10011;
    $ts3_serverid = 1;
    $sa_username = "serveradmin";
    $sa_passwd = "mypassword";
    
    
    if($fp = fsockopen($host, $port, $errstr, $errno, 5))
    {
    	sleep(1);
    	fputs($fp,"login $sa_username $sa_passwd\r\n");
    	sleep(1);
    	fputs($fp, "use $ts3_serverid\r\n");
    	sleep(1);
    	// Now your commands with fputs
    	//....
    	
    	fclose($fp);
    }

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Assigning server group to an offline user
    By runeswords in forum Permission System
    Replies: 1
    Last Post: February 26th, 2013, 03:05 PM
  2. Replies: 4
    Last Post: July 16th, 2012, 12:55 PM
  3. [Resolved] How to change the channel group membership if user is offline?
    By Barungar in forum Permission System
    Replies: 5
    Last Post: December 13th, 2011, 11:16 AM
  4. TS3 All User Switch
    By Manuel20 in forum General Questions
    Replies: 2
    Last Post: January 22nd, 2011, 02:34 AM
  5. switch all user?
    By HalloGehn in forum Tools / Web Based
    Replies: 2
    Last Post: January 7th, 2010, 03:39 PM

Posting Permissions

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