summaryrefslogtreecommitdiffstats
path: root/dansguardian-general-html.lsp
diff options
context:
space:
mode:
Diffstat (limited to 'dansguardian-general-html.lsp')
-rw-r--r--dansguardian-general-html.lsp40
1 files changed, 20 insertions, 20 deletions
diff --git a/dansguardian-general-html.lsp b/dansguardian-general-html.lsp
index 6c0ca60..e7bd1af 100644
--- a/dansguardian-general-html.lsp
+++ b/dansguardian-general-html.lsp
@@ -1,9 +1,6 @@
<%
require("viewfunctions")
local form, viewlibrary = ...
- local service = form.service
- local config = form.service.config
-
%>
<%
@@ -20,14 +17,23 @@ end %>
<form action="" method="POST">
<h1>Configuration</h1>
+<%
+ if form.descr then io.write('<P CLASS="descr">' .. string.gsub(form.descr, "\n", "<BR>") .. "</P>\n") end
+ if form.errtxt then io.write('<P CLASS="error">' .. string.gsub(form.errtxt, "\n", "<BR>") .. "</P>\n") end
+ for field,val in pairs(form.value) do
+ val.name = field
+ end
+%>
<h2>General</h2>
<p>
These parameters define the interface and port that Dansguardian uses to accept connections.
</p>
<dl>
-<dt>filterip</dt><dd><input class="text" type="text" name="filterip" value="<% io.write( config.filterip.value ) %>" ></dd>
-<dt>filterport</dt><dd><input class="text" type="text" name="filterport" value="<% io.write( config.filterport.value ) %>" ></dd>
+<%
+ displayformitem(form.value.filterip)
+ displayformitem(form.value.filterport)
+%>
</dl>
<h2>Proxy service</h2>
@@ -36,8 +42,10 @@ These parameters define the ip address and port that Dansguardian should forward
</p>
<dl>
-<dt>proxyip</dt><dd><input class="text" type="text" name="proxyip" value="<% io.write( config.proxyip.value ) %>"></dd>
-<dt>proxyport</dt><dd><input class="text" type="text" name="proxyport" value="<% io.write( config.proxyport.value ) %>"></dd>
+<%
+ displayformitem(form.value.proxyip)
+ displayformitem(form.value.proxyport)
+%>
</dl>
<h2>Filter Actions</h2>
@@ -48,23 +56,15 @@ The author recommends 50 for "young children", 100 for "older children" and 160
</p>
<dl>
-<dt>accessdeniedaddress</dt><dd><input class="text" type="text" name="accessdeniedaddress" value="<% io.write( config.accessdeniedaddress.value ) %>"></dd>
-<dt>naughtynesslimit</dt><dd><input class="text" type="text" name="naughtynesslimit" value="<% io.write( config.naughtynesslimit.value ) %>"></dd>
+<%
+ displayformitem(form.value.accessdeniedaddress)
+ displayformitem(form.value.naughtynesslimit)
+%>
</dl>
<h2>Save Changes</h2>
<dl>
-<%
-local myform = form.service
-local tags = { "cmdsave", }
-displayinfo(myform,tags)
-%>
-<% if (service) and (service.cfgerr) and (#service.cfgerr > 0) then %>
-<DT>Config status</DT><DD class="error"><% io.write(service.cfgerr ) %></DD>
-<% end %>
-<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>
+<DT></DT><DD><input class="submit" type="submit" name="<%= form.option %>" value="<%= (form.submit or form.option) %>"></DD>
</dl>
</form>