luci-0.9: merge r5967
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 27 Mar 2010 23:52:06 +0000 (23:52 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sat, 27 Mar 2010 23:52:06 +0000 (23:52 +0000)
modules/admin-full/luasrc/model/cbi/admin_system/system.lua

index 2a69e9a..8113a1f 100644 (file)
@@ -19,6 +19,22 @@ require("luci.fs")
 
 m = Map("system", translate("system"), translate("a_s_desc"))
 
+function m.on_parse()
+       local has_rdate = false
+
+       m.uci:foreach("system", "rdate",
+               function()
+                       has_rdate = true
+                       return false
+               end)
+
+       if not has_rdate then
+               m.uci:section("system", "rdate", nil, { })
+               m.uci:save("system")
+       end
+end
+
+
 s = m:section(TypedSection, "system", "")
 s.anonymous = true
 s.addremove = false