Results 16 to 22 of 22
-
19-01-2010, 16:21 #16
-= TeamSpeak User =-
- Join Date
- Jan 2010
- Location
- uk
- Posts
- 4
Debug Mode activated!
The following errors where thrown:
Can not connect to the server
I get from latest script, i dont know php so please bare with me on this
one, this script is basically connecting to the query server, then taking in
tokenlist as an array and outputing it? (or generating new one etc)
This is exactly what i need for my forum integration mod, however, when
testing the basic commands on queryserver locally all is fine, remotely tho
im getting insufficient client priveleges error, so the query server is
looking for another user identifier other than just query admin / password?
Could you modify your script to output whole error string from query so i
can see for sure?
-
19-01-2010, 16:28 #17
-= TeamSpeak Lover =-
- Join Date
- Apr 2007
- Location
- Germany
- Posts
- 98
Please post all configuration data you filled in BUT WITHOUT PASSWORD.
Maybe we can find any mistake...
-
19-01-2010, 16:36 #18
-= TeamSpeak User =-
- Join Date
- Jan 2010
- Location
- uk
- Posts
- 4
Theres the code with my config (password blanked) here is local query;PHP Code:<?php
// IP-Adress of the TS3-Server (NOT localhost or 127.0.0.1)
$ip = '208.111.39.189';
// query-port of the TS3-Server (default: 10011)
$t_port = '10011';
// ID of the virtual server
$sid = '4';
// Login-name for query
$Login_Name = 'admin';
// password for query-user
$Login_pwd = 'xxxxxx';
// ID of the group tokens will be displayed from
$Group_id = '16';
// Message if there are no tokens available
$NoTokens = 'No tokens available, please contact your serveradministrator!';
// Generate a Token if there is none (0=No, display message instead | 1=Yes
$GenerateToken = false;
// Here you can enter Text to be displayed before and after each token
// (e.g. before="<li>" and after = "</li>" to display Tokens in an unordered list)
$TextBefore = '';
$TextAfter = '<br /><br />';
// Here you are able to activate the debug-mode (true / false)
$debug = true;
// Don't change anything from here on (Except you know what you are doing)!
$error = array();
$FMToken = array();
function sendCmd($fp, $cmd){
$msg = '';
fputs($fp, $cmd);
while(strpos($msg, 'msg=') === false){
$msg .= fread($fp, 8096);
}
if(!strpos($msg, 'msg=ok')){
return false;
}else{
return $msg;
}
}
function readToken ($fp){
global $Group_id;
global $NoTokens;
$FMToken[0] = $NoTokens;
$cmd="tokenlist\n";
$i=0;
if(!($tokens = sendCmd($fp, $cmd))){
$error[] = 'no tokens availible';
}else{
$zeichen = explode('|',$tokens);
foreach ($zeichen as &$token) {
$token = explode(' ',$token);
if ($token[2]=='token_id1='.$Group_id){
$ausgabe = explode('=',$token[0]);
$FMToken[$i] = stripcslashes($ausgabe[1]);
$i++;
}
}
}
return $FMToken;
}
function makeToken ($fp){
global $Group_id;
$cmd="tokenadd tokentype=0 tokenid1=".$Group_id." tokenid2=0\n";
$newToken=sendCmd($fp, $cmd);
return $newToken;
}
error_reporting(E_ALL);
If ($ip === "127.0.0.1" || $ip === "localhost") {
$error[] = 'Connection failed! Use your external IP, <b>NOT</b> "localhost" or "127.0.0.1"!';
} else {
$fp = @fsockopen($ip, $t_port, $errno, $errstr, 2);
if($fp){
$cmd = "use sid=".$sid."\n";
if(!($select = sendCmd($fp, $cmd))){
echo ("Auf Server 1 geschaltet");
$error[] = 'Wrong Server ID';
}
$cmd="login $Login_Name $Login_pwd\n";
if(!($sinfo = sendCmd($fp, $cmd))){
$error[] = 'Login Denied';
}
$FMToken = readToken($fp);
if ($FMToken[0] === $NoTokens){
if ($GenerateToken){
$NewToken = makeToken($fp);
$FMToken = readToken($fp);
}
}
}else{
$error[] = 'Can not connect to the server';
}
}
// here is the loop for the output. Add HTML-Code if you want a nice result
// Hier ist die Schleife für die Ausgabe. Fürge HTML-code hinzu, wenn du eine schönere Ausgabe wünscht.
If ($debug) {
echo "<b>Debug Mode activated!</b><br>The following errors where thrown:<br><font color='red'>";
foreach ($error as $aerror){
echo $aerror."<br>";
}
echo "</font><br><br>";
} else {
foreach ($FMToken as $AToken){
echo $TextBefore.($AToken).$TextAfter;
}
}
?>
login admin xxxxx
use sid=4
tokenlist
Ouput:
error id=0 msg=ok (5 ms)
error id=0 msg=ok (270 ms)
token=xxxxxxxxxxxx
Remote output says insufficient client priveleges, is it wanting query commands from ip i registered the query password with? hence the code
failing also?Last edited by MIKEYK255; 19-01-2010 at 17:01.
-
19-01-2010, 17:48 #19
-= TeamSpeak Lover =-
- Join Date
- Apr 2007
- Location
- Germany
- Posts
- 98
Replace line 110:
withCode:$error[] = 'Can not connect to the server';
It should post the exact error now... If it doesn't, search for line 87 and remove the "@" in front of the "@fsockopen"-part. Then post your results here pls.Code:$error[] = 'Can not connect to the server. ' . $errstr . '(' . $errno . ')';
-
19-01-2010, 19:45 #20
-= TeamSpeak User =-
- Join Date
- Jan 2010
- Location
- uk
- Posts
- 4
Debug Mode activated!
The following errors where thrown:
Can not connect to the server. Connection timed out(110)
----
So i went back to query, if i telnet to my server 208.111.39.189 on 10011
this is what i get locally:-
However asking someone else to telnet with the same details from remoteCode:TS3 use sid=4 error id=0 msg=ok login client_login_name=admin client_login_password=xxxxxx error id=0 msg=ok tokenlist token=wZoBGCTaLR3.......
machine they get:-
So.. query password seems to work from local address only, to test this i made some1 else on my server sa and asked them to create their own query login then retry telnet, it works then.Code:TS3 use sid=4 error id=0 msg=ok login client_login_name=admin client_login_password=xxxxxx error id=0 msg=ok tokenlist error id=2568 msg=insufficient\sclient\spermissions failed_permid=8741
So im thinking i need to make a new ts account for the script itself and make it sa, once it has this should be able to execute remotely?
One thing though.. why am i getting timeout error, should be getting "error id=2568 msg=insufficient...."
-
28-01-2010, 10:01 #21
-= TeamSpeak Lover =-
- Join Date
- Jan 2010
- Location
- Duesseldorf, Germany
- Posts
- 33
@MIKEYK255: Many thanks for improving my script. I'm not a native english-speaker, therefore some mistakes inside. I'm not so very familliar with PHP.
@Lil-rich: Try to use the "serveradmin" generated by the server at the first start. If this works we know that the user you are using don't has the privilegs required.
I have another Question: Which forum-System you are using? I'm trying to integrate the script in my WBB 3.0-Bord by using a PHP-Class and a template and not simply including the PHP-script. Perhaps we can work together.
-
28-01-2010, 20:56 #22
-= TeamSpeak Lover =-
- Join Date
- Apr 2007
- Location
- Germany
- Posts
- 98
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Linux server startup script!
By mancert in forum Linux / FreeBSDReplies: 159Last Post: 24-09-2011, 16:51 -
New Teamspeak Query script for php: Teamspeak Display
By MrGuide@NL in forum [TeamSpeak 2] Addons & ScriptsReplies: 347Last Post: 06-08-2010, 17:17 -
Create token by php script and mysql
By Wikibear in forum Permission SystemReplies: 6Last Post: 28-12-2009, 19:31 -
[BUG-Feedback] About Token
By Blutgerinsel in forum Server SupportReplies: 0Last Post: 26-12-2009, 14:28 -
Bug? Token System
By Gubi1990 in forum Bug ReportsReplies: 4Last Post: 21-12-2009, 22:36


Reply With Quote
