Comparison

core/usermanager.lua @ 60:44800be871f5

User registration, etc (jabber:iq:register)
author Waqas Hussain <waqas20@gmail.com>
date Sun, 05 Oct 2008 04:55:45 +0500
parent 53:14ea0fe6ca86
child 228:875842235836
comparison
equal deleted inserted replaced
57:126b25079399 60:44800be871f5
10 local credentials = datamanager.load(username, host, "accounts") or {}; 10 local credentials = datamanager.load(username, host, "accounts") or {};
11 if password == credentials.password then return true; end 11 if password == credentials.password then return true; end
12 return false; 12 return false;
13 end 13 end
14 14
15 function user_exists(username, host)
16 return datamanager.load(username, host, "accounts") ~= nil;
17 end
18
19 function create_user(username, password, host)
20 return datamanager.store(username, host, "accounts", {password = password});
21 end
22
15 return _M; 23 return _M;