diff options
Diffstat (limited to 'squid-controller.lua')
-rw-r--r-- | squid-controller.lua | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/squid-controller.lua b/squid-controller.lua index 4e9c134..4d3ffa5 100644 --- a/squid-controller.lua +++ b/squid-controller.lua @@ -38,7 +38,7 @@ basic = function( self ) extra = "" } - local service = { message="", status="" } + local service = { message="", status="", error="" } if self.clientdata.srvcmd then local srvcmd = self.clientdata.srvcmd if srvcmd == "start" or srvcmd == "stop" or srvcmd == "restart" then @@ -47,7 +47,30 @@ basic = function( self ) end service.status = self.model.get_status() - service.config = self.model.get_basic_config() + service.config, service.error = self.model.get_basic_config() + + return ( cfe ({ option = option, service = service }) ) +end + +authentication = function( self ) + + local option = { script = ENV["SCRIPT_NAME"], + prefix = self.conf.prefix, + controller = self.conf.controller, + action = self.conf.action, + extra = "" + } + + local service = { message="", status="", error="" } + if self.clientdata.srvcmd then + local srvcmd = self.clientdata.srvcmd + if srvcmd == "start" or srvcmd == "stop" or srvcmd == "restart" then + service.message = self.model.service_control( srvcmd ) + end + end + + service.status = self.model.get_status() + service.config, service.error = self.model.get_basic_config() return ( cfe ({ option = option, service = service }) ) end |