luci-app-mwan3: check policy name length on create

fixes #13499

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert 2020-10-14 10:07:38 +02:00
parent 3d1b6a12f6
commit 8c19a2e1b8

View file

@ -53,9 +53,13 @@ mwan_policy.sortable = true
mwan_policy.template = "cbi/tblsection" mwan_policy.template = "cbi/tblsection"
mwan_policy.extedit = dsp.build_url("admin", "network", "mwan", "policy", "%s") mwan_policy.extedit = dsp.build_url("admin", "network", "mwan", "policy", "%s")
function mwan_policy.create(self, section) function mwan_policy.create(self, section)
TypedSection.create(self, section) if #section > 15 then
m.uci:save("mwan3") self.invalid_cts = true
luci.http.redirect(dsp.build_url("admin", "network", "mwan", "policy", section)) else
TypedSection.create(self, section)
m.uci:save("mwan3")
luci.http.redirect(dsp.build_url("admin", "network", "mwan", "policy", section))
end
end end
use_member = mwan_policy:option(DummyValue, "use_member", translate("Members assigned")) use_member = mwan_policy:option(DummyValue, "use_member", translate("Members assigned"))