Comparison

mod_auth_ldap/mod_auth_ldap.lua @ 1221:3e5f8e844325

mod_auth_ldap: Fix set_password
author Kim Alvefur <zash@zash.se>
date Mon, 04 Nov 2013 18:13:57 +0100
parent 1192:db4085433e5f
child 1273:1b543060f31e
comparison
equal deleted inserted replaced
1220:6b9a56b959b8 1221:3e5f8e844325
41 return not not get_user(username); 41 return not not get_user(username);
42 end 42 end
43 function provider.set_password(username, password) 43 function provider.set_password(username, password)
44 local dn, attr = get_user(username); 44 local dn, attr = get_user(username);
45 if not dn then return nil, attr end 45 if not dn then return nil, attr end
46 if attr.password ~= password then 46 if attr.userPassword == password then return true end
47 ld:modify(dn, { '=', userPassword = password }); 47 return ld:modify(dn, { '=', userPassword = password })();
48 end
49 return true
50 end 48 end
51 function provider.create_user(username, password) return nil, "Account creation not available with LDAP."; end 49 function provider.create_user(username, password) return nil, "Account creation not available with LDAP."; end
52 50
53 function provider.get_sasl_handler() 51 function provider.get_sasl_handler()
54 return new_sasl(module.host, { 52 return new_sasl(module.host, {