diff options
author | Andreas Brodmann <andreas.brodmann@gmail.com> | 2008-01-14 15:16:51 +0000 |
---|---|---|
committer | Andreas Brodmann <andreas.brodmann@gmail.com> | 2008-01-14 15:16:51 +0000 |
commit | d3f6fac84e5ed293b121ce0d92f07eb438cf6c96 (patch) | |
tree | eabf5f56ff5ec31380a21ec78f035b964f64d087 /squid-controller.lua | |
parent | 7c8b2854e579402d546b41457828bf7622868d5a (diff) | |
download | acf-squid-d3f6fac84e5ed293b121ce0d92f07eb438cf6c96.tar.bz2 acf-squid-d3f6fac84e5ed293b121ce0d92f07eb438cf6c96.tar.xz |
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
Diffstat (limited to 'squid-controller.lua')
-rw-r--r-- | squid-controller.lua | 43 |
1 files changed, 38 insertions, 5 deletions
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 |