summaryrefslogtreecommitdiffstats
path: root/shorewall-controller.lua
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2007-11-29 15:08:41 +0000
committerMika Havela <mika.havela@gmail.com>2007-11-29 15:08:41 +0000
commit3a4f180a70063a185a8eab0e1409b255f0762861 (patch)
tree96280af931e67a8de34d00577c8651fa468697b3 /shorewall-controller.lua
parentd81ce7886c20e537161083279e9bc96cf6b74290 (diff)
downloadacf-shorewall-3a4f180a70063a185a8eab0e1409b255f0762861.tar.bz2
acf-shorewall-3a4f180a70063a185a8eab0e1409b255f0762861.tar.xz
Modifying file is now possible
git-svn-id: svn://svn.alpinelinux.org/acf/shorewall/trunk@386 ab2d0c66-481e-0410-8bed-d214d4d58bed
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