Hi folks...
I have a site with phpbb3 and pfc. I've integrated the login process for user accounts successfully, so that chat is only available to logged in users and their nickname is automatically set to their forum user name. This is easy because I can interrogate the phpbb session to verify the user has logged in and to determine their forum user name...its just a matter of setting the chat $nick to the user name, or denying access if they're not logged in. Cool!
However, I have a problem with integrating the logout functionality. If a user logs out of the forum without first issuing a "/quit" from chat, their chat presence remains. For example, imagine I have two PC's and I'm logged in and chatting on one. I logout of the forum and move to another PC and login but cannot connect to chat because my nickname is still in use (it's still in a stale chat session because the forum logout on the first PC didn't log me out of chat). Eventually a regular user will time out but - gasp! - if you were logged in as an admin user, it won't time out and you're boned.
I'm trying to figure out how to interface with pfc from the logout function of the forum but I can't find any clean way to do this. The current PFC architecture provides no form of "logout(username)" interface. Worse still, it seems that one has to either construct an entire client-side pfc context to fake up a call to pfc.sendRequest("/quit") which is really clumsy and cumbersome, or somehow write some gnarly code pulling in src/*cla
I guess an alternative approach could be throwing some code together to clean up the nickid-to-metadata etc. information in the backend container to achieve the same net effect. I'm experimenting with this now.
Has anyone successfully integrated logout functionality?
Cheers!