Rebased on top of contrib as changeset 4e125f96b264.

В 10 март 2026 г. 23:08:40 (+03:00), 'Vitaly Orekhov' via prosody-dev пишет:


Any updates on this one, please? Just in case, it's changeset 29ca2aa9d552 in 
contrib, still there as a draft.


On Wednesday, 27 December 2023 at 14:10:49 UTC+3 Vitaly Orekhov wrote:

[PATCH] mod_auth_internal_plain: Add functions to enable/disable/check user 
activation
Can this patch get merged into trunk? It's still hanging as a draft in contrib.

-- 
---
Vitaly A. Orekhov

-- 
You received this message because you are subscribed to the Google Groups 
"prosody-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/prosody-dev/1773336039996.2708820551.2234560171%40vivaldi.net.
# HG changeset patch
# User Vitaly Orekhov <[email protected]>
# Date 1679404857 -10800
#      Tue Mar 21 16:20:57 2023 +0300
# Node ID 4e125f96b264d36f4137da472f57da5659555559
# Parent  2eacb468bede3d17cf391caf0bcfe82e633dae84
mod_auth_internal_plain: Add functions to enable/disable/check user activation

Followup to 2cb5994e3f94. Implementaion taken from auth_internal_hashed is fully
compatible with plain one.

diff -r 2eacb468bede -r 4e125f96b264 plugins/mod_auth_internal_plain.lua
--- a/plugins/mod_auth_internal_plain.lua       Thu Mar 12 08:31:16 2026 +0100
+++ b/plugins/mod_auth_internal_plain.lua       Tue Mar 21 16:20:57 2023 +0300
@@ -75,6 +75,27 @@
        return true;
 end
 
+function provider.is_enabled(username) -- luacheck: ignore 212
+       local info, err = provider.get_account_info(username);
+       if not info then return nil, err; end
+       return info.enabled;
+end
+
+function provider.enable(username)
+       -- TODO map store?
+       local account = accounts:get(username);
+       account.disabled = nil;
+       account.updated = os.time();
+       return accounts:set(username, account);
+end
+
+function provider.disable(username)
+       local account = accounts:get(username);
+       account.disabled = true;
+       account.updated = os.time();
+       return accounts:set(username, account);
+end
+
 function provider.users()
        return accounts:users();
 end

Reply via email to