mod_auth_pam: Update for removal of PAM_ prefixes to constant names
authorKim Alvefur <zash@zash.se>
Tue, 28 Oct 2014 15:24:50 +0100
changeset 1538 57bb2497fadc
parent 1537 88e0b4bace88
child 1539 05fa54404012
mod_auth_pam: Update for removal of PAM_ prefixes to constant names
mod_auth_pam/mod_auth_pam.lua
--- a/mod_auth_pam/mod_auth_pam.lua	Sat Oct 25 01:27:52 2014 +0200
+++ b/mod_auth_pam/mod_auth_pam.lua	Tue Oct 28 15:24:50 2014 +0100
@@ -15,13 +15,13 @@
 function test_password(username, password)
 	local h, err = pam.start("xmpp", username, {
 		function (t)
-			if #t == 1 and t[1][1] == pam.PAM_PROMPT_ECHO_OFF then
+			if #t == 1 and t[1][1] == pam.PROMPT_ECHO_OFF then
 				return { { password, 0} };
 			end
 		end
 	});
-	if h and h:authenticate() and h:endx(pam.PAM_SUCCESS) then
-		return true, true;
+	if h and h:authenticate() and h:endx(pam.SUCCESS) then
+		return user_exists(username), true;
 	end
 	return nil, true;
 end