Commit cc38597b authored by Natanael Copa's avatar Natanael Copa

use <% %> instead of <? ?>

git-svn-id: svn://svn.alpinelinux.org/acf/dansguardian/trunk@1323 ab2d0c66-481e-0410-8bed-d214d4d58bed
parent b31fe6b5
<?
<%
require("viewfunctions")
local form = ...
local data = form.option
......@@ -18,32 +18,32 @@ require("viewfunctions")
end
end
?>
%>
<?
<%
--[[ DEBUG INFORMATION
io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
io.write(html.cfe_unpack(form))
io.write("</span>")
--]]
?>
%>
<H1>SYSTEM INFO</H1>
<DL>
<?
<%
local myform = form.info
local tags = { "status", "version", "autostart", }
displayinfo(myform,tags,"viewonly")
?>
%>
</DL>
<h1>Configuration</h1>
<? if (#service.cfgerr > 0) then ?>
<% if (#service.cfgerr > 0) then %>
<h2>Errors</h2>
<DL><DT>Config errors</DT>
<DD><pre class=error><? io.write( service.cfgerr ) ?></pre></DD>
<DD><pre class=error><% io.write( service.cfgerr ) %></pre></DD>
</DL>
<? end ?>
<% end %>
<TABLE>
<TR style="background:#eee;font-weight:bold;">
......@@ -52,19 +52,19 @@ displayinfo(myform,tags,"viewonly")
<TD style="white-space:nowrap;text-align:left;" class="header">Last Modified</TD>
</TR>
<?
<%
for k,v in ipairs( config.files ) do
io.write( "<tr><td><a href=\"" .. data.script .. data.prefix .. data.controller .. "/edit?name=" .. v.path .. "\">" .. v.path .. "</a></td><td>" .. (v.size or "--") .."</td><td>" .. (v.mtime or "--") .."</td></tr>\n" )
end
?>
%>
</TABLE>
<h1>MANAGEMENT</h1>
<form action="" method="POST">
<dl>
<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 ) ?>>
<? if (service.message) and (service.message.descr) and (#service.message.descr > 0) then ?><pre><? io.write( service.message.descr ) ?></pre><? end ?></dd>
<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 ) %>>
<% if (service.message) and (service.message.descr) and (#service.message.descr > 0) then %><pre><% io.write( service.message.descr ) %></pre><% end %></dd>
</dl>
</form>
<?
<%
require("viewfunctions")
local form = ...
local data = form.option
......@@ -18,23 +18,23 @@ require("viewfunctions")
end
end
?>
%>
<?
<%
--[[ DEBUG INFORMATION
io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
io.write(html.cfe_unpack(form))
io.write("</span>")
--]]
?>
%>
<H1>SYSTEM INFO</H1>
<DL>
<?
<%
local myform = form.info
local tags = { "status", "version", "autostart", }
displayinfo(myform,tags,"viewonly")
?>
%>
</DL>
<h1>Modify Categories</h1>
......@@ -42,7 +42,7 @@ displayinfo(myform,tags,"viewonly")
<h2>Category list</h2>
<form action="" method="POST">
<dl>
<?
<%
local myform = form["service"]["config"]["categories"]
for k,v in ipairs( myform ) do
io.write("<DT ")
......@@ -68,7 +68,7 @@ for k,v in ipairs( myform ) do
io.write("</TABLE></DD>")
--io.write( "<BR><input type=\"checkbox\" name=\"cats\" value=\"" .. v .. "\"> " .. v .. "\n" )
end
?>
%>
</dl>
</form>
......@@ -76,9 +76,9 @@ end
<h1>MANAGEMENT</h1>
<form action="" method="POST">
<dl>
<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 ) ?>>
<? if (service.message) and (service.message.descr) and (#service.message.descr > 0) then ?><pre><? io.write( service.message.descr ) ?></pre><? end ?></dd>
<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 ) %>>
<% if (service.message) and (service.message.descr) and (#service.message.descr > 0) then %><pre><% io.write( service.message.descr ) %></pre><% end %></dd>
</dl>
</form>
<?
<%
local form = ...
local data = form.option
local service = form.service
......@@ -17,15 +17,15 @@
end
end
?>
<h1>Content Filter (<? io.write( service.name ) ?>)</h1>
%>
<h1>Content Filter (<% io.write( service.name ) %>)</h1>
<form action="" method="POST">
<p><pre class=error><? io.write( service.cfgerr ) ?></pre></p>
<p><pre class=error><% io.write( service.cfgerr ) %></pre></p>
<p>These parameters define the interface and port that Dansguardian uses to accept connections.</p>
<textarea name="config"><? io.write( service.config ) ?></textarea>
<input class="text" type="hidden" name="name" value="<? io.write( service.name ) ?>">
<textarea name="config"><% io.write( service.config ) %></textarea>
<input class="text" type="hidden" name="name" value="<% io.write( service.name ) %>">
<h3>Save Changes</h3>
<dl><dt>Save the content of the above box</dt><dd><input class="submit" type="submit" name="cmd" value="save"></dd></dl>
......
<? local form = ...
<% local form = ...
require("viewfunctions")
?>
<?
%>
<%
--[[ DEBUG INFORMATION
io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
io.write(html.cfe_unpack(form))
io.write("</span>")
--]]
?>
%>
<H1>INFO</H1>
<DL>
<?
<%
local myform = form.info
local tags = { "configfile","mtime","category", "name", "activestatus", }
displayinfo(myform,tags,"viewonly")
?>
%>
</DL>
<H1>CONFIGURE</H1>
<H2>General</H2>
<DL>
<?
<%
local myform = form.info
local tags = { "activate" }
displayinfo(myform,tags)
?>
%>
</DL>
<H2>Details</H2>
<?
<%
local myform = form.info
io.write('<input type="hidden" value="' .. myform.filename.value .. '" name="name">')
io.write(html.form[myform.filecontent.type](myform.filecontent))
?>
%>
<H2>Save</H2>
<DL>
<?
<%
local myform = form.info
local tags = { "cmdsave" }
displayinfo(myform,tags)
?>
%>
</DL>
<H1>Delete</H1>
<p>You can delete this object. This will result in erazing instead of deactivating it.</p>
<p>When deleting a object, you will not be able to get it back! If you are unsure, it's better to only deactivate this object instead of deleting it.</p>
<DL>
<?
<%
local myform = form.info
local tags = { "cmddelete" }
displayinfo(myform,tags)
?>
%>
</DL>
<? --[[ ?>
<% --[[ %>
<form name="myform" action="" method="POST">
<h1>CONFIGURATION</h1>
<H2>Expert config</H2>
<h3>File details</h3>
<DL>
<?
<%
local myform = form.file
local tags = { "filename", "filesize", "mtime", "sumerrors", }
displayinfo(myform,tags,"viewonly")
?>
%>
</DL>
<H3>FILE CONTENT</H3>
<?
<%
local myform = form.file
io.write('<input type="hidden" value="' .. myform.filename.value .. '" name="name">')
io.write(html.form[myform.filecontent.type](myform.filecontent))
?>
%>
<H2>SAVE AND APPLY ABOVE SETTINGS</H2>
<DL>
<?
<%
local tags = { "cmddelete", "cmdsave", }
displayinfo(myform,tags)
?>
%>
</DL>
<?
<%
-- Management buttons
local myform = form.management
local tags = { "start", "stop", "restart" }
......@@ -92,7 +92,7 @@ if (myform) then
displaymanagement(myform,tags)
io.write("</DL>")
end
?>
%>
</form>
<? --]] ?>
<% --]] %>
<?
<%
require("viewfunctions")
local form = ...
local data = form.option
......@@ -18,23 +18,23 @@ require("viewfunctions")
end
end
?>
%>
<?
<%
--[[ DEBUG INFORMATION
io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
io.write(html.cfe_unpack(form))
io.write("</span>")
--]]
?>
%>
<H1>SYSTEM INFO</H1>
<DL>
<?
<%
local myform = form.info
local tags = { "status", "version", "autostart", }
displayinfo(myform,tags,"viewonly")
?>
%>
</DL>
<form action="" method="POST">
......@@ -45,8 +45,8 @@ These parameters define the interface and port that Dansguardian uses to accept
</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>
<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>
</dl>
<h2>Proxy service</h2>
......@@ -55,8 +55,8 @@ 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>
<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>
</dl>
<h2>Filter Actions</h2>
......@@ -67,20 +67,20 @@ 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>
<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>
</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 ?>
%>
<% 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>
......@@ -91,9 +91,9 @@ until you restart the service.</DD>
<h1>MANAGEMENT</h1>
<form action="" method="POST">
<dl>
<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 ) ?>>
<? if (service.message) and (service.message.descr) and (#service.message.descr > 0) then ?><pre><? io.write( service.message.descr ) ?></pre><? end ?></dd>
<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 ) %>>
<% if (service.message) and (service.message.descr) and (#service.message.descr > 0) then %><pre><% io.write( service.message.descr ) %></pre><% end %></dd>
</dl>
</form>
<?
<%
require("viewfunctions")
local form = ...
local data = form.option
......@@ -18,23 +18,23 @@ require("viewfunctions")
end
end
?>
%>
<?
<%
--[[ DEBUG INFORMATION
io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
io.write(html.cfe_unpack(form))
io.write("</span>")
--]]
?>
%>
<H1>SYSTEM INFO</H1>
<DL>
<?
<%
local myform = form.info
local tags = { "status", "version", "autostart", }
displayinfo(myform,tags,"viewonly")
?>
%>
</DL>
<h1>Content Filter (Plain Config File)</h1>
......@@ -48,22 +48,22 @@ You must be familiar with the configuration file before proceeding.</DD>
<form action="" method="POST">
<h2>Configuration</h2>
<textarea name="config"><? io.write( service.config ) ?></textarea>
<textarea name="config"><% io.write( service.config ) %></textarea>
<h2>Save changes</h2>
<dl>
<?
<%
local myform = form.service
local tags = { "cmdsave", }
displayinfo(myform,tags)
?>
<? if (service) and (service.error) and (#service.error > 0) then ?>
<DT>Config status</DT><DD class="error"><? io.write(service.error ) ?></DD>
<? end ?>
<? if (service) and (service.cfgerr) and (#service.cfgerr > 0) then ?>
<DT>Config status</DT><DD class="error"><? io.write(service.cfgerr ) ?></DD>
<? end ?>
%>
<% if (service) and (service.error) and (#service.error > 0) then %>
<DT>Config status</DT><DD class="error"><% io.write(service.error ) %></DD>
<% end %>
<% 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>
......@@ -75,9 +75,9 @@ until you restart the service.</DD>
<h1>MANAGEMENT</h1>
<form action="" method="POST">
<dl>
<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 ) ?>>
<? if (service.message) and (service.message.descr) and (#service.message.descr > 0) then ?><pre><? io.write( service.message.descr ) ?></pre><? end ?></dd>
<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 ) %>>
<% if (service.message) and (service.message.descr) and (#service.message.descr > 0) then %><pre><% io.write( service.message.descr ) %></pre><% end %></dd>
</dl>
</form>
<? local form = ...
<% local form = ...
require("viewfunctions")
?>
%>
<?
<%
--[[ DEBUG INFORMATION
io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
io.write(html.cfe_unpack(form))
io.write("</span>")
--]]
?>
%>
<H1>SYSTEM INFO</H1>
<DL>
<?
<%
local myform = form.info
local tags = { "status", "version", "autostart", }
displayinfo(myform,tags,"viewonly")
?>
%>
</DL>
<h2>General Information</h2>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment