1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Fix glorytun interface

This commit is contained in:
Ycarus 2018-09-13 15:07:30 +02:00
parent a727c6cace
commit 86588f0792

View file

@ -58,20 +58,29 @@ function s.create(self, name)
luci.cbi.CREATE_PREFIX .. self.config .. "." ..
self.sectiontype .. ".text"
)
if string.len(name)>3 and not name:match("[^a-zA-Z0-9_]") then
uci:section(
"glorytun", "glorytun", name,
uci:get_all( "glorytun_recipes", recipe )
)
if #name > 3 and not name:match("[^a-zA-Z0-9_]") then
--uci:section(
-- "glorytun", "glorytun", name,
-- uci:get_all( "glorytun_recipes", recipe )
--)
local recipe_data = uci:get_all( "glorytun_recipes", recipe )
uci:set("glorytun", name,"glorytun")
local k, v
for k, v in pairs(recipe_data) do
uci:set("glorytun", name, k,v)
end
uci:delete("glorytun", name, "_role")
uci:delete("glorytun", name, "_description")
uci:commit("glorytun")
uci:save("glorytun")
luci.http.redirect( self.extedit:format(name) )
else
elseif #name > 0 then
self.invalid_cts = true
end
return 0
end