Comparison

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
comparison
equal deleted inserted replaced
8191:d43012448c1f 8192:4354f556c5db
74 74
75 local function get_password(username, host) 75 local function get_password(username, host)
76 return hosts[host].users.get_password(username); 76 return hosts[host].users.get_password(username);
77 end 77 end
78 78
79 local function set_password(username, password, host) 79 local function set_password(username, password, host, resource)
80 return hosts[host].users.set_password(username, password); 80 local ok, err = hosts[host].users.set_password(username, password);
81 if ok then
82 prosody.events.fire_event("user-password-changed", { username = username, host = host, resource = resource });
83 end
84 return ok, err;
81 end 85 end
82 86
83 local function user_exists(username, host) 87 local function user_exists(username, host)
84 if hosts[host].sessions[username] then return true; end 88 if hosts[host].sessions[username] then return true; end
85 return hosts[host].users.user_exists(username); 89 return hosts[host].users.user_exists(username);