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.
 

TEA (v1.3.1) - Member Management Mod for SMF 2, TeamSpeak 3 and Jabber

Author
Shin Chogan
Federal Navy Academy
Gallente Federation
#241 - 2014-03-22 13:31:39 UTC
Zenith Gravit wrote:
I got my dirty install mostly cleaned up, but the user's profile page still has some extra fields and I'm just not sure what needs to be removed to clean it up. The Status, Main Matched Rules, Characters, ID from API page, and Verification Code from API Page fields are all duplicated once. I'm just trying to figure out how to clean that up.

Screen shot ----> http://i.imgur.com/0nHoabh.png



Its supposed to be like that. There is always an unfilled section so you can add a 2nd or 3rd or xth api key.
Jen Moriarty
Republic University
Minmatar Republic
#242 - 2014-03-22 14:29:23 UTC
Is there a debug mode to run this code in? As I said, I'm experiencing a problem described here https://forums.eveonline.com/default.aspx?g=posts&m=3969052#post3969052 and I want to be able to debug it by putting some printing statements in the called functions and seeing their results.
Shin Chogan
Federal Navy Academy
Gallente Federation
#243 - 2014-03-22 14:36:29 UTC
Jen Moriarty wrote:
Is there a debug mode to run this code in? As I said, I'm experiencing a problem described here https://forums.eveonline.com/default.aspx?g=posts&m=3969052#post3969052 and I want to be able to debug it by putting some printing statements in the called functions and seeing their results.



Not really ... certainly not for that bit.

somewhere about line 118 in TEA_Jabber_OF.php there is the block :

$url = $this -> modSettings['tea_jabber_admin_url'].'/plugins/userService/userservice?type=add&secret='.$secret.'&username='.$uname.'&password='.$pw.'&name='.$name.'&email='.$email.'&groups='.$groups;
$url = str_replace(" ", "%20", $url);
$site = $this -> get_site($url);

adding in a

var_dump($url);
var_dump($site);

after that and before the "return;" (yes I know there is 2 of them and a block of code that never gets used ... Not me :) )

it might help you find out what is happening.
Jen Moriarty
Republic University
Minmatar Republic
#244 - 2014-03-22 14:46:07 UTC
Unfortunately no amount of printing there will show, as this page is not processed to be viewed. Is there a log where these would be written to?
Xornicon Altair
Black Watch Syndicate
#245 - 2014-03-22 15:07:51 UTC
I've just removed r2 from my server and I'm trying to install r5. Everything is okay until it gets to the actual install page and most of the files have an error next to them in big bold red letters that says "Modification parse error". I've tried proceeding anyways and it fails to install, but there are no other errors on the board.

I've downloaded the most recent package available from the first post in this thread.

SMF Version 2.0.6

This is the song....

Zenith Gravit
LionGate Enterprises
#246 - 2014-03-22 15:57:43 UTC
Shin Chogan wrote:
Zenith Gravit wrote:
I got my dirty install mostly cleaned up, but the user's profile page still has some extra fields and I'm just not sure what needs to be removed to clean it up. The Status, Main Matched Rules, Characters, ID from API page, and Verification Code from API Page fields are all duplicated once. I'm just trying to figure out how to clean that up.

Screen shot ----> http://i.imgur.com/0nHoabh.png



Its supposed to be like that. There is always an unfilled section so you can add a 2nd or 3rd or xth api key.


Thank you for the clarification. I guess I didn't remember that being there.


Also, I thought everything was working but I'm getting a PHP Parse error on the last line of ScheduledTasks.php, it's causing my mail queue to hang. I ran into this a week or so ago, it it was because there were duplicates of the TEA cron functions. I just deleted the dupes before and all seemed to be well after that. I tried to just remove the TEA cron functions this time to test if the error went away, but I still get it. During the install is another change made elsewhere in the ScheduledTasks.php. My Apache logs aren't giving much info.

Quote:
end of file in /var/www/smf/Sources/ScheduledTasks.php on line 1688, referer: http://myurl/index.php?action=admin;area=mailqueue;sa=browse;f0978340=2360096e95c503d28e74735f6282e85c
Xornicon Altair
Black Watch Syndicate
#247 - 2014-03-22 16:07:26 UTC
Xornicon Altair wrote:
I've just removed r2 from my server and I'm trying to install r5. Everything is okay until it gets to the actual install page and most of the files have an error next to them in big bold red letters that says "Modification parse error". I've tried proceeding anyways and it fails to install, but there are no other errors on the board.

I've downloaded the most recent package available from the first post in this thread.

SMF Version 2.0.6


Uploaded an image of what I'm talking about. This is what comes up when I'm trying to install the mod:

http://i.imgur.com/kQP5Vig.png

This is the song....

Jen Moriarty
Republic University
Minmatar Republic
#248 - 2014-03-22 18:06:30 UTC  |  Edited by: Jen Moriarty
So I have found the problem with the script.

Apparently, TEA decides to call the update_user function even when the Openfire user does not exist, resulting in UserNotFoundException, and the Openfire user not being created.

I think this is how the process played out:
I tried to register a new user
The user was written into the tea_jabber_users table, but for some reason was not written into Openfire.
From now on, every subsequent call to this user will call the update_user function (and get a silent exception). This is clearly a bug.

Is there a way to read back the result of accessing the Openfire URL? In case of such exception, an add_user call should be made
Shin Chogan
Federal Navy Academy
Gallente Federation
#249 - 2014-03-22 19:58:54 UTC  |  Edited by: Shin Chogan
Jen Moriarty wrote:
So I have found the problem with the script.

Apparently, TEA decides to call the update_user function even when the Openfire user does not exist, resulting in UserNotFoundException, and the Openfire user not being created.

I think this is how the process played out:
I tried to register a new user
The user was written into the tea_jabber_users table, but for some reason was not written into Openfire.
From now on, every subsequent call to this user will call the update_user function (and get a silent exception). This is clearly a bug.

Is there a way to read back the result of accessing the Openfire URL? In case of such exception, an add_user call should be made


Yes that is a known issue but is only a problem if something is wrong in the setup and the user doesn't get created in the first place or you allow your users to delete their accounts another way. As you say this is caused by the user not being created in the first place - you need to remove the entry from the jabber users table and then try and create the user again ... perhaps run a packet trace on the Openfire user service port and see what is going on.
Shin Chogan
Federal Navy Academy
Gallente Federation
#250 - 2014-03-22 20:02:03 UTC
Zenith Gravit wrote:
Shin Chogan wrote:
Zenith Gravit wrote:
I got my dirty install mostly cleaned up, but the user's profile page still has some extra fields and I'm just not sure what needs to be removed to clean it up. The Status, Main Matched Rules, Characters, ID from API page, and Verification Code from API Page fields are all duplicated once. I'm just trying to figure out how to clean that up.

Screen shot ----> http://i.imgur.com/0nHoabh.png



Its supposed to be like that. There is always an unfilled section so you can add a 2nd or 3rd or xth api key.


Thank you for the clarification. I guess I didn't remember that being there.


Also, I thought everything was working but I'm getting a PHP Parse error on the last line of ScheduledTasks.php, it's causing my mail queue to hang. I ran into this a week or so ago, it it was because there were duplicates of the TEA cron functions. I just deleted the dupes before and all seemed to be well after that. I tried to just remove the TEA cron functions this time to test if the error went away, but I still get it. During the install is another change made elsewhere in the ScheduledTasks.php. My Apache logs aren't giving much info.

Quote:
end of file in /var/www/smf/Sources/ScheduledTasks.php on line 1688, referer: http://myurl/index.php?action=admin;area=mailqueue;sa=browse;f0978340=2360096e95c503d28e74735f6282e85c



Nope just adds the stuff to the bottom of the ScheduledTasks.php though it does also add bits to the ManageScheduledTasks.english.php file
Shin Chogan
Federal Navy Academy
Gallente Federation
#251 - 2014-03-22 20:05:28 UTC
Xornicon Altair wrote:
Xornicon Altair wrote:
I've just removed r2 from my server and I'm trying to install r5. Everything is okay until it gets to the actual install page and most of the files have an error next to them in big bold red letters that says "Modification parse error". I've tried proceeding anyways and it fails to install, but there are no other errors on the board.

I've downloaded the most recent package available from the first post in this thread.

SMF Version 2.0.6


Uploaded an image of what I'm talking about. This is what comes up when I'm trying to install the mod:

http://i.imgur.com/kQP5Vig.png


I've not seen that one before but a quick Google turned up this :

Quote:

It is essentially a matter of your host, for whatever reason the files couldn't be accessed by the package manager once unpacked. Usually that means there's some kind of permission issue with the files.
Xornicon Altair
Black Watch Syndicate
#252 - 2014-03-22 20:39:42 UTC
Shin Chogan wrote:
Xornicon Altair wrote:
Xornicon Altair wrote:
I've just removed r2 from my server and I'm trying to install r5. Everything is okay until it gets to the actual install page and most of the files have an error next to them in big bold red letters that says "Modification parse error". I've tried proceeding anyways and it fails to install, but there are no other errors on the board.

I've downloaded the most recent package available from the first post in this thread.

SMF Version 2.0.6


Uploaded an image of what I'm talking about. This is what comes up when I'm trying to install the mod:

http://i.imgur.com/kQP5Vig.png


I've not seen that one before but a quick Google turned up this :

Quote:

It is essentially a matter of your host, for whatever reason the files couldn't be accessed by the package manager once unpacked. Usually that means there's some kind of permission issue with the files.


Solved it. For some reason, SMF couldn't parse the .tgz file that I downloaded from you link, so, I extracted it, re-compressed into a .zip and it went through without a problem.

This is the song....

Xornicon Altair
Black Watch Syndicate
#253 - 2014-03-22 21:14:58 UTC
Xornicon Altair wrote:
Solved it. For some reason, SMF couldn't parse the .tgz file that I downloaded from you link, so, I extracted it, re-compressed into a .zip and it went through without a problem.


Or... I thought I had.

The package manager says that it's installed, but there's no admin, or profile, option for it anywhere in the menus.

If anyone has any ideas, let me know. I need to go out, so, I can't troubleshoot this right now.

This is the song....

lasterax
Republic Military School
Minmatar Republic
#254 - 2014-03-23 00:01:19 UTC
lasterax wrote:
Migrated my forum to get on the same server as comms. Thins have gone well except for when running the API check, I get the following error:

Quote:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
File: /var/www/forums/Sources/TEA.php
Line: 2492


Checking the error log I also get the following:

8: Undefined property: TEA::$lastid


Something I missed doing the move?

--Rax


Any ideas on this one Shin? I've tried removing the mod and reinstalling and it doesn't seem to fix the trouble. Everything else appears to be working right so I'm stuck at what's causing the error.

--Rax
Shin Chogan
Federal Navy Academy
Gallente Federation
#255 - 2014-03-23 09:57:18 UTC  |  Edited by: Shin Chogan
lasterax wrote:
lasterax wrote:
Migrated my forum to get on the same server as comms. Thins have gone well except for when running the API check, I get the following error:

Quote:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
File: /var/www/forums/Sources/TEA.php
Line: 2492


Checking the error log I also get the following:

8: Undefined property: TEA::$lastid


Something I missed doing the move?

--Rax


Any ideas on this one Shin? I've tried removing the mod and reinstalling and it doesn't seem to fix the trouble. Everything else appears to be working right so I'm stuck at what's causing the error.

--Rax


not yet .... I've not been able to trace a path that would not set TEA::$lastid

edit : unless .... can you look in your settings table and find a value tea_nextpull. Also what happens if you run the TEA_cron.php script ?
Jen Moriarty
Republic University
Minmatar Republic
#256 - 2014-03-23 12:54:52 UTC
This problem is still ongoing. When I hijack the get_site() function to load my own Openfire access string, I get literally nothing back - an empty string. Not an "ok" or rejected response like what I get when I load this URL on my own browser, just empty. Openfire itself shows nothing in its logs. Running packet trace is not possible cause I'm running this on a virtual server, so the physical hardware is shared.
Shin Chogan
Federal Navy Academy
Gallente Federation
#257 - 2014-03-23 14:07:27 UTC
Jen Moriarty wrote:
This problem is still ongoing. When I hijack the get_site() function to load my own Openfire access string, I get literally nothing back - an empty string. Not an "ok" or rejected response like what I get when I load this URL on my own browser, just empty. Openfire itself shows nothing in its logs. Running packet trace is not possible cause I'm running this on a virtual server, so the physical hardware is shared.



what exactly are you doing when you say "hijack the get_site() function".

get_site returns whatever html the url it is fetching sends back. There is a 60 second time out so next question is does the get_site function take 60 seconds to come back ? In which case is it failing to connect to the openfire service.
Jen Moriarty
Republic University
Minmatar Republic
#258 - 2014-03-23 14:19:35 UTC  |  Edited by: Jen Moriarty
Shin Chogan wrote:

what exactly are you doing when you say "hijack the get_site() function".

get_site returns whatever html the url it is fetching sends back. There is a 60 second time out so next question is does the get_site function take 60 seconds to come back ? In which case is it failing to connect to the openfire service.


Print debug lines to see what exactly is going on. Like printing the output of curl_exec. And no, it doesn't take 60 seconds, it is immediate.

Next development. If, within get_site() I call a function to create an html page which redirects me to the Openfire URL, then I curl_exec THAT page, adding a user works. It has the unfortunate site-effect of a. leaving me on the redirected page, thus showing my passcode to the world and b. requiring that Openfire User Service IPs be open to the world. :(
Shin Chogan
Federal Navy Academy
Gallente Federation
#259 - 2014-03-23 14:42:23 UTC
Jen Moriarty wrote:
Shin Chogan wrote:

what exactly are you doing when you say "hijack the get_site() function".

get_site returns whatever html the url it is fetching sends back. There is a 60 second time out so next question is does the get_site function take 60 seconds to come back ? In which case is it failing to connect to the openfire service.


Print debug lines to see what exactly is going on. Like printing the output of curl_exec. And no, it doesn't take 60 seconds, it is immediate.

Next development. If, within get_site() I call a function to create an html page which redirects me to the Openfire URL, then I curl_exec THAT page, adding a user works. It has the unfortunate site-effect of a. leaving me on the redirected page, thus showing my passcode to the world and b. requiring that Openfire User Service IPs be open to the world. :(



It will also break all the other places that get_site is used Blink

so what is the url that get_site is trying to go to normally, without you making any modifications other than printing the url in get_site ?
Jen Moriarty
Republic University
Minmatar Republic
#260 - 2014-03-23 14:53:24 UTC  |  Edited by: Jen Moriarty
Shin Chogan wrote:

It will also break all the other places that get_site is used Blink

so what is the url that get_site is trying to go to normally, without you making any modifications other than printing the url in get_site ?


Yup, I don't intend to leave it that way :)

http://URL:9090/plugins/userService/userservice/plugins/userService/userservice?type=add&secret=SECRET&username=jen_moriarty&password=1111&name=*%20Jen%20Moriarty&email=test@gmail.com&groups=Admins

The URL is right. If I copy it to my browser, it adds a user, but for some reason, it doesn't get sent to Openfire from TEA directly

EDIT: And as I read this back to myself, I noticed "plugins/userService/userservice" appearing twice. When the Jabber settings requested a "URL to the Admin page of Openfire" I clearly gave the full URL with the full path. Which resulted in duplicating paths and a silent fail. Alright! Perhaps you should clarify that in the instructions :)