[ejabberd] ejabberd hacking HOWTO...

Carl Hayter hayter at usc.edu
Tue Nov 28 09:45:28 MSK 2006

I really want to contribute code to the ejabberd community.  But my Erlang
skills are weak, my code looks like the worst code possible.  I can hack
Perl code and be confident in my code, but my Erlang still looks like code
from random PHP users. :(

I noticed today a Subversion repository for ejabberd modules.  Which makes
me happy!  But I'm afraid of uploading my code because it is so poor.  Is
this list willing to look at code and maybe give pointers to improve the code
before I upload?

For example:

I currently authenticate my users against an external PHP forum user database.
Since the Jabber server does not have direct access to the users database of
the forum software, I hacked an auth module that uses a bit of example
code from somewhere off of the Erlang site (urlget.erl).  I take the username
and password (plaintext) and md5 the password and make a standard HTTP request
to a PHP script on the forum site.  so (User,Password) is turned into a HTTP
request to "http://mysite.org/auth.php?user:md5(password)".  the auth.php
script checks the user/password info and returns a "OK" or "FAIL" as a result.

So it is totally ugly code... But it does allow my ejabberd server to 
authenticate users against a random PHP based forum where I don't have direct
access to the user database from the ejabberd server host.

I'm just in a state of confusion as to whether such code would be useful to
other ejabberd users.  In theory, with a tiny bit of PHP code on the forum
host side, my module would let ejabberd authenticate against any forum even
without access to the user database...  But the code is a bit ugly. :(

What is the best way to proceed?  Should I get an account on the new ejabberd
module repository and commit my poor code?  Should I just upload my code to
the ejabberd website?  Should i post my code here on this list and hope that
somebody with more Erlang experience would take a look?

I just feel really bad with the idea of uploading my poor code...

Carl Hayter
Information Technology Services
University of Southern California
(hacking on www.thejapanesepage.com) 

More information about the ejabberd mailing list