summaryrefslogtreecommitdiff
path: root/mod_auth_custom/mod_auth_custom.lua
diff options
context:
space:
mode:
Diffstat (limited to 'mod_auth_custom/mod_auth_custom.lua')
-rw-r--r--mod_auth_custom/mod_auth_custom.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/mod_auth_custom/mod_auth_custom.lua b/mod_auth_custom/mod_auth_custom.lua
index e917b6a..9b4872e 100644
--- a/mod_auth_custom/mod_auth_custom.lua
+++ b/mod_auth_custom/mod_auth_custom.lua
@@ -1,14 +1,18 @@
1local posix = require "posix.grp"; 1local posix = require "posix.grp";
2local pam = require "pam"; 2local pam = require "pam";
3local new_sasl = require "util.sasl".new; 3local new_sasl = require "util.sasl".new;
4 4
5function user_exists(username) 5function is_real_user(username)
6 for i,v in ipairs(posix.getgroup("xmpp")) do 6 for i,v in ipairs(posix.getgrnam("xmpp").gr_mem) do
7 if username == v then 7 if username == v then
8 return true; 8 return true;
9 end 9 end
10 end 10 end
11 return false; 11 return false;
12end
13
14function user_exists(username)
15 return is_real_user(username);
12end 16end
13 17
14function test_password(username, password) 18function test_password(username, password)