Software /
code /
prosody
File
core/usermanager.lua @ 190:1e993b7deae7
General fixes for s2s, to make it more robust (I hope), sending data to remote hosts sane (s2ssession.send() works as expected), recycle outgoing dialback connections, etc.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 01 Nov 2008 18:28:46 +0000 |
parent | 60:44800be871f5 |
child | 228:875842235836 |
line wrap: on
line source
require "util.datamanager" local datamanager = datamanager; local log = require "util.logger".init("usermanager"); module "usermanager" function validate_credentials(host, username, password) log("debug", "User '%s' is being validated", username); local credentials = datamanager.load(username, host, "accounts") or {}; if password == credentials.password then return true; end return false; end function user_exists(username, host) return datamanager.load(username, host, "accounts") ~= nil; end function create_user(username, password, host) return datamanager.store(username, host, "accounts", {password = password}); end return _M;