These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

[EVEOTS] Eve Online Teamspeak 3 API Registration with PHP5 v1.8

First post
Author
MJ Maverick
Hybrid Industrial
#21 - 2011-10-01 14:45:04 UTC  |  Edited by: MJ Maverick
@Laxen that isn't natively supported. However, find all instances of

Quote:
if ($c->spacer !== "") {
$nickname = $corpTicker." ".$c->spacer." ".$character;
} else {
$nickname = $corpTicker." ".$character;
}

and add [ and ] around the ticker variables like this:
Quote:
if ($c->spacer !== "") {
$nickname = "[".$corpTicker."] ".$c->spacer." ".$character;
} else {
$nickname = "[".$corpTicker."] ".$character;
}


@king curt it should take those names fine and does on my TS, did one yesterday. What version are you running, what is his name and what was the exact error?
king curt
Deep Core Mining Inc.
Caldari State
#22 - 2011-10-02 23:52:28 UTC
Running the current version.

His name is Assassins' Blades. I cannot remember the error specifically other than it would not allow him to use his name and showed as Assassins\' Blades.

I will try to get more info.
Morgenholt Blue
Gallente Federation
#23 - 2011-10-03 02:22:18 UTC
king curt wrote:
Running the current version.

His name is Assassins' Blades. I cannot remember the error specifically other than it would not allow him to use his name and showed as Assassins\' Blades.

I will try to get more info.


I remember having this problem when I started using EVEOTS awhile ago. Looking at the latest version I think the fix would be to change
$inputName = trim($_POST["inputName"]);
to
$inputName = trim(stripslashes($_POST["inputName"]));

But I don't remember exactly so that might of been for something else.
MJ Maverick
Hybrid Industrial
#24 - 2011-10-03 18:55:17 UTC  |  Edited by: MJ Maverick
If you strip slashes the SQL query will break and registration will go FUBAR. If it does work then they won't be in the database and so won't be checked to see if they have left the alliance. Which is bad.

Don't strip slashes. It also opens you up to SQL injections. (hacking)

Also line 118: $inputName = trim($_POST["inputName"]); Hasn't had slashes added anyway. inputName doesn't get slashed, it is only used to get the CharacterID which is used to get the exact (case sensitive) characters name. The exact characters name is what is slashed.


Best bet, get him to try again and tell me exactly what the Step 2 page says (all of it) and what the error on Step 3 is. The slash itself shouldn't be a problem tbh, I just forgot to hide it in the error message to save people getting confused.
snipereagle1
Players vs. EVE
Goonswarm Federation
#25 - 2011-10-04 03:47:05 UTC
A nice feature to have on the page once people are registered is a link to connect them to TS with the correct login information, that would fill the server info, correct username, etc.

I think this is mostly right, but I get errors when I use this code:

echo "a href='http://www.teamspeak.com/invite/"$c->tshost."/?port="$c->tscport."&addbookmark=NUKKA-V2&nickname=".$nickname."Connect /a"; (I had to take out the < > symbols because the forums won't let you post HTML)

I specifically get:

Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in C:\xampp\htdocs\tsreg\index.php on line 256

I'm looking for a link that would look like this:

http://www.teamspeak.com/invite/*SERVERADDRESS*/?port=*SERVERPORT*&addbookmark=NUKKA-V2&nickname=*YOURNICKNAME*
Jimmy06
Global Telstar Federation Offices
SLYCE Pirates
#26 - 2011-10-04 11:45:40 UTC
hey MJ and thanks for the brilliant script. Are you looknig at updating this to comply with EVE APIv2 ? if so and you want some testers give me a shout. Thanks :)
Jimmy06
Global Telstar Federation Offices
SLYCE Pirates
#27 - 2011-10-04 12:21:54 UTC
snipereagle1 wrote:
A nice feature to have on the page once people are registered is a link to connect them to TS with the correct login information, that would fill the server info, correct username, etc.

I think this is mostly right, but I get errors when I use this code:

echo "a href='http://www.teamspeak.com/invite/"$c->tshost."/?port="$c->tscport."&addbookmark=NUKKA-V2&nickname=".$nickname."Connect /a"; (I had to take out the < > symbols because the forums won't let you post HTML)

I specifically get:

Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in C:\xampp\htdocs\tsreg\index.php on line 256

I'm looking for a link that would look like this:

http://www.teamspeak.com/invite/*SERVERADDRESS*/?port=*SERVERPORT*&addbookmark=NUKKA-V2&nickname=*YOURNICKNAME*


Change line 323 of index.php to http://pastebin.com/i7MNc6sU and Enjoy :)
snipereagle1
Players vs. EVE
Goonswarm Federation
#28 - 2011-10-04 15:32:08 UTC
Jimmy06 wrote:
snipereagle1 wrote:
A nice feature to have on the page once people are registered is a link to connect them to TS with the correct login information, that would fill the server info, correct username, etc.

I think this is mostly right, but I get errors when I use this code:

echo "a href='http://www.teamspeak.com/invite/"$c->tshost."/?port="$c->tscport."&addbookmark=NUKKA-V2&nickname=".$nickname."Connect /a"; (I had to take out the < > symbols because the forums won't let you post HTML)

I specifically get:

Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in C:\xampp\htdocs\tsreg\index.php on line 256

I'm looking for a link that would look like this:

http://www.teamspeak.com/invite/*SERVERADDRESS*/?port=*SERVERPORT*&addbookmark=NUKKA-V2&nickname=*YOURNICKNAME*


Change line 323 of index.php to http://pastebin.com/i7MNc6sU and Enjoy :)


Excellent! Also, I'd be happy to help test a version using the new API system (although I believe the PHEAL library needs to be updated before MJ can implement it, as that does the legwork with regards to the API)
MJ Maverick
Hybrid Industrial
#29 - 2011-10-04 15:51:08 UTC
That quick connect link is already in the next version :) it's been tested on Sev3rance's and seems to work fine.

I suppose this API is APIv3 :P but yeah I will be reworking it all. I currently have no internet access at home which makes things pretty difficult :/

I'll be back online on the 7th October.
Fred Eto
The Eloria Corporation
#30 - 2011-10-04 23:42:10 UTC
I am getting a bug, it is saying that "You are not allowed to register on this server." but I've made sure that the public $ourname = "XXX"; is correct, where XXX is my main's corporation. Am I missing something? Anything else that can be causing this bug?


/Fred
snipereagle1
Players vs. EVE
Goonswarm Federation
#31 - 2011-10-05 00:21:43 UTC
Fred Eto wrote:
I am getting a bug, it is saying that "You are not allowed to register on this server." but I've made sure that the public $ourname = "XXX"; is correct, where XXX is my main's corporation. Am I missing something? Anything else that can be causing this bug?


/Fred


You'll get more details if you go in to the config file and enable dev / verbose (I don't remember the exact verbage) mode, it will give you a more detailed error message. Once you get that, post it here and we'll help you out!
Fred Eto
The Eloria Corporation
#32 - 2011-10-05 00:32:49 UTC  |  Edited by: Fred Eto
snipereagle1 wrote:
Fred Eto wrote:
I am getting a bug, it is saying that "You are not allowed to register on this server." but I've made sure that the public $ourname = "XXX"; is correct, where XXX is my main's corporation. Am I missing something? Anything else that can be causing this bug?


/Fred


You'll get more details if you go in to the config file and enable dev / verbose (I don't remember the exact verbage) mode, it will give you a more detailed error message. Once you get that, post it here and we'll help you out!


I have, and all I get is the above still:


Checking...
Character: Character1
Debug: User ID: XXX
Debug: API Key: XXX

Debug: Character ID: XXXXX

Debug: Character List:
Debug: XXX
Debug: Character1

Debug: API verified.

You are not allowed to register on this server.
Morgenholt Blue
Gallente Federation
#33 - 2011-10-05 06:46:17 UTC
MJ Maverick wrote:
If you strip slashes the SQL query will break and registration will go FUBAR. If it does work then they won't be in the database and so won't be checked to see if they have left the alliance. Which is bad.

Don't strip slashes. It also opens you up to SQL injections. (hacking)

Also line 118: $inputName = trim($_POST["inputName"]); Hasn't had slashes added anyway. inputName doesn't get slashed, it is only used to get the CharacterID which is used to get the exact (case sensitive) characters name. The exact characters name is what is slashed.


Best bet, get him to try again and tell me exactly what the Step 2 page says (all of it) and what the error on Step 3 is. The slash itself shouldn't be a problem tbh, I just forgot to hide it in the error message to save people getting confused.


This behavior is caused by PHP magic quotes which you will find the majority of shared hosts have switched on. It automatically add's a \ before any ' which is what is breaking EVEOTS for a large amount of people and we aren't directly using the inputName var in any SQL queries.
MJ Maverick
Hybrid Industrial
#34 - 2011-10-05 15:21:07 UTC  |  Edited by: MJ Maverick
Fred Eto wrote:


I have, and all I get is the above still:


Checking...
Character: Character1
Debug: User ID: XXX
Debug: API Key: XXX

Debug: Character ID: XXXXX

Debug: Character List:
Debug: XXX
Debug: Character1

Debug: API verified.

You are not allowed to register on this server.


Hey Fred, if you are running version 1.5 then the white list isn't in the config.php. That just tells the system who your guys are. You need to make a white list in .../eveots/admin. Take a look at the readme.html if you get stuck setting up a root admin.

@Morgenholt, cheers for looking into that, when I find out where they are breaking it I'll see if stripslashes gets it working... Pesky hosts and their silly settings!
Fred Eto
The Eloria Corporation
#35 - 2011-10-05 15:27:18 UTC
MJ Maverick wrote:
Fred Eto wrote:


I have, and all I get is the above still:


Checking...
Character: Character1
Debug: User ID: XXX
Debug: API Key: XXX

Debug: Character ID: XXXXX

Debug: Character List:
Debug: XXX
Debug: Character1

Debug: API verified.

You are not allowed to register on this server.


Hey Fred, if you are running version 1.5 then the white list isn't in the config.php. That just tells the system who your guys are. You need to make a white list in .../eveots/admin. Take a look at the readme.html if you get stuck setting up a root admin.

@Morgenholt, cheers for looking into that, when I find out where they are breaking it I'll see if stripslashes gets it working... Pesky hosts and their silly settings!


Fixed it, gracias =)
Jimmy06
Global Telstar Federation Offices
SLYCE Pirates
#36 - 2011-10-11 19:56:29 UTC
MJ Maverick wrote:
That quick connect link is already in the next version :) it's been tested on Sev3rance's and seems to work fine.

I suppose this API is APIv3 :P but yeah I will be reworking it all. I currently have no internet access at home which makes things pretty difficult :/

I'll be back online on the 7th October.


Sorry MJ lol didnt realise you had released the quick link does it even look like mine ? lol.

Also if you need any testing done with APIv3 send some code my way :)
MJ Maverick
Hybrid Industrial
#37 - 2011-10-12 15:55:50 UTC
Update v1.7
YOU MUST DELETE ALL REGISTRATIONS FROM TEAMSPEAK MANUALLY if upgrading. See readme "Customizable key upgrade"!
Implemented new customizable API keys! Yay :D (Run "customizable keys update.sql").
Stage 2 of registration now provides a link that will connect you to TS and bookmark it. Idiot proof! Right?
Added the "Audit Members" to the admin panel that was left out of v1.5.
Made more compatible with PHP 5.3, depreciated functions have been updated.
Added more security to the admin panel.
Lots of files tweaked.


lol I just saw your post as I went to edit this thread Jimmy.

Thank you all for the support so far it really is appreciated. It really lets me know all this work is doing some good and makes me want to improve it.
snipereagle1
Players vs. EVE
Goonswarm Federation
#38 - 2011-10-13 23:31:34 UTC  |  Edited by: snipereagle1
Using version 1.7, I get the following error when adding an alliance to the whitelist:
"An error occured: API Date could not be read / parsed, original exception: Operation timed out after 10000 milliseconds with 682998 bytes received"

Corporations add just fine...
king curt
Deep Core Mining Inc.
Caldari State
#39 - 2011-10-14 15:04:18 UTC
Hey MJ,

Quick question for you. You've probably done it and I am just to Roll to figure it out.

Is there a way to, once the whitelist has been set up for "blues", to assign them to the proper group after they have registered?

The way I see it right now is there are only two possibilities. Either they are in your "alliance/corp" or they are "blue list".

Quote:
// Teamspeak 3 group for alliance/corp members
public $group = ;
// Teamspeak 3 group for people on the whitelist but not in your alliance/corp
public $bluegroup = ;
snipereagle1
Players vs. EVE
Goonswarm Federation
#40 - 2011-10-14 16:28:34 UTC
king curt wrote:
Hey MJ,

Quick question for you. You've probably done it and I am just to Roll to figure it out.

Is there a way to, once the whitelist has been set up for "blues", to assign them to the proper group after they have registered?

The way I see it right now is there are only two possibilities. Either they are in your "alliance/corp" or they are "blue list".

Quote:
// Teamspeak 3 group for alliance/corp members
public $group = ;
// Teamspeak 3 group for people on the whitelist but not in your alliance/corp
public $bluegroup = ;

Are you askin whether you can give blues and corp the same group?