summaryrefslogtreecommitdiffstats
path: root/openvpn-controller.lua
diff options
context:
space:
mode:
Diffstat (limited to 'openvpn-controller.lua')
-rw-r--r--openvpn-controller.lua27
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)