Mercurial > prosody-hg
comparison plugins/mod_legacyauth.lua @ 12977:74b9e05af71e
plugins: Prefix module imports with prosody namespace
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 24 Mar 2023 13:15:28 +0100 |
| parents | a80314101bc6 |
| children |
comparison
equal
deleted
inserted
replaced
| 12976:a187600ec7d6 | 12977:74b9e05af71e |
|---|---|
| 6 -- COPYING file in the source package for more information. | 6 -- COPYING file in the source package for more information. |
| 7 -- | 7 -- |
| 8 | 8 |
| 9 | 9 |
| 10 | 10 |
| 11 local st = require "util.stanza"; | 11 local st = require "prosody.util.stanza"; |
| 12 local t_concat = table.concat; | 12 local t_concat = table.concat; |
| 13 | 13 |
| 14 local secure_auth_only = module:get_option("c2s_require_encryption", | 14 local secure_auth_only = module:get_option("c2s_require_encryption", |
| 15 module:get_option("require_encryption", true)) | 15 module:get_option("require_encryption", true)) |
| 16 or not(module:get_option("allow_unencrypted_plain_auth")); | 16 or not(module:get_option("allow_unencrypted_plain_auth")); |
| 17 | 17 |
| 18 local sessionmanager = require "core.sessionmanager"; | 18 local sessionmanager = require "prosody.core.sessionmanager"; |
| 19 local usermanager = require "core.usermanager"; | 19 local usermanager = require "prosody.core.usermanager"; |
| 20 local nodeprep = require "util.encodings".stringprep.nodeprep; | 20 local nodeprep = require "prosody.util.encodings".stringprep.nodeprep; |
| 21 local resourceprep = require "util.encodings".stringprep.resourceprep; | 21 local resourceprep = require "prosody.util.encodings".stringprep.resourceprep; |
| 22 | 22 |
| 23 module:add_feature("jabber:iq:auth"); | 23 module:add_feature("jabber:iq:auth"); |
| 24 module:hook("stream-features", function(event) | 24 module:hook("stream-features", function(event) |
| 25 local origin, features = event.origin, event.features; | 25 local origin, features = event.origin, event.features; |
| 26 if secure_auth_only and not origin.secure then | 26 if secure_auth_only and not origin.secure then |
