diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-03-24 22:40:53 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-03-24 22:40:53 +0000 |
commit | 808ba7e691f4fbc36a380204ea4cce1c46d9b69b (patch) | |
tree | f3e1b92c3447f9927e655f62b1218c2fd4ed4393 /core/usermanager.lua | |
parent | d16d14ade1716171913200e085f1af12e6c819eb (diff) | |
parent | b0e0c82d16c2b371508d7a4db4ff3b62341ccd5d (diff) | |
download | prosody-808ba7e691f4fbc36a380204ea4cce1c46d9b69b.tar.gz prosody-808ba7e691f4fbc36a380204ea4cce1c46d9b69b.zip |
Merge 0.7/waqas->0.7/MattJ
Diffstat (limited to 'core/usermanager.lua')
-rw-r--r-- | core/usermanager.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/usermanager.lua b/core/usermanager.lua index efb2e750..8d7270c2 100644 --- a/core/usermanager.lua +++ b/core/usermanager.lua @@ -55,6 +55,15 @@ function get_password(username, host) if is_cyrus(host) then return nil, "Passwords unavailable for Cyrus SASL."; end return (datamanager.load(username, host, "accounts") or {}).password end +function set_password(username, host, password) + if is_cyrus(host) then return nil, "Passwords unavailable for Cyrus SASL."; end + local account = datamanager.load(username, host, "accounts"); + if account then + account.password = password; + return datamanager.store(username, host, "accounts", account); + end + return nil, "Account not available."; +end function user_exists(username, host) if is_cyrus(host) then return true; end |