From 73b75571e6546448dac8a67c6c231c14851ccac1 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 28 Jul 2017 13:15:29 +0200 Subject: core.usermanager, various modules: Disconnect other resources on password change (thanks waqas) (fixes #512) --- core/usermanager.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'core/usermanager.lua') 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) -- cgit v1.2.3