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 79532dd..2323cf8 100644 (file)
@@ -529,6 +529,16 @@ function cbi(model, config)
                        end
                end
 
                        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
                if config.on_success_to and state and state > 0 then
                        luci.http.redirect(config.on_success_to)
                        return