your better bet is to setup an LADP server for your office. openldap is fine. you can use the LDAP for the basis of your usernames and passwords. if you use an LDAP server that is compatible with your workstations you could even use it for authentication to the workstations.
I spent some time trying to figure out how to do this, but got in over my head
The hack I ended up with is using a Jabber PHP library and then just doing a test login to the openfire server with the account to test the credentials. This may not be the best idea if the user has offline messages waiting for them for example.
Here we can switch password store to plain text and use database with php, but this is not a good idea… =) Need to create auth class with same encryption method like in openfire.