Closed ghost closed 6 years ago
Hi, The code looks fine.
$ts3_server->privilegeKeyDelete($ts3_waehlen_id);
What contains the variable $ts3_waehlen_id
? Is it empty? Does it contain a valid value?
Did you already test your ServerQuery credentials using a command line or eg. YaTQa?
I believe, that the credentials are just not valid anymore since the update.
The connection over YaTQa works. In $ ts3_select_id is the token ID. That does not help, because with every code the same message comes. Another Messange: (insufficient client permissions (failed on channellist 25/0x19). ) Code: https://pastebin.com/MLVhyvxv Picture DB entry: https://picload.org/view/dcroacal/unbenannt1.png.html
The version 3.2.0 worked. After upgrading to version 3.4.0 of TeamSpeak3, it did not work anymore. Do I have to do something specific?
I cannot reproduce this...
Some suggestions:
Everything already tested. on Local Server on vserver Upgraded Server Newly installed server Windows and Linux Serveradmin Login New Created Querry Login
Does the second code work? (Https://pastebin.com/MLVhyvxv)
Can you please give this code a try? https://pastebin.com/UxACgp27
You had some typo's like ehco
instead of echo
or some unexpected }
.
I've improved your URI by using rawurlencode()
(ref) and I've cleaned up the try-catch
code.
I've also improved your IF statements by converting them to switch-case
(ref). That's a bit easier to read and more efficient. :)
After fixing code errors, on fresh TeamSpeak3 install (docker, alpine:latest), when I run code I get:
➜ ts3phpframework-release git:(master) ✗ php test.php
I.e. no output
After logging into the TS3 server for first time and using the initial server admin token, rerunning same code gives:
➜ ts3phpframework-release git:(master) ✗ php test.php
1281<br>database empty result set%
After creating a privilege key (screenshot), I again get no output (as expected by your code):
ts3phpframework-release git:(master) ✗ php test.php
Using my own code:
<?php
require_once('libraries/TeamSpeak3/TeamSpeak3.php');
$ts3_nickname = 'TestNick' . "/DB";
$server = array(
"tsip" => '127.0.0.1',
"tsport" => '9987',
"ts_query_admin" => 'serveradmin',
"ts_query_password" => '0UyQ6ipy',
"ts_query_port" => '10011',
"ts_query_user_nick" => 'TestUser'
);
TeamSpeak3::init();
$ts3_server = TeamSpeak3::factory("serverquery://".$server["ts_query_admin"].":".$server["ts_query_password"]."@".$server["tsip"].":".$server["ts_query_port"]."/?server_port=".$server["tsport"]."&nickname=".$server["ts_query_user_nick"]."");
$ts3_privilege_key_list = $ts3_server->privilegeKeyList($resolve = TRUE);
var_dump($ts3_privilege_key_list);
I get following, correct output:
➜ ts3phpframework-release git:(master) ✗ php test.php
/home/static/dev/ts3phpframework-release/test.php:17:
array(1) {
'KIljPRYdRmROh5ekE5LERzWTEwRHv1xKQ209MvHh' =>
array(6) {
'token' =>
class TeamSpeak3_Helper_String#24 (2) {
protected $string =>
string(40) "KIljPRYdRmROh5ekE5LERzWTEwRHv1xKQ209MvHh"
protected $position =>
int(0)
}
'token_type' =>
int(0)
'token_id1' =>
class TeamSpeak3_Helper_String#112 (2) {
protected $string =>
string(5) "Guest"
protected $position =>
int(0)
}
'token_id2' =>
int(0)
'token_created' =>
int(1539201971)
'token_description' =>
class TeamSpeak3_Helper_String#22 (2) {
protected $string =>
string(8) "Test Key"
protected $position =>
int(0)
}
}
}
EDIT: Forgot screenshot, linked now.
I have added the code of Sebi94nbg and the same error. screenshot: (https://picload.org/view/dcrlgalr/unbenannt2.png.html) The whole token side of me. (https://pastebin.com/gDLHY5R5) Everything worked in TeamSpeak3 version 3.2.0.
The framework is working as expected.
I would recommend you simplify your code (see my example above). This will help you test your environment and troubleshoot where the issue is.
EDIT: You might also confirm that your server query client has permission b_virtualserver_token_list
...
The thing is just that it has worked well in version 3.2.0. Only after the update, nothing works.
There's lots of things that could cause this. In this situation, none of them are related to the framework.
I'm not aware of any change related to the privilege key permissions in recent server releases. Anyway... as already stated, this is not a framework issue. Please ask your question in the official TeamSpeak forum:
Good day, After updating my TeamSpeak server I get error messages with every command. (insufficient client permissions (failed on privilegekeylist 36 / 0x24)) Code example: https://pastebin.com/0dy4gdVd