summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openvpn-controller.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/openvpn-controller.lua b/openvpn-controller.lua
index 5876189..54a28e2 100644
--- a/openvpn-controller.lua
+++ b/openvpn-controller.lua
@@ -6,18 +6,18 @@ default_action = "status"
status = function (self)
-- FIXME: If return 1 rows go direct to that config-page
- return ( {conflistfiles = self.model:get_conflist(), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller, version = self.model:openvpn_version()} )
+ return ( {conflistfiles = self.model:get_conflist(), url = self.conf.script .. self.conf.prefix .. self.conf.controller, version = self.model:openvpn_version()} )
end
serverconfig = function (self)
local configname = self.clientdata.name or ""
- return ( {config = self.model:get_config(configname), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller} )
+ return ( {config = self.model:get_config(configname), url = self.conf.script .. self.conf.prefix .. self.conf.controller} )
end
clientconfig = function (self)
local configname = self.clientdata.name or ""
- return ( {config = self.model:get_config(configname), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller} )
+ return ( {config = self.model:get_config(configname), url = self.conf.script .. self.conf.prefix .. self.conf.controller} )
end
peminfo = function (self)
@@ -25,7 +25,7 @@ end
statusinfo = function (self)
local configname = self.clientdata.name or ""
- return ( {clientlist = self.model:clientlist(configname), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller} )
+ return ( {clientlist = self.model:clientlist(configname), url = self.conf.script .. self.conf.prefix .. self.conf.controller} )
end
unknownconfig = function (self)
@@ -34,7 +34,7 @@ unknownconfig = function (self)
---[[
if ( filecontent ~= "") then
- local me = ( {configfilecontent = self.model:update_filecontent(filename,filecontent), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller } )
+ local me = ( {configfilecontent = self.model:update_filecontent(filename,filecontent), url = self.conf.script .. self.conf.prefix .. self.conf.controller } )
if ( me.configfilecontent == nil ) then
redirect(self)
else
@@ -42,14 +42,14 @@ unknownconfig = function (self)
end
else
---[=[
- local me = ( {configfilecontent = self.model:get_filecontent(filename), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller } )
+ local me = ( {configfilecontent = self.model:get_filecontent(filename), url = self.conf.script .. self.conf.prefix .. self.conf.controller } )
if ( me.configfilecontent == nil ) then
redirect(self)
else
return me
end
--]=]
--- return ( {configfilecontent = self.model:get_filecontent(filename), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller} )
+-- return ( {configfilecontent = self.model:get_filecontent(filename), url = self.conf.script .. self.conf.prefix .. self.conf.controller} )
end
--]]
@@ -59,5 +59,5 @@ end
logfile = function (self)
local configname = self.clientdata.name or ""
-- FIXME: If return 0 rows, goto read
- return ( {logfilecontent = self.model:get_logfile(configname), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller } )
+ return ( {logfilecontent = self.model:get_logfile(configname), url = self.conf.script .. self.conf.prefix .. self.conf.controller } )
end