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