Comparison

core/usermanager.lua @ 3115:4c35ef27d868

Merge 0.7/waqas->0.7/MattJ
author Matthew Wild <mwild1@gmail.com>
date Sun, 23 May 2010 23:05:01 +0100
parent 3113:30896751dd43
child 3116:90a98a6b52ac
comparison
equal deleted inserted replaced
3107:6d576a66ca63 3115:4c35ef27d868
67 return nil, "Account not available."; 67 return nil, "Account not available.";
68 end 68 end
69 69
70 function user_exists(username, host) 70 function user_exists(username, host)
71 if not(require_provisioning) and is_cyrus(host) then return true; end 71 if not(require_provisioning) and is_cyrus(host) then return true; end
72 return datamanager.load(username, host, "accounts") ~= nil; -- FIXME also check for empty credentials 72 local account, err = datamanager.load(username, host, "accounts");
73 return (account or err) ~= nil; -- FIXME also check for empty credentials
73 end 74 end
74 75
75 function create_user(username, password, host) 76 function create_user(username, password, host)
76 if not(require_provisioning) and is_cyrus(host) then return nil, "Account creation/modification not available with Cyrus SASL."; end 77 if not(require_provisioning) and is_cyrus(host) then return nil, "Account creation/modification not available with Cyrus SASL."; end
77 return datamanager.store(username, host, "accounts", {password = password}); 78 return datamanager.store(username, host, "accounts", {password = password});