diff options
author | Andreas Brodmann <andreas.brodmann@gmail.com> | 2008-01-07 16:14:57 +0000 |
---|---|---|
committer | Andreas Brodmann <andreas.brodmann@gmail.com> | 2008-01-07 16:14:57 +0000 |
commit | 9de83d7f39611b7660c93d467c89580d09103e16 (patch) | |
tree | 3665eb31bd5a2a4c59413928b8ff61435b3d5a48 /squid-model.lua | |
parent | f17d7604c6ece24b395d78210b9fd68d2525f083 (diff) | |
download | acf-squid-9de83d7f39611b7660c93d467c89580d09103e16.tar.bz2 acf-squid-9de83d7f39611b7660c93d467c89580d09103e16.tar.xz |
updated /acf/squid digest auth / ntlm auth / special access
git-svn-id: svn://svn.alpinelinux.org/acf/squid/trunk@497 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'squid-model.lua')
-rw-r--r-- | squid-model.lua | 135 |
1 files changed, 135 insertions, 0 deletions
diff --git a/squid-model.lua b/squid-model.lua index 6c272c6..7e7fed7 100644 --- a/squid-model.lua +++ b/squid-model.lua @@ -64,6 +64,22 @@ get_status = function() return retval end +get_status_winbindd = function() + + local retval = "stopped" + + local ptr = io.popen( "/bin/pidof winbindd" ) + local pid = ptr:read( "*a" ) + ptr:close() + if pid ~= nil then + if #pid > 1 then + retval = "running" + end + end + + return retval +end + service_control = function( control ) local retval = "" @@ -84,6 +100,47 @@ service_control = function( control ) return retval end +service_control_winbindd = function( control ) + + local retval = "" + + local ptr = io.popen( "/etc/init.d/winbindd " .. control, "r" ) + if ptr ~= nil then + local retmsg = ptr:read( "*a" ) + ptr:close() + if retmsg ~= nil then + retval = retmsg + else + retval = "service_control(): Failed to read output from initscript!\n" + end + else + retval = "service_control(): Failed to start/stop/restart service!\n" + end + + return retval +end + +get_winbindd_config = function() + + local error = "" + local config = { domain = { value="", type="text", label="domain" }, + dcname = { value="", type="text", label="DC NetBIOS name" }, + dcipaddr = { value="", type="text", label="DC IP Address" }, + interfaces = { value="", type="text", label="interfaces" }, + loglevel = { value="", type="text", label="0" }, + account = { value="", type="text", label="account" }, + password = { value="", type="text", label="password" } + } + + local ptr = io.open( "/etc/samba/smb.conf" ) + if ptr ~= nil then + + else + + end + +end + get_adv_config = function() local retval = "" @@ -102,6 +159,71 @@ get_adv_config = function() return retval end +get_digest_userlist = function() + + local retval = "" + + local ptr = io.open( "/etc/squid/users.list" ) + if ptr ~= nil then + local retcfg = ptr:read( "*a" ) + ptr:close() + if retcfg == nil then + retval = "\n\n Error: Failed to read user/password list!\n\n" + else + retval = retcfg + end + end + + return retval +end + +get_saccess = function() + + local config = {} + + config.s_ip = get_file_contents( "/etc/squid/anoniplist" ) + config.s_browser = get_file_contents( "/etc/squid/anonbrowserlist" ) + config.s_domain = get_file_contents( "/etc/squid/anondomainlist" ) + + return config +end + +update_saccess = function( config ) + + write_file_contents( "/etc/squid/anoniplist", config.s_ip ) + write_file_contents( "/etc/squid/anonbrowserlist", config.s_browser ) + write_file_contents( "/etc/squid/anondomainlist", config.s_domain ) + + return +end + +write_file_contents = function( name, contents ) + + local ptr = io.open( name, "wb+" ) + if ptr ~= nil then + ptr:write( format.dostounix( contents ) ) + ptr:close() + end + + return +end + +get_file_contents = function( name ) + + local retval = "" + + local ptr = io.open( name ) + if ptr ~= nil then + retval = ptr:read( "*a" ) + ptr:close() + if retval == nil then + retval = "" + end + end + + return retval +end + update_adv_config = function( config ) local retval = "Successfully updated " .. squidconf .. "!" @@ -117,6 +239,19 @@ update_adv_config = function( config ) return retval end +update_digest_userlist = function( config ) + + local retval = "Successfully updated user list!" + + local ptr = io.open( "/etc/squid/users.list", "wb+" ) + if ptr ~= nil then + ptr:write( format.dostounix( config ) ) + ptr:close() + else + retval = "Update Digest User List: Error, failed to open /etc/squid/users.list!\n" + end +end + get_conf_tag = function( tag, gat ) local retval = "" |