summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2015-09-30 22:15:05 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2015-09-30 22:15:05 +0200
commit207bd155a529fd11083d1d2dd48647debc97444e (patch)
tree7ce7f4fb71036ea856f54c4fc325b6700c7bb474
parent2e597f5218aa163f5b5ea5cd645dd447bb47b295 (diff)
downloadprosody_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
-rw-r--r--mod_auth_custom/mod_auth_custom.lua4
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);
37end 37end
38 38
39function user_exists(username) 39function user_exists(username)