Changeset

1221:3e5f8e844325

mod_auth_ldap: Fix set_password
author Kim Alvefur <zash@zash.se>
date Mon, 04 Nov 2013 18:13:57 +0100
parents 1220:6b9a56b959b8
children 1222:e3a766045ef6
files mod_auth_ldap/mod_auth_ldap.lua
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mod_auth_ldap/mod_auth_ldap.lua	Fri Nov 01 18:53:52 2013 -0400
+++ b/mod_auth_ldap/mod_auth_ldap.lua	Mon Nov 04 18:13:57 2013 +0100
@@ -43,10 +43,8 @@
 function provider.set_password(username, password)
 	local dn, attr = get_user(username);
 	if not dn then return nil, attr end
-	if attr.password ~= password then
-		ld:modify(dn, { '=', userPassword = password });
-	end
-	return true
+	if attr.userPassword == password then return true end
+	return ld:modify(dn, { '=', userPassword = password })();
 end
 function provider.create_user(username, password) return nil, "Account creation not available with LDAP."; end