luci-0.10: Merge r7913

This commit is contained in:
Manuel Munz 2011-11-10 12:26:52 +00:00
parent 8c97c5116f
commit d2732442a0

View file

@ -22,7 +22,6 @@ require("luci.config")
local m, s, o local m, s, o
local has_ntpd = luci.fs.access("/usr/sbin/ntpd") local has_ntpd = luci.fs.access("/usr/sbin/ntpd")
m = Map("system", translate("System"), translate("Here you can configure the basic aspects of your device like its hostname or the timezone.")) m = Map("system", translate("System"), translate("Here you can configure the basic aspects of your device like its hostname or the timezone."))
m:chain("luci") m:chain("luci")
@ -159,6 +158,20 @@ if has_ntpd then
s.anonymous = true s.anonymous = true
s.addremove = false s.addremove = false
function m.on_parse()
local has_section = false
m.uci:foreach("system", "timeserver",
function(s)
has_section = true
return false
end)
if not has_section then
m.uci:section("system", "timeserver", "ntp")
end
end
o = s:option(Flag, "enable", translate("Enable builtin NTP server")) o = s:option(Flag, "enable", translate("Enable builtin NTP server"))
o.rmempty = false o.rmempty = false