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