comparison mod_lib_ldap/ldap.lib.lua @ 877:cd2262969d2e

Make sure we use the user filter for bind
author Rob Hoelz <rob@hoelz.ro>
date Mon, 10 Dec 2012 22:35:17 +0100
parents e4a03e58f896
children 66b3085ecc49
comparison
equal deleted inserted replaced
876:512e31cd8b70 877:cd2262969d2e
175 return params; 175 return params;
176 end 176 end
177 177
178 -- XXX consider renaming this...it doesn't bind the current connection 178 -- XXX consider renaming this...it doesn't bind the current connection
179 function _M.bind(username, password) 179 function _M.bind(username, password)
180 local conn = _M.getconnection(); 180 local conn = _M.getconnection();
181 local filter = format('%s=%s', params.user.usernamefield, username); 181 local filter = format('%s=%s', params.user.usernamefield, username);
182 local who = _M.singlematch { 182
183 if filter then
184 filter = _M.filter.combine_and(filter, params.user.filter);
185 end
186
187 local who = _M.singlematch {
183 attrs = params.user.usernamefield, 188 attrs = params.user.usernamefield,
184 base = params.user.basedn, 189 base = params.user.basedn,
185 filter = filter, 190 filter = filter,
186 }; 191 };
187 192