System Password: Prevent error when both password fields are empty

This commit is contained in:
Steven Barth 2008-12-07 13:26:34 +00:00
parent 506822ee70
commit 5960841098
2 changed files with 4 additions and 0 deletions

View file

@ -16,9 +16,11 @@ f = SimpleForm("password", translate("a_s_changepw"), translate("a_s_changepw1")
pw1 = f:field(Value, "pw1", translate("password")) pw1 = f:field(Value, "pw1", translate("password"))
pw1.password = true pw1.password = true
pw1.rmempty = false
pw2 = f:field(Value, "pw2", translate("confirmation")) pw2 = f:field(Value, "pw2", translate("confirmation"))
pw2.password = true pw2.password = true
pw2.rmempty = false
function pw2.validate(self, value, section) function pw2.validate(self, value, section)
return pw1:formvalue(section) == value and value return pw1:formvalue(section) == value and value

View file

@ -16,9 +16,11 @@ f = SimpleForm("password", translate("a_s_changepw"), translate("a_s_changepw1")
pw1 = f:field(Value, "pw1", translate("password")) pw1 = f:field(Value, "pw1", translate("password"))
pw1.password = true pw1.password = true
pw1.rmempty = false
pw2 = f:field(Value, "pw2", translate("confirmation")) pw2 = f:field(Value, "pw2", translate("confirmation"))
pw2.password = true pw2.password = true
pw2.rmempty = false
function pw2.validate(self, value, section) function pw2.validate(self, value, section)
return pw1:formvalue(section) == value and value return pw1:formvalue(section) == value and value