diff options
Diffstat (limited to 'dansguardian-category-html.lsp')
-rw-r--r-- | dansguardian-category-html.lsp | 75 |
1 files changed, 28 insertions, 47 deletions
diff --git a/dansguardian-category-html.lsp b/dansguardian-category-html.lsp index 1edcc71..66c972d 100644 --- a/dansguardian-category-html.lsp +++ b/dansguardian-category-html.lsp @@ -37,61 +37,42 @@ displayinfo(myform,tags,"viewonly") ?> </DL> -<h2>General Information</h2> -<p>DansGuardian is web content filtering software. It works as a web proxy, -making web requests in behalf of the client, and inspecting the returned -content before passing on to the client. DansGuardian uses phraselists to -identify harmful content. This means that updated "blacklists" are -generally not necessary. DansGuardian must be used in combination with a -"smart proxy", such as squid. -<b>This page lets you manually add/remove categories for DansGuardian.</b></p> +<h1>Modify Categories</h1> -<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> - -<h1>Categories</h1> -<h2>Add Category</h2> -<p> -To add a category, or to add a file to an existing category, please fill in the corresponding information below. -(Due to a limitation with DansGuardian, all categories must be lowercase.) -</p> -<dl> -<dt>Category name</dt><dd><input class="text" type="text" name="newcat" value=""></dd> -<dt>Category files</dt><dd><input type="checkbox" name="cattype" value="w">weighted <input type="checkbox" name="cattype" value="b">banned <input type="checkbox" name="cattype" value="e">exception</dd> -<? -local myform = form.service -local tags = { "cmdadd", } -displayinfo(myform,tags) -?> -</dl> - -<p><pre class=error><? io.write( service.cfgerr ) ?></pre></p> -<p></p> - -<h2>Delete Category</h2> -<p> -Select the categories you wish to delete. Please note that this deletes the category, but does not -delete the link in the corresponding phraselist above. You will also need to edit the phraselist file -above if you delete a category. -</p> +<h2>Category list</h2> <form action="" method="POST"> <dl> -<dt>Categories available</dt><dd>(please check the ones you want to delete) <? - for k,v in ipairs( config ) do - io.write( "<BR><input type=\"checkbox\" name=\"cats\" value=\"" .. v .. "\"> " .. v .. "\n" ) - end -?> -</DD> -<? -local myform = form.service -local tags = { "cmddelete", } -displayinfo(myform,tags) +local myform = form["service"]["config"]["categories"]["value"] +for k,v in ipairs( myform ) do + io.write("<DT ") + if not (v.active) then io.write("CLASS='error'") end + io.write("><img src='/static/tango/16x16/categories/applications-system.png' height='16' width='16'> "..v.name.."</DT>\n") + io.write("<DD><TABLE>") + if (v.option) then + for k1,v1 in pairs(v.option) do + io.write("<TR><TD STYLE='font-weight:bold;' WIDTH='180px' ") + if not (v1.active) then io.write("CLASS='error'") end + io.write(">".. v1.name .. "</TD><TD>[ <A HREF='editcategories?phrase=".. v.name .. "&object=".. v1.name .. "'>Edit</A> ]</TD></TD>" ) +-- for k2,v2 in pairs(v1) do + --io.write(html.form(v1.type(v1))) +-- io.write("<TD>") +-- io.write("[ " ..html.link(v2) .. " ] ") +-- io.write(tostring(v2)) +-- io.write("</TD>") +-- end + io.write("</TR>\n") + end + io.write("<TR><TD STYLE='font-weight:bold;' WIDTH='180px'><INPUT TYPE='text' CLASS='text'></TD><TD><INPUT TYPE='submit' CLASS='submit' VALUE='Create' disabled></TD></TD></TR>\n" ) + end + io.write("</TABLE></DD>") +--io.write( "<BR><input type=\"checkbox\" name=\"cats\" value=\"" .. v .. "\"> " .. v .. "\n" ) +end ?> </dl> </form> + <h1>MANAGEMENT</h1> <form action="" method="POST"> <dl> |