changeset 1538:57bb2497fadc

mod_auth_pam: Update for removal of PAM_ prefixes to constant names
author Kim Alvefur <zash@zash.se>
date Tue, 28 Oct 2014 15:24:50 +0100
parents 88e0b4bace88
children 05fa54404012
files mod_auth_pam/mod_auth_pam.lua
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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