summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--squid-authentication-html.lsp16
-rw-r--r--squid-controller.lua10
-rw-r--r--squid-model.lua22
-rw-r--r--squid-ntlm-html.lsp14
4 files changed, 42 insertions, 20 deletions
diff --git a/squid-authentication-html.lsp b/squid-authentication-html.lsp
index feef6c5..21cf071 100644
--- a/squid-authentication-html.lsp
+++ b/squid-authentication-html.lsp
@@ -6,7 +6,7 @@
local srv1fill = ""
local srv2fill = "disabled"
- if service.status == "running" then
+ if form.info.status.value == "running" then
srv1fill = "disabled"
srv2fill = ""
end
@@ -19,6 +19,7 @@
?>
<h1>Web Proxy</h1>
+<h2>General Information</h2>
<p>
Squid is a web proxy server. It makes web requests in behalf of the client, and
inspecting the returned and optionally caches that content so that the next time
@@ -31,8 +32,13 @@ This page lets you modify the authentication scheme of squid.
</p>
<h2>Status</h2>
+<dt>Program version</dt><dd><? io.write( form.info.version.value ) ?></dd>
+<dt>Process status</dt><dd><? io.write( form.info.status.value ) ?></dd>
+<dt>Process information</dt><dd>This process runs as a service. When you make
+and save changes, the configuration files for the service are changed. However,
+the changes will not be <i>applied</i> until you restart the service.</dd>
<form action="" method="POST">
-<dt>squid is: <? io.write( service.status ) ?></dt>
+<dt>Daemon control</dt>
<dd><input class="submit" type="submit" name="srvcmd" value="start" <? io.write( srv1fill ) ?>>
<input class="submit" type="submit" name="srvcmd" value="stop" <? io.write( srv2fill ) ?>>
<input class="submit" type="submit" name="srvcmd" value="restart" <? io.write( srv2fill ) ?>></dd>
@@ -42,12 +48,6 @@ This page lets you modify the authentication scheme of squid.
<pre style="color: #ff2020;"><? io.write( service.message ) ?></pre>
</p>
-<p>
-This process runs as a service. When you make and save changes, the configuration
-files for the service are changed. However, the changes will not be <i>applied</i>
-until you restart the service.
-</p>
-
<form action="" method="POST">
<h2>Configuration</h2>
diff --git a/squid-controller.lua b/squid-controller.lua
index f6a90f2..1c093db 100644
--- a/squid-controller.lua
+++ b/squid-controller.lua
@@ -102,6 +102,8 @@ end
authentication = function( self )
+ local info = { status = { value = "stopped" }, version = { value = self.model.get_squid_version() }, srvctrl = { value = srvctrl} };
+
local option = { script = ENV["SCRIPT_NAME"],
prefix = self.conf.prefix,
controller = self.conf.controller,
@@ -139,9 +141,10 @@ authentication = function( self )
end
service.status = self.model.get_status()
+ info.status.value = service.status
service.config, service.error = self.model.get_basic_config()
- return ( cfe ({ option = option, service = service }) )
+ return ( cfe ({ option = option, service = service, info = info }) )
end
advanced = function( self )
@@ -197,6 +200,8 @@ end
ntlm = function( self )
+ local info = { status = { value = "stopped" }, version = { value = self.model.get_winbind_version() }, srvctrl = { value = srvctrl} };
+
local option = { script = ENV["SCRIPT_NAME"],
prefix = self.conf.prefix,
controller = self.conf.controller,
@@ -219,9 +224,10 @@ ntlm = function( self )
end
service.status = self.model.get_status_winbindd()
+ info.status.value = service.status
service.config = self.model.get_winbindd_config()
- return ( cfe ({ option = option, service = service }) )
+ return ( cfe ({ option = option, service = service, info = info }) )
end
saccess = function( self )
diff --git a/squid-model.lua b/squid-model.lua
index 3b55d60..5806a0a 100644
--- a/squid-model.lua
+++ b/squid-model.lua
@@ -70,15 +70,31 @@ get_squid_version = function()
local retval = ""
local ptr = io.popen( "/usr/sbin/squid -v" )
- retval = ptr:read( "*l" )
- ptr:close()
- if retval == nil then
+ if ptr ~= nil then
+ retval = ptr:read( "*l" )
+ ptr:close()
+ else
retval = "Error - can't retrieve squid version"
end
return retval
end
+get_winbind_version = function()
+
+ local retval = ""
+
+ local ptr = io.popen( "/usr/sbin/winbindd -V" )
+ if ptr ~= nil then
+ retval = ptr:read( "*l" )
+ ptr:close()
+ else
+ retval = "Error - can't retrieve winbindd version"
+ end
+
+ return retval
+end
+
get_status_winbindd = function()
local retval = "stopped"
diff --git a/squid-ntlm-html.lsp b/squid-ntlm-html.lsp
index ed11492..c5ce880 100644
--- a/squid-ntlm-html.lsp
+++ b/squid-ntlm-html.lsp
@@ -19,6 +19,7 @@
?>
<h1>Web Proxy - NTLM Authentication</h1>
+<h2>General Information</h2>
<p>
Winbindd is a service that allows squid to authenticate against a Windows Domain Controller.
Before authentication is possible, this machine must join the Windows domain and the winbindd
@@ -26,8 +27,13 @@ service must be (re)started. It is only necessary to join the domain once.
</p>
<h2>Status</h2>
+<dt>Program version</dt><dd><? io.write( form.info.version.value ) ?></dd>
+<dt>Process status</dt><dd><? io.write( form.info.status.value ) ?></dd>
+<dt>Process information</dt><dd>This process runs as a service. When you make
+and save changes, the configuration files for the service are changed. However,
+the changes will not be <i>applied</i> until you restart the service.</dd>
<form action="" method="POST">
-<dt>winbindd is: <? io.write( service.status ) ?></dt>
+<dt>Daemon control</dt>
<dd><input class="submit" type="submit" name="srvcmd" value="start" <? io.write( srv1fill ) ?> style="width:100px">
<input class="submit" type="submit" name="srvcmd" value="stop" <? io.write( srv2fill ) ?> style="width:100px">
<input class="submit" type="submit" name="srvcmd" value="restart" <? io.write( srv2fill ) ?> style="width:100px"></dd>
@@ -37,12 +43,6 @@ service must be (re)started. It is only necessary to join the domain once.
<pre style="color: #ff2020;"><? io.write( service.message ) ?></pre>
</p>
-<p>
-This process runs as a service. When you make and save changes, the configuration
-files for the service are changed. However, the changes will not be <i>applied</i>
-until you restart the service.
-</p>
-
<form action="" method="POST">
<h2>Configuration</h2>