diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2015-09-30 22:15:05 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2015-09-30 22:15:05 +0200 |
commit | 207bd155a529fd11083d1d2dd48647debc97444e (patch) | |
tree | 7ce7f4fb71036ea856f54c4fc325b6700c7bb474 /mod_auth_custom | |
parent | 2e597f5218aa163f5b5ea5cd645dd447bb47b295 (diff) | |
download | prosody_auth-207bd155a529fd11083d1d2dd48647debc97444e.tar prosody_auth-207bd155a529fd11083d1d2dd48647debc97444e.tar.gz prosody_auth-207bd155a529fd11083d1d2dd48647debc97444e.tar.bz2 prosody_auth-207bd155a529fd11083d1d2dd48647debc97444e.tar.xz prosody_auth-207bd155a529fd11083d1d2dd48647debc97444e.zip |
including host in aliases
Diffstat (limited to 'mod_auth_custom')
-rw-r--r-- | mod_auth_custom/mod_auth_custom.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mod_auth_custom/mod_auth_custom.lua b/mod_auth_custom/mod_auth_custom.lua index 59d5236..424e3ab 100644 --- a/mod_auth_custom/mod_auth_custom.lua +++ b/mod_auth_custom/mod_auth_custom.lua | |||
@@ -23,7 +23,7 @@ function is_alias(username) | |||
23 | while true do | 23 | while true do |
24 | local line = f:read("*line"); | 24 | local line = f:read("*line"); |
25 | if line == nil then break; end | 25 | if line == nil then break; end |
26 | if string.lower(line) == string.lower(username) then found = true; end | 26 | if string.lower(line) == string.lower(username .. "@" .. module.host) then found = true; end |
27 | end | 27 | end |
28 | f:close(); | 28 | f:close(); |
29 | return found; | 29 | return found; |
@@ -33,7 +33,7 @@ function alias_pw(username) | |||
33 | local f = assert(io.open(alias_secret_file, "r")); | 33 | local f = assert(io.open(alias_secret_file, "r")); |
34 | local secret = f:read("*all"); | 34 | local secret = f:read("*all"); |
35 | f:close(); | 35 | f:close(); |
36 | return sha2.sha512hex(username .. secret); | 36 | return sha2.sha512hex(username .. "@" .. module.host .. secret); |
37 | end | 37 | end |
38 | 38 | ||
39 | function user_exists(username) | 39 | function user_exists(username) |