diff options
author | Mika Havela <mika.havela@gmail.com> | 2007-11-30 09:51:20 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2007-11-30 09:51:20 +0000 |
commit | 008e476ed54a6d9d3050f38dfc445de0cc2bd052 (patch) | |
tree | 6c12ea469022896071d1ea8a80e1150ba3071910 /openvpn-controller.lua | |
parent | 4914226cda432c9d865b83dd116ecce005182e26 (diff) | |
download | acf-openvpn-008e476ed54a6d9d3050f38dfc445de0cc2bd052.tar.bz2 acf-openvpn-008e476ed54a6d9d3050f38dfc445de0cc2bd052.tar.xz |
Adding debuginfo for further programming and make config-edit function.
git-svn-id: svn://svn.alpinelinux.org/acf/openvpn/trunk@394 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'openvpn-controller.lua')
-rw-r--r-- | openvpn-controller.lua | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/openvpn-controller.lua b/openvpn-controller.lua index fcc90cb..c2f5a4c 100644 --- a/openvpn-controller.lua +++ b/openvpn-controller.lua @@ -47,8 +47,31 @@ status_info = function (self) end unknown_config = function (self) - local configname = self.clientdata.name or "" - return ( {configfilecontent = self.model:get_filecontent(configname), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller} ) + local filename = self.clientdata.name or "" + local filecontent = self.clientdata.modifications or "" + +---[[ + if ( filecontent ~= "") then + local me = ( {configfilecontent = self.model:update_filecontent(filename,filecontent), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller } ) + if ( me.configfilecontent == nil ) then + list_redir(self) + else + return me + end + else +---[=[ + local me = ( {configfilecontent = self.model:get_filecontent(filename), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller } ) + if ( me.configfilecontent == nil ) then + list_redir(self) + else + return me + end +--]=] +-- return ( {configfilecontent = self.model:get_filecontent(filename), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller} ) + + end +--]] + end logfile = function (self) |