While working with Openfire I had to integrate our current Ruby on Rails based backend with the User Service plugin. The "openfire_api" gem supports all user service api-calls (add, update, delete, lock and unlock).
api = OpenfireApi::UserService.new(:url => "http://localhost:9090/", :secret => "BIGSECRET")
# register new user
api.add_user!(:username => "user3", :password => "pass")
# lock the user
api.lock_user!(:username => "user3")
Full Documentation and Source on Github: https://github.com/paulasmuth/openfire_api