summaryrefslogtreecommitdiffstats
path: root/shorewall-controller.lua
diff options
context:
space:
mode:
Diffstat (limited to 'shorewall-controller.lua')
-rw-r--r--shorewall-controller.lua17
1 files changed, 16 insertions, 1 deletions
diff --git a/shorewall-controller.lua b/shorewall-controller.lua
index 0b9b3ac..094dcf9 100644
--- a/shorewall-controller.lua
+++ b/shorewall-controller.lua
@@ -28,6 +28,21 @@ end
edit = function (self)
local filename = self.clientdata.name or ""
- return ( {filecontent = self.model:get_filecontent(filename), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller } )
+ local filecontent = self.clientdata.modifications or ""
+ if self.clientdata.cmd == "update" then
+ local me = ( {filecontent = self.model:update_filecontent(filename,filecontent), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller } )
+ if ( me.filecontent == nil ) then
+ list_redir(self)
+ else
+ return me
+ end
+ else
+ local me = ( {filecontent = self.model:get_filecontent(filename), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller } )
+ if ( me.filecontent == nil ) then
+ list_redir(self)
+ else
+ return me
+ end
+ end
end