Module that would inform an external script that a user has logged in or logged out.

Hi, we're currently planning on writing a module that would call an external script (pref. through curl since we need to pass the JID and the login/logout status) if a user has logged in and logged out. We also need to capture users that do not explicitly log out (ie when session expires/time out). However we don't have any knowledge on Erlang (yet) so I'm gonna ask first if a module already has this same capability or something similar. If there is none, can anyone give us some pointers on how to do this (what hooks to add, ports to listen, etc). Thanks!

mives wrote: 1. if a user has

mives wrote:

1. if a user has logged in
2. and logged out.
3. users that do not explicitly log out (ie when session expires/time out)

Hooks:
1. sm_register_connection_hook
2. sm_remove_connection_hook
3. I think that also triggers event 2.

mives wrote:

some pointers on how to do this (what hooks to add, ports to listen, etc)

Ports to listen: none, because your module will perform HTTP requests to a remote web server, which is the one listening.

mives wrote:

if a module already has this same capability or something similar.

Not the same, but for some example usages of those or other hooks, see in ejabberd-modules SVN those modules: mod_logsession, mod_log_chat, mod_logxml, mod_statsdx.

Syndicate content