Fix urltoken passing on several pages
[project/luci.git] / modules / admin-full / luasrc / model / cbi / admin_network / wireless.lua
index 4f19f4e..ef46cb4 100644 (file)
@@ -32,7 +32,7 @@ s = m:section(Table, ifaces, translate("networks"))
 
 function s.extedit(self, section) 
        local device = self.map:get(section, "device") or ""
-       return luci.http.getenv("REQUEST_URI") .. "/" .. device
+       return  luci.dispatcher.build_url(unpack(luci.dispatcher.context.requested.path)) .. "/" .. device
 end
 
 link = s:option(DummyValue, "_link", translate("link"))
@@ -124,11 +124,11 @@ function create.write(self, section, value)
        uci:load("wireless")
        uci:section("wireless", "wifi-iface", nil, {device=value})
        uci:save("wireless")
-       luci.http.redirect(luci.http.getenv("REQUEST_URI") .. "/" .. value)
+       luci.http.redirect(luci.dispatcher.build_url(unpack(luci.dispatcher.context.requested.path)) .. "/" .. value)
 end
 
 function create.cbid(self, section)
        return "priv.cbid.create"
 end
 
-return m
\ No newline at end of file
+return m