Merge on_***_to handlers
authorSteven Barth <steven@midlink.org>
Wed, 5 Nov 2008 21:12:19 +0000 (21:12 +0000)
committerSteven Barth <steven@midlink.org>
Wed, 5 Nov 2008 21:12:19 +0000 (21:12 +0000)
libs/web/luasrc/dispatcher.lua

index 79532ddf1d1da1f5d1eef2ea863b6d74a72e6266..2323cf8d2980f5352b4f8bb03b8a76197b8921e8 100644 (file)
@@ -529,6 +529,16 @@ function cbi(model, config)
                        end
                end
 
+               if config.on_valid_to and state and state > 0 and state < 2 then
+                       luci.http.redirect(config.on_valid_to)
+                       return
+               end
+
+               if config.on_changed_to and state and state > 1 then
+                       luci.http.redirect(config.on_changed_to)
+                       return
+               end
+
                if config.on_success_to and state and state > 0 then
                        luci.http.redirect(config.on_success_to)
                        return