From 008e476ed54a6d9d3050f38dfc445de0cc2bd052 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Fri, 30 Nov 2007 09:51:20 +0000 Subject: 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 --- openvpn-controller.lua | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'openvpn-controller.lua') 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) -- cgit v1.2.3