Software / code / prosody
Changeset
12903:13950bf92802
mod_auth_internal_hashed: Implement methods to enable and disable users
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 23 Feb 2023 14:44:35 +0100 |
| parents | 12902:0a0a251bcd6c |
| children | 12904:4c321d889fdc |
| files | plugins/mod_auth_internal_hashed.lua |
| diffstat | 1 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_auth_internal_hashed.lua Thu Feb 23 14:34:10 2023 +0100 +++ b/plugins/mod_auth_internal_hashed.lua Thu Feb 23 14:44:35 2023 +0100 @@ -117,12 +117,17 @@ return info.enabled; end -function provider.enable(username) -- luacheck: ignore 212 - error "NYI" +function provider.enable(username) + -- TODO map store? + local account = accounts:get(username); + account.disabled = nil; + return accounts:set(username, account); end -function provider.disable(username) -- luacheck: ignore 212 - error "NYI" +function provider.disable(username) + local account = accounts:get(username); + account.disabled = true; + return accounts:set(username, account); end function provider.users()