mod_auth_ldap: Fix issue with some versions of LuaLDAP
authorKim Alvefur <zash@zash.se>
Tue, 25 Mar 2014 15:11:34 +0100
changeset 1374 ab638f6b53dc
parent 1373 985bfc6e8cad
child 1375 90bde50b3915
mod_auth_ldap: Fix issue with some versions of LuaLDAP
mod_auth_ldap/mod_auth_ldap.lua
--- a/mod_auth_ldap/mod_auth_ldap.lua	Sat Mar 29 22:56:24 2014 +0700
+++ b/mod_auth_ldap/mod_auth_ldap.lua	Tue Mar 25 15:11:34 2014 +0100
@@ -21,14 +21,14 @@
 
 local function get_user(username)
 	module:log("debug", "get_user(%q)", username);
-	return ld:search({
+	for dn, attr in ld:search({
 		base = ldap_base;
 		scope = ldap_scope;
 		filter = ldap_filter:gsub("%$(%a+)", {
 			user = ldap_filter_escape(username);
 			host = host;
 		});
-	})();
+	}) do return dn, attr; end
 end
 
 local provider = {};