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.
123Next pageLast page
 

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

First post
Author
MJ Maverick
Hybrid Industrial
#1 - 2011-09-09 22:38:03 UTC  |  Edited by: MJ Maverick
Please "Like" this post if you use EVEOTS. :)
CCP: EVEOTS now supports customizable keys.

Any kind donations to keep me going are very appreciated.Big smile

[Archive]
Version: 1.8

Intro:
So there I was, using a Teamspeak registration system that once worked well but is now outdated and falling to pieces :( (♥ u really Agent Unknown :) ). I saw that people had made their own but wanted outrageous amounts of ISK in order to share it. So, meh. I'll make my own simple, fast, easy to mod and adaptable system. Only one problem, I know jack about PHP. I only knew what little I learnt from building my alliance a nice new website.

So I learnt PHP :) Then built my baby piece by piece. Now you can have it. Call it my little gesture to share a little love in Eve. I plan to add more features such as red alt scanning etc. while keeping it fast in the future along with keeping up to date with the ever changing Teamspeak development. Also as I am/was/ish a sort of PHP noob, you should find my heavily commented code easy to understand.

Preview:
Sev3rance Alliance

Requirements:
PHP 5.2.1 or later
MySQL 5 or later (untested on earlier versions)
Dedicated web host

Down to business:
By downloading you agree to leave the credit at the bottom of the page and not sell or redistribute without my permission. Let's play fair, credit where credits due...
Download - Sev3rance Alliance (MJ Maverick)

Baring in mind how much ISK people want for a system like this, if you are using it, it would be awesome to let me know and maybe even donate :) (all this work leaves little time for ISKies *sadface*). If you run into any problems then either use this thread or mail me in game and I'll be happy to help.

Any kind donations can be sent to "MJ Maverick". :)

Special Thanks To:
Peter Powers from Pheal
Wollari from DOTLAN
ScP from Teamspeak
The Sev3rance Alliance for being my guinea pigs

CCP API Server OK?
MJ Maverick
Hybrid Industrial
#2 - 2011-09-09 22:38:22 UTC  |  Edited by: MJ Maverick
Features/Updates:
=== v1.0 ===
Very fast cron job for quickly scanning if characters registered have left their corp/alliance and removes them.
Alliance whitelist.
Corporation whitelist.
Assign your own boys/girls into a separate group than your blues.
Supports character names containing an '.
If a blue joins your alliance, it realises and asks them to re-register so they can be moved into the correct group.
Error messages will even inform the user of who to contact (presumably, you).
Limited API entry form is limited to 64 characters (the length of an API Key) to help prevent pasting a space after the key.
Does not require | between tickers (no more horrible phonetic announcements).
Shoo's away doorstep salesmen.
API interface powered by Pheal.
Teamspeak interface powered by TS3 PHP Framework.
=== v1.1 ===
Detects if a spy is using some ones API when they register.
If someone has lost their Teamspeak ID it will ask then to make a new API to verify them, then delete their old registrations.
Instructions page added for people trying to register on 2 computers.
Prevents any duplications on TS and in the database.
=== v1.15 ===
Enhanced script security.
=== v1.17 ===
For this update you will need to overwrite config.php and fill it in again. Sorry, it's for the best. :)
cron.php will now know if it's being run via CPanel and format e-mails correctly.
Made readme.html into your EVEOTS bible for when I'm not around.
=== v1.2 ===
Security bot now optional to make sure people have the correct name.
General code tweaks made.
Readme updated.
===v1.3 ===
General code clean up.
Handles even more errors properly.
Added staged registration as requested (Yay).
Added compatibility for optional ticker separators as requested.
=== v1.31 ===
Character names over 30 characters this will no longer cause Teamspeak problems.
=== v1.5 ===
Admin panel added. yay :D
All admin actions are logged.
Security level allows you to have admins and just whitelist operators.
Admin lists stream the admins current corp/alliance.
Cron job updates whitelist member counts.
Change password.
Admins can edit admin accounts easily.
Whitelist is now totally databased.
Cron.php in /admin/ added to optionally update whitelist member counts.
=== v1.7 ===
YOU MUST DELETE ALL REGISTRATIONS FROM TEAMSPEAK MANUALLY if updating. 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.
=== v1.7b ===
Fixed some silly bugs, thanks to TS5P for allowing me to mess with his server.
=== v1.8 ===
Added a java popup that sheds some light on how to setup your key. (?)
You can now safely remove peoples access manually from the admin panel.
Encoded the nickname in the "auto-connect" link to work more universally and fixed a typo.
Vastly reduced errors caused by blues joining your corp/alliance.
Fixed some admin panel bugs.
Forced Pheal to ignore SSL verification by default, it was causing too many problems for people.
Search function added to Audit Members.
Teamspeak 3 Library updated (bug fixes, especially for people with a / in their Unique ID).
Fixed a problem deleting old registrations when registering that would cause errors and redundant records.
Now compatible with PHP versions >5.4.
bot.php now makes an exception for people that have a "1" on the end of their name because they momentarily lost connection.
Password option for auto-connect.
Better exception handling in cron.php.
Discrepancies! A very powerful, lightweight and useful tool to eliminate redundant entries.
Colossal amount of general TLC and bug fixing.
Balani
Science and Trade Institute
Caldari State
#3 - 2011-09-09 23:06:14 UTC
i get some error if I call the bot.php

cron.php works fine

Processing: Balani

Notice: Use of undefined constant client_nickname - assumed 'client_nickname' in /httpdocs/eveots/bot.php on line 50
Processing: Balani

Notice: Use of undefined constant client_nickname - assumed 'client_nickname' in /httpdocs/eveots/bot.php on line 50

Notice: Use of undefined constant client_nickname - assumed 'client_nickname' in /httpdocs/eveots/bot.php on line 53

Notice: Use of undefined constant client_nickname - assumed 'client_nickname' in /httpdocs/eveots/bot.php on line 53
Kicked user Balani, their name was Balani from *.*.46.14:37931



Maverick can you take a look
MJ Maverick
Hybrid Industrial
#4 - 2011-09-09 23:19:06 UTC  |  Edited by: MJ Maverick
Odd, what version of PHP are you running and is it running in strict?

Go to line 50 and try changing $client[client_nickname] from
Quote:
$client[client_nickname]

to
Quote:
$client['client_nickname']


It should be the latter. They will still work but if you have PHP running in schizophrenia mode (strict) it will think that they could be constants. I'll upload fixes for these as people report them as they are just an oversight.
Balani
Science and Trade Institute
Caldari State
#5 - 2011-09-10 02:31:56 UTC
Ok they runs all without error msg now BUT

TS MSG "Balani from *.*.46.14:57924" hat Sie vom Server gekickt (SecurityBot: Your nickname should be exactly Balani)

debug from script


server is empty NO CONNECTIONS

Processing: Balani
Debug: User Balani could not be kicked. Probably wasn't connected in the first place. (Error: invalid client type)
1 users checked, 0 users kicked.


Iám on Server (MAYBE) SA ^^

Processing: Balani
Processing: Balani
Kicked user Balani, their name was Balani from *.*.46.14:57974
2 users checked, 1 users kicked.

first user checked double?




MJ Maverick
Hybrid Industrial
#6 - 2011-09-10 18:54:48 UTC  |  Edited by: MJ Maverick
Balani = You
Balani from *.*.*.* = The ServerQuery user that you made, hence your name. The IP is the web servers that is using your ServerQuery login.

Are you registered in the database? The root admin should not be registered. If something went horrifically wrong and all the registrations got removed you will lose admin on your own server if you are registered. This is highly unadvised.

Another reason not to be registered is that depending on how Teamspeak works this, it could count you AND your ServerQuery as you, obviously the ServerQuery will always have the wrong name because of the IP. So will try to kick itself, but it can't because it isn't a connected client, but it may kick you.


I haven't gone into in-depth testing with this as I always advise root admins not to go through the registration system. They can always assign any pretty colours or groups to themselves manually. It's just too risky to register yourself as I said, especially if you are modding my code. One wrong bit of code could result in disaster.
Balani
Science and Trade Institute
Caldari State
#7 - 2011-09-10 20:43:23 UTC
Ok thx

the problem was that i register myself via the api ^^ removed now and runs fine


the second thing is that i run the ts and eveots on the same server but why it checks my name twice

the serverquerry name is NOT Balani ^^


Skipping user, not registered (Balani)
Skipping user, not registered (Balani from *.*.46.14:49415) why it checks my name double?
MJ Maverick
Hybrid Industrial
#8 - 2011-09-11 02:21:53 UTC  |  Edited by: MJ Maverick
Like I said, it doesn't matter what the ServerQuery username is. YOU made it, so it counts as YOU controlling the Teamspeak from a remote IP.

So basically:

Balani's ServerQuery account being used from IP 123.123.123.12 kicks you from the server.

The reason it is seen in bot.php is because the ServerQuery is making a connection and the bot.php checks all client connections, even remote ones.
Morgenholt Blue
Swift Redemption.
#9 - 2011-09-11 16:30:33 UTC
To stop remote ones being checked in bot.php you can make a small addition.

Below:
foreach ($clientList as $client) {

Add the following:
if($client["client_type"]) continue;

and the script won't check serverquery clients anymore.
MJ Maverick
Hybrid Industrial
#10 - 2011-09-11 18:29:07 UTC
Well spotted. I never picked that up when reading the outputs :)
LoneEcho
Mining and Salvage Corporation
#11 - 2011-09-13 17:55:37 UTC
Okay so I've tried everything I could to get this to work.

I get "An error occured: Connection timed out [F10]" when I click register.

TS3 and my webhost are on different servers. I have my webhost setup with mysql and my TS3 connects to that database just fine. I've added my webhost IP in the whitelist of the serverquery. I've checked the ports on my TS3 server and it's open.

Everything is able to connect but I can't get it to register.

Do any ports on my webhost need to be open other than mysql which already open?

Thanks in advance.

LoneEcho
MJ Maverick
Hybrid Industrial
#12 - 2011-09-13 19:35:48 UTC  |  Edited by: MJ Maverick
There aren't any port requirements on the web server because it's all outgoing.

However this is the most common problem people run into and 9 times out of 10 it's that there is something wrong with your config.php details.

I know you've done some of these but I'm listing all that I can think of off the top of my head for anyone else that get's this very common problem.

There are a few things you can check:

  1. Make sure your web servers IP is on the TS3's whitelist.txt and reboot the TS3 server.
  2. Double and treble check that your details are exactly correct with no spaces either side in config.php (always copy/paste).
  3. If all your details are absolutely certainly correct ask your TS3 provider if they have changed the ServerQuery port from the default.
  4. Try recreating a new ServerQuery login and make sure the person who makes it has FULL admin in TS.
  5. Failing that you need to contact your web host as to why you can't make outgoing connections. Some web hosts have been the cause of this because they won't allow outgoing connections. Tell them what you are trying to do and ask them to make sure your server can do it.
Duc Lebowski
Republic Military School
Minmatar Republic
#13 - 2011-09-14 00:18:07 UTC
from shared web hosts be sure to ensure they open the server query port if your TS is not on the same as the script as i had to unblock this port to get this working then it worked like a charm

Duc
LoneEcho
Mining and Salvage Corporation
#14 - 2011-09-14 03:07:43 UTC  |  Edited by: LoneEcho
MJ Maverick wrote:
There aren't any port requirements on the web server because it's all outgoing.

However this is the most common problem people run into and 9 times out of 10 it's that there is something wrong with your config.php details.

I know you've done some of these but I'm listing all that I can think of off the top of my head for anyone else that get's this very common problem.

There are a few things you can check:

  1. Make sure your web servers IP is on the TS3's whitelist.txt and reboot the TS3 server.
  2. Double and treble check that your details are exactly correct with no spaces either side in config.php (always copy/paste).
  3. If all your details are absolutely certainly correct ask your TS3 provider if they have changed the ServerQuery port from the default.
  4. Try recreating a new ServerQuery login and make sure the person who makes it has FULL admin in TS.
  5. Failing that you need to contact your web host as to why you can't make outgoing connections. Some web hosts have been the cause of this because they won't allow outgoing connections. Tell them what you are trying to do and ask them to make sure your server can do it.


The first two I'm sure are correct. I run the TS3 on my VPS and left the ports as defaults. I also have the full admin query pw from when I first started the TS3 up. I can connect to it using third party apps on my PC and Ipad.

I wrote a message to my shared webhost if they can allow 10011 TCP. Let me see if that helps.

Duc Lebowski wrote:
from shared web hosts be sure to ensure they open the server query port if your TS is not on the same as the script as i had to unblock this port to get this working then it worked like a charm

Duc


Thanks for the tip. I just sent them a message. Let's hope for the best! =P

I'm sure it's got to be my webhost as I installed mysql on my linux VPS using commands and it was running and everything was connected but my webhost would still not connect to my TS3. So something is probably blocking it from communicating outside.

But I decided mysql was taking up quite a bit of resource on my VPS so removed it xD. TS3 is now using mysql from my webhost which seems to be fine.


UPDATE:

So opening the server query port fixed my problem. Thanks a lot for the help guys! =)
MJ Maverick
Hybrid Industrial
#15 - 2011-09-15 02:05:12 UTC
Remember to "Like" the OP if you are using EVEOTS :)
Hired Assasin
State Protectorate
Caldari State
#16 - 2011-09-20 08:44:48 UTC
Hey, was just wondering if this has been updated for the new API system.

also i had to modify some code to make it accept more different corps/alliances into extra specific/separate groups

would you be able to add that feature too? im sure others might want or need it.

Teamspeak 3 with API and Web Interface Hosting with Member Rewards!! : http://alturl.com/asde8 Catch me on EVE Gate, im allmost always on it!

Trampis
Orbital Systems Solutions
#17 - 2011-09-20 17:06:20 UTC
Hired Assasin wrote:
Hey, was just wondering if this has been updated for the new API system.

also i had to modify some code to make it accept more different corps/alliances into extra specific/separate groups

would you be able to add that feature too? im sure others might want or need it.


I'll be happy to see the new API implementation as well and I would appreciate this code mod - can you please post the changes you made for me and others to use.

Much obliged
MJ Maverick
Hybrid Industrial
#18 - 2011-09-21 02:27:31 UTC
Hey Assassin, that's on my to-do list before v2.0 but at the moment I'm still trying to wrap my head round the new API system while still keeping it as secure and stable as possible. But yes, I do intend on changing it over to the new API. :)
Laxen
Caldari Provisions
Caldari State
#19 - 2011-09-29 21:04:07 UTC

Hi !

1. I got the following erroare:

PHP Notice: Undefined index: HTTP_USER_AGENT in ..eveots/functions.php on line 149

What can correct not to defend?

2. How should I set here => public $ spacer = '';
So I can use the nickname in the form [ROMB] Laxen?

Sincerely,
king curt
Deep Core Mining Inc.
Caldari State
#20 - 2011-09-30 01:04:33 UTC
Hey MJ quick question for you.

I have a member that is trying to register and he has an ' in his name. The program doesn't seem to like it too much and when it tries to register it says:

xxxxxxxxxx\'

Any ideas on this?

Thanks,

curt
123Next pageLast page