Software / code / prosody
Comparison
plugins/mod_auth_internal_hashed.lua @ 12933:3ab0bbb1dc35
mod_auth_internal_hashed: Record time of account disable / re-enable
Could be useful for e.g. #1772
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 12 Mar 2023 01:24:59 +0100 |
| parent | 12916:5a06d07596f9 |
| child | 12946:59478b295137 |
comparison
equal
deleted
inserted
replaced
| 12932:9bb044705ea1 | 12933:3ab0bbb1dc35 |
|---|---|
| 121 | 121 |
| 122 function provider.enable(username) | 122 function provider.enable(username) |
| 123 -- TODO map store? | 123 -- TODO map store? |
| 124 local account = accounts:get(username); | 124 local account = accounts:get(username); |
| 125 account.disabled = nil; | 125 account.disabled = nil; |
| 126 account.updated = os.time(); | |
| 126 return accounts:set(username, account); | 127 return accounts:set(username, account); |
| 127 end | 128 end |
| 128 | 129 |
| 129 function provider.disable(username) | 130 function provider.disable(username) |
| 130 local account = accounts:get(username); | 131 local account = accounts:get(username); |
| 131 account.disabled = true; | 132 account.disabled = true; |
| 133 account.updated = os.time(); | |
| 132 return accounts:set(username, account); | 134 return accounts:set(username, account); |
| 133 end | 135 end |
| 134 | 136 |
| 135 function provider.users() | 137 function provider.users() |
| 136 return accounts:users(); | 138 return accounts:users(); |