Software / code / prosody-modules
File
mod_auth_external_insecure/examples/python/prosody-auth-example.py @ 6298:761b66d4b12e
mod_muc_moderation: Readme Compatibility
diff --git a/mod_muc_moderation/README.md b/mod_muc_moderation/README.md
--- a/mod_muc_moderation/README.md
+++ b/mod_muc_moderation/README.md
@@ -28,9 +28,10 @@ modules_enabled = {
# Compatibility
------- ---------------
- trunk Works^[as of 2025-06-13]
+ trunk Works as of 2025-06-13
13 Works
0.12 Works
+ ------- ---------------
## XEP version
| author | Menel <menel@snikket.de> |
|---|---|
| date | Fri, 13 Jun 2025 10:04:40 +0200 |
| parent | 3884:f84ede3e9e3b |
line wrap: on
line source
#!/usr/bin/env python2 import sys def auth(username, password): if username == "someone": return "1" return "0" def respond(ret): sys.stdout.write(ret+"\n") sys.stdout.flush() methods = { "auth": { "function": auth, "parameters": 2 } } while 1: line = sys.stdin.readline().rstrip("\n") method, sep, data = line.partition(":") if method in methods: method_info = methods[method] split_data = data.split(":", method_info["parameters"]) if len(split_data) == method_info["parameters"]: respond(method_info["function"](*split_data)) else: respond("error: incorrect number of parameters to method '%s'"%method) else: respond("error: method '%s' not implemented"%method)