Skip to content

Commit

Permalink
Merge pull request #168 from opentechinstitute/issue_159
Browse files Browse the repository at this point in the history
Add .js side checks for hostname != nil. Works perfectly both with and without js - @jheretic
  • Loading branch information
jheretic committed Feb 25, 2014
2 parents e4fd669 + 49169b0 commit 50118d0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion luasrc/model/cbi/commotion/basic_ns.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ shn.addremove = false

--Create a value field for hostname
local hname = shn:option(Value, "hostname", translate("Node Name"), translate("The node name (hostname) is a unique name for this device, visible to other devices and users on the network. Name this device in the field provided."))
hname.datatype = "maxlength(63)"
hname.datatype = "rangelength(1, 63)"
hname.rmempty = false

function hname.validate(self,value)
if validate.hostname(value) then
Expand Down Expand Up @@ -95,6 +96,10 @@ s.anonymous = true
pw1 = s:option(Value, "_pw1", translate("Password"))
pw1.password = true

if SW.status() then
pw1.rmempty = false
end

pw2 = s:option(Value, "_pw2", translate("Confirmation"))
pw2.password = true

Expand Down

0 comments on commit 50118d0

Please sign in to comment.