Software / code / prosody
Comparison
core/usermanager.lua @ 53:14ea0fe6ca86
Session destruction fixes, some debugging code while we fix the rest. Also change logger to be more useful.
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sat, 04 Oct 2008 15:25:54 +0100 |
| parent | 38:3fdfd6e0cb4e |
| child | 60:44800be871f5 |
comparison
equal
deleted
inserted
replaced
| 52:93e468eb2ffb | 53:14ea0fe6ca86 |
|---|---|
| 1 | 1 |
| 2 require "util.datamanager" | 2 require "util.datamanager" |
| 3 local datamanager = datamanager; | 3 local datamanager = datamanager; |
| 4 local log = require "util.logger".init("usermanager"); | |
| 4 | 5 |
| 5 module "usermanager" | 6 module "usermanager" |
| 6 | 7 |
| 7 function validate_credentials(host, username, password) | 8 function validate_credentials(host, username, password) |
| 9 log("debug", "User '%s' is being validated", username); | |
| 8 local credentials = datamanager.load(username, host, "accounts") or {}; | 10 local credentials = datamanager.load(username, host, "accounts") or {}; |
| 9 if password == credentials.password then return true; end | 11 if password == credentials.password then return true; end |
| 10 return false; | 12 return false; |
| 11 end | 13 end |
| 12 | 14 |