Well after looking into this issue I find that My web server does not allow connection to its database from outside locations. These means my Seperate TeamSpeak server can not authenticate off of my webs Database.
So a teamspeak module will not work for me at this time, but I have come up with an idea that may work in my situation if somebody is willing to help me with the coding that is. I am wanting to modify the login script for community builder so that each time a user logs in to community builder it checks the TS server to see if the account exists. if it does then die with no error. If not creates the username and password in the DB of my TS server. I can handle manual removal of accounts when necessary. I just do not want my users to have to register twice and dont want to ask the user for there password either to do it for them. Confusing? I have added below the logical flow chart that may explain better as well as a php that I am currently using to allow the users register with. I am assuming part of the code from it would be used in the submit form of the login script.
Flow Chart
User logins in with username and password
|
|
Is username and pw correct for cb? - No - give error
|
|
log on to cb as normal
|
|
query TS DB for account -- exist -- die no error
|
|
does not exist
|
|
add username and password to DB
_________________________________________________
Current PHP used for TS registration
<?php
//my serverdata here:
$server = "127.0.0.1"; // this is my servers IP $queryport = 51234; // this is the TCP-queryport,
$udpport = 8767; // this is the UDPport of Teamspeakserver
$superadmin = 0; // 1 for superadminlogin, 0 for serveradmin login
$loginname = "admin";
$loginpass = "mysecretpassword";
if($fp = @fsockopen($server, $queryport, $errno, $errstr, 3)) {
$data = fread($fp,128);
#echo $data;
$ts = $data;
if(ereg("[TS]", $data)){
fputs($fp, "sel ".$udpport."\n");
$data = fread($fp,128);
#echo $data;
if(ereg("^OK", $data)){
if ($superadmin == 1) {
$login = "slogin ";
}
else {
$login= "login ";
}
fputs($fp, $login.$loginname." ".$loginpass."\n");
$data = fread($fp,128);
#echo $data;
if(ereg("^OK", $data)){
fputs($fp, "dbuseradd ".addslashes($_REQUEST)." ".addslashes($_REQUEST)." ".addslashes($_REQUEST)." 0\n");
#echo "Username: ".$_REQUEST."<br>";
#echo "Password: ".$_REQUEST."<br>";
$data = fread($fp,128);
#echo $data;
if(ereg("^OK", $data)){
fputs($fp, "rehash\n");
echo "User ".addslashes($_REQUEST)." added successfully!";
}
else {
echo "Something went wrong! Perhaps the user already exists?";
}
}
else {
echo "Login incorrect!";
}
}
else {
echo "Server with Port $udpport does not exist!";
}
}
else {
echo "This is not a TS Server or your IP got banned!";
}
fclose($fp);
}
else {
echo "Could not establish connection! Please check your settings!";
}
?>
Any help with this would be so very much appreciated. If nothing else the name of the file I will need to modify to get this to work.
Thank you,
Rubik Storm