From d3f6fac84e5ed293b121ce0d92f07eb438cf6c96 Mon Sep 17 00:00:00 2001 From: Andreas Brodmann Date: Mon, 14 Jan 2008 15:16:51 +0000 Subject: 1) you can now change to auth methods 2) tags insertion into config file solved with default config 3) modifications on views to look better with css git-svn-id: svn://svn.alpinelinux.org/acf/squid/trunk@563 ab2d0c66-481e-0410-8bed-d214d4d58bed --- squid-controller.lua | 43 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) (limited to 'squid-controller.lua') diff --git a/squid-controller.lua b/squid-controller.lua index 03c6f7b..cb23c07 100644 --- a/squid-controller.lua +++ b/squid-controller.lua @@ -29,6 +29,26 @@ mvc.post_exec = function( self ) return pvt.parent_on_exec() end +dep = function( self ) + + if self.model.dependancy_ok() then + self.conf.type = "redir" + self.conf.action = "basic" + error(self.conf) + end + + if self.clientdata.cmd then + if self.clientdata.cmd == "create file" then + self.model.create_cfg_from_template() + self.conf.type = "redir" + self.conf.action = "basic" + error(self.conf) + end + end + + return +end + basic = function( self ) local option = { script = ENV["SCRIPT_NAME"], @@ -38,6 +58,12 @@ basic = function( self ) extra = "" } + if not self.model.dependancy_ok() then + self.conf.type = "redir" + self.conf.action = "dep" + error(self.conf) + end + local service = { message="", status="", error="" } if self.clientdata.srvcmd then local srvcmd = self.clientdata.srvcmd @@ -89,13 +115,20 @@ authentication = function( self ) end if self.clientdata.inout then + local newauth = "" if self.clientdata.inout == " << " then - local newauth = self.clientdata.authmethod - if #self.clientdata.tmpempty > 0 then - newauth = newauth .. self.clientdata.tmpempty + if self.clientdata.tmpempty then + newauth = self.clientdata.authmethod .. self.clientdata.tmpempty + end + elseif self.clientdata.inout == " >> " then + local tmpauth = self.clientdata.authmethod + local lap = 1 + while lap <= #tmpauth do + if string.sub( tmpauth, lap, lap ) ~= self.clientdata.tmpauth then + newauth = newauth .. string.sub( tmpauth, lap, lap ) + end + lap = lap + 1 end - else - end self.model.upd_authmethod(newauth) end -- cgit v1.2.3