core/usermanager.lua

changeset 3116
90a98a6b52ac
parent 3065
0b8bd6f6a9c7
parent 3113
30896751dd43
child 3154
b01a699ddf64
equal deleted inserted replaced
3081:4ee34d07e042 3116:90a98a6b52ac
72 return nil, "Account not available."; 72 return nil, "Account not available.";
73 end 73 end
74 74
75 function provider:user_exists(username) 75 function provider:user_exists(username)
76 if not(require_provisioning) and is_cyrus(host) then return true; end 76 if not(require_provisioning) and is_cyrus(host) then return true; end
77 return datamanager.load(username, host, "accounts") ~= nil; -- FIXME also check for empty credentials 77 local account, err = datamanager.load(username, host, "accounts") ~= nil; -- FIXME also check for empty credentials
78 return (account or err) ~= nil; -- FIXME also check for empty credentials
78 end 79 end
79 80
80 function provider:create_user(username, password) 81 function provider:create_user(username, password)
81 if not(require_provisioning) and is_cyrus(host) then return nil, "Account creation/modification not available with Cyrus SASL."; end 82 if not(require_provisioning) and is_cyrus(host) then return nil, "Account creation/modification not available with Cyrus SASL."; end
82 return datamanager.store(username, host, "accounts", {password = password}); 83 return datamanager.store(username, host, "accounts", {password = password});

mercurial