From: Steven Barth Date: Sun, 7 Dec 2008 13:26:34 +0000 (+0000) Subject: System Password: Prevent error when both password fields are empty X-Git-Tag: 0.9.0~919 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=596084109819606afa5e05a42b7c8757f96f8689;hp=506822ee7080e86584a4f6436aeeb8edb411c88e System Password: Prevent error when both password fields are empty --- diff --git a/modules/admin-full/luasrc/model/cbi/admin_system/passwd.lua b/modules/admin-full/luasrc/model/cbi/admin_system/passwd.lua index 8ff18cb5c..dff5aeb7b 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_system/passwd.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_system/passwd.lua @@ -16,9 +16,11 @@ f = SimpleForm("password", translate("a_s_changepw"), translate("a_s_changepw1") pw1 = f:field(Value, "pw1", translate("password")) pw1.password = true +pw1.rmempty = false pw2 = f:field(Value, "pw2", translate("confirmation")) pw2.password = true +pw2.rmempty = false function pw2.validate(self, value, section) return pw1:formvalue(section) == value and value diff --git a/modules/admin-mini/luasrc/model/cbi/mini/passwd.lua b/modules/admin-mini/luasrc/model/cbi/mini/passwd.lua index 8ff18cb5c..dff5aeb7b 100644 --- a/modules/admin-mini/luasrc/model/cbi/mini/passwd.lua +++ b/modules/admin-mini/luasrc/model/cbi/mini/passwd.lua @@ -16,9 +16,11 @@ f = SimpleForm("password", translate("a_s_changepw"), translate("a_s_changepw1") pw1 = f:field(Value, "pw1", translate("password")) pw1.password = true +pw1.rmempty = false pw2 = f:field(Value, "pw2", translate("confirmation")) pw2.password = true +pw2.rmempty = false function pw2.validate(self, value, section) return pw1:formvalue(section) == value and value