Mercurial > prosody-hg
comparison core/usermanager.lua @ 7177:1295e14614f4
usermanager: Shortcircuit user existence check if they have existing sessions
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 21 Feb 2016 19:30:45 +0100 |
| parents | 0ce2b400663b |
| children | 4354f556c5db |
comparison
equal
deleted
inserted
replaced
| 7176:b8bbd5f91ad9 | 7177:1295e14614f4 |
|---|---|
| 79 local function set_password(username, password, host) | 79 local function set_password(username, password, host) |
| 80 return hosts[host].users.set_password(username, password); | 80 return hosts[host].users.set_password(username, password); |
| 81 end | 81 end |
| 82 | 82 |
| 83 local function user_exists(username, host) | 83 local function user_exists(username, host) |
| 84 if hosts[host].sessions[username] then return true; end | |
| 84 return hosts[host].users.user_exists(username); | 85 return hosts[host].users.user_exists(username); |
| 85 end | 86 end |
| 86 | 87 |
| 87 local function create_user(username, password, host) | 88 local function create_user(username, password, host) |
| 88 return hosts[host].users.create_user(username, password); | 89 return hosts[host].users.create_user(username, password); |
