aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-07-28 13:15:29 +0200
committerKim Alvefur <zash@zash.se>2017-07-28 13:15:29 +0200
commit73b75571e6546448dac8a67c6c231c14851ccac1 (patch)
treee8ab717facc4069414f7377ed320eeac03dccc66 /core
parentcc8653d31c87dcdf4d140697e87b57ca5130d9d5 (diff)
downloadprosody-73b75571e6546448dac8a67c6c231c14851ccac1.tar.gz
prosody-73b75571e6546448dac8a67c6c231c14851ccac1.zip
core.usermanager, various modules: Disconnect other resources on password change (thanks waqas) (fixes #512)
Diffstat (limited to 'core')
-rw-r--r--core/usermanager.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/usermanager.lua b/core/usermanager.lua
index d5132662..f795e8ae 100644
--- a/core/usermanager.lua
+++ b/core/usermanager.lua
@@ -76,8 +76,12 @@ local function get_password(username, host)
return hosts[host].users.get_password(username);
end
-local function set_password(username, password, host)
- return hosts[host].users.set_password(username, password);
+local function set_password(username, password, host, resource)
+ local ok, err = hosts[host].users.set_password(username, password);
+ if ok then
+ prosody.events.fire_event("user-password-changed", { username = username, host = host, resource = resource });
+ end
+ return ok, err;
end
local function user_exists(username, host)