Software /
code /
prosody
Diff
core/usermanager.lua @ 8192:4354f556c5db
core.usermanager, various modules: Disconnect other resources on password change (thanks waqas) (fixes #512)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 28 Jul 2017 13:15:29 +0200 |
parent | 7177:1295e14614f4 |
child | 8555:4f0f5b49bb03 |
line wrap: on
line diff
--- a/core/usermanager.lua Sun Aug 06 13:27:47 2017 +0200 +++ b/core/usermanager.lua Fri Jul 28 13:15:29 2017 +0200 @@ -76,8 +76,12 @@ 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)