diff options
-rw-r--r-- | mod_auth_custom/mod_auth_custom.lua | 12 |
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 @@ | |||
1 | local posix = require "posix.grp"; | 1 | local posix = require "posix.grp"; |
2 | local pam = require "pam"; | 2 | local pam = require "pam"; |
3 | local new_sasl = require "util.sasl".new; | 3 | local new_sasl = require "util.sasl".new; |
4 | 4 | ||
5 | function user_exists(username) | 5 | function 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; |
12 | end | ||
13 | |||
14 | function user_exists(username) | ||
15 | return is_real_user(username); | ||
12 | end | 16 | end |
13 | 17 | ||
14 | function test_password(username, password) | 18 | function test_password(username, password) |