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; |