summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-12-25 00:42:51 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-12-25 00:42:51 +0000
commitfc962c347c29cc9bb20d8587217f411035224201 (patch)
tree6f0cf762369bbcc4063259995b144319757adba7
parent913ab50e2be49011b5cea03ee0efe67765325ad3 (diff)
modules/admin-full: redirect back to overview page if trying to configure not existing wireless network
-rw-r--r--modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua b/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua
index 095e0efb9..d6abfd6ad 100644
--- a/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua
+++ b/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua
@@ -44,7 +44,14 @@ nw.init(m.uci)
ww.init(m.uci)
local wnet = ww:get_network(arg[2])
-m.title = wnet and ww:get_i18n(wnet) or translate("Wireless Network")
+
+-- redirect to overview page if network does not exist anymore (e.g. after a revert)
+if not wnet then
+ luci.http.redirect(luci.dispatcher.build_url("admin/network/wireless"))
+ return
+end
+
+m.title = ww:get_i18n(wnet)
local iw = nil