summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-09-22 20:58:06 +0000
committerTed Trask <ttrask01@yahoo.com>2008-09-22 20:58:06 +0000
commitca8952c1a3f5107563020604585ada9f6b088860 (patch)
tree637a8fbe876a688ad45b1b619f24947b3824a1cb
parent3f3cf113c69e8fc334ae6c12559a2e5ec8406a0b (diff)
downloadacf-shorewall-ca8952c1a3f5107563020604585ada9f6b088860.tar.bz2
acf-shorewall-ca8952c1a3f5107563020604585ada9f6b088860.tar.xz
Rewrite of shorewall to use new libraries, ... Moved statusbasic to status, status to details, expert to listfiles. Changed check to not have a page. Used links for status, edit, startstop. Didn't change config, so it still doesn't work.
git-svn-id: svn://svn.alpinelinux.org/acf/shorewall/trunk@1480 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--shorewall-check-html.lsp38
-rw-r--r--shorewall-config-html.lsp2
-rw-r--r--shorewall-controller.lua149
-rw-r--r--shorewall-details-html.lsp19
l---------[-rw-r--r--]shorewall-edit-html.lsp53
-rw-r--r--shorewall-expert-html.lsp35
-rw-r--r--shorewall-listfiles-html.lsp45
-rw-r--r--shorewall-logfile-html.lsp21
-rw-r--r--shorewall-model.lua261
l---------[-rw-r--r--]shorewall-startstop-html.lsp27
l---------[-rw-r--r--]shorewall-status-html.lsp24
-rw-r--r--shorewall-statusbasic-html.lsp17
-rw-r--r--shorewall.menu5
-rw-r--r--shorewall.roles4
14 files changed, 183 insertions, 517 deletions
diff --git a/shorewall-check-html.lsp b/shorewall-check-html.lsp
deleted file mode 100644
index 6e39399..0000000
--- a/shorewall-check-html.lsp
+++ /dev/null
@@ -1,38 +0,0 @@
-<% local form, viewlibrary = ...
-require("viewfunctions")
---[[ DEBUG INFORMATION
-io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
-io.write(html.cfe_unpack(view))
-io.write("</span>")
---]]
-%>
-
-<% if viewlibrary and viewlibrary.dispatch_component then
- viewlibrary.dispatch_component("statusbasic")
-end %>
-
-<H1>CONFIGURATION</H1>
-<% local myform = form.config %>
-
-<H2>CHECK CONFIGURATION</H2>
-<%
-io.write(html.form[form.config.checkresult.type](form.config.checkresult))
-%>
-
-<form name="management" action="" method="POST">
-<%
--- Management buttons
-local myform = form.management
-local tags = { "restart" }
-if (myform) then
- io.write("<H1>MANAGEMENT</H1>\n<DL>")
- displaymanagement(myform,tags)
- io.write("</DL>")
-end
-%>
-</form>
-
-<% if viewlibrary and viewlibrary.dispatch_component then
- viewlibrary.dispatch_component("startstop")
-end %>
-
diff --git a/shorewall-config-html.lsp b/shorewall-config-html.lsp
index 5704df8..c14d453 100644
--- a/shorewall-config-html.lsp
+++ b/shorewall-config-html.lsp
@@ -31,7 +31,7 @@ local descr = {
%>
<% if viewlibrary and viewlibrary.dispatch_component then
- viewlibrary.dispatch_component("statusbasic")
+ viewlibrary.dispatch_component("status")
end %>
<% local myform = form.config %>
diff --git a/shorewall-controller.lua b/shorewall-controller.lua
index 967c4d6..da88e40 100644
--- a/shorewall-controller.lua
+++ b/shorewall-controller.lua
@@ -1,9 +1,7 @@
module(..., package.seeall)
--- This is the object/text used when we want to add a new record
-
-require("format")
-
+require("controllerfunctions")
+--[[
local newrecordtxt = "[New]"
-- ################################################################################
@@ -18,12 +16,40 @@ local function displaycmdsave(self)
})
return cmdsave
end
-
+--]]
-- ################################################################################
-- PUBLIC FUNCTIONS
default_action = "status"
+function status(self)
+ return self.model.getstatus()
+end
+
+function details(self)
+ return self.model.getstatusdetails()
+end
+
+function startstop(self)
+ return controllerfunctions.handle_startstop(self, self.model.startstop_service, self.model.getstatus, self.clientdata)
+end
+
+function listfiles(self)
+ return self.model.getfilelist()
+end
+
+function edit(self)
+ return controllerfunctions.handle_form(self, function() return self.model.getfiledetails(self.clientdata.filename) end, self.model.updatefiledetails, self.clientdata, "Save", "Edit File", "File Saved")
+end
+
+function check(self)
+ return self:redirect_to_referrer(self.model.configcheck())
+end
+
+function logfile(self)
+ return self.model.getlogfile()
+end
+--[[
function editrecords(self,types,record,errormessage)
local recorddetails = {}
local edit = {}
@@ -445,17 +471,6 @@ function editrecords(self,types,record,errormessage)
}
end
-function status(self)
- return { status=self.model.getstatusdetails() }
-end
-function statusbasic(self)
- return {
- status=self.model.getstatus(),
- version=self.model.getversion(),
- autostart=self.model.getautostart(),
- }
-end
-
function config(self)
-- If we made some changes to a recods... then proceed with the modification
@@ -623,104 +638,4 @@ function config(self)
configmessage=configmessage,
}
end
-
-function check(self)
-
- local config = self.model:configcheck()
-
- return {
- option={ script=self.conf.script,
- prefix=self.conf.prefix,
- controller = self.conf.controller,
- action = "expert",
- link = self.conf.script .. self.conf.prefix .. self.conf.controller, },
- config = config,
- startstop = startstop,
- debugclientdata = self.clientdata,
- }
-
-end
-
-function logfile(self)
-
- local config = self.model:getlogfile()
-
- return {
- option={ script=self.conf.script,
- prefix=self.conf.prefix,
- controller = self.conf.controller,
- action = "expert",
- link = self.conf.script .. self.conf.prefix .. self.conf.controller, },
- config = config,
- startstop = startstop,
- debugclientdata = self.clientdata,
- }
-
-end
-
-function expert(self)
- return {
- option={ script=self.conf.script,
- prefix=self.conf.prefix,
- controller = self.conf.controller,
- action = "expert",
- link = self.conf.script .. self.conf.prefix .. self.conf.controller, },
- config = self.model:getfilelist(),
- startstop = startstop,
- debugclientdata = self.clientdata,
- }
-end
-
-function edit(self)
-
- -- Save changes
- local cmdsaveresult, cmdsaveerror
- if ( self.clientdata.cmdsave) then
- local filetochange = cfe ({ name=self.clientdata.filename, value=self.clientdata.filecontent, })
- cmdsaveresult, cmdsaveerror = self.model:updatefilecontent(filetochange)
- self.clientdata.name = self.clientdata.filename
- end
-
- local config = self.model:getfiledetails(cfe({
- name="editfile",
- value=self.clientdata.name,
- }))
-
- -- Display save button
- config.cmdsave = displaycmdsave()
- if (cmdsaveresult) then
- config.cmdsave.descr="* Changes has been saved!"
- redirect(self,"expert")
- end
-
- return {
- option={ script=self.conf.script,
- prefix=self.conf.prefix,
- controller = self.conf.controller,
- action = "edit",
- link = self.conf.script .. self.conf.prefix .. self.conf.controller, },
- modifications = modifications,
- config = config,
- startstop = startstop,
- debugclientdata = self.clientdata,
- }
-
-end
-
-function startstop(self)
- local result
- if self.clientdata.action then
- result = self.model:startstop_service(self.clientdata.action)
- self.sessiondata.syslogstartstopresult = result
- self.redirect_to_referrer(self)
- end
-
- local status = self.model.getstatus()
- if self.sessiondata.syslogstartstopresult then
- result = self.sessiondata.syslogstartstopresult
- self.sessiondata.syslogstartstopresult = nil
- end
-
- return cfe({ type="group", value={status=status, result=result} })
-end
-
+--]]
diff --git a/shorewall-details-html.lsp b/shorewall-details-html.lsp
new file mode 100644
index 0000000..d5a65ec
--- /dev/null
+++ b/shorewall-details-html.lsp
@@ -0,0 +1,19 @@
+<% local data, viewlibrary = ...
+require("viewfunctions")
+--[[ DEBUG INFORMATION
+io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
+io.write(html.cfe_unpack(viewlibrary))
+io.write("----------")
+io.write(html.cfe_unpack(data))
+io.write("</span>")
+--]]
+%>
+
+<% if viewlibrary and viewlibrary.dispatch_component then
+ viewlibrary.dispatch_component("status")
+end %>
+
+<H2><%= data.label %></H2>
+<PRE>
+<%= data.value %>
+</PRE>
diff --git a/shorewall-edit-html.lsp b/shorewall-edit-html.lsp
index f808a72..15b1930 100644..120000
--- a/shorewall-edit-html.lsp
+++ b/shorewall-edit-html.lsp
@@ -1,52 +1 @@
-<% local form, viewlibrary = ...
-require("viewfunctions")
-%>
-
-<% if viewlibrary and viewlibrary.dispatch_component then
- viewlibrary.dispatch_component("statusbasic")
-end %>
-
-<H1>CONFIGURATION</H1>
-<% local myform = form.config %>
-<form action="<%= form.option.script .. "/" .. form.option.prefix ..
- form.option.controller .. "/" .. form.option.action %>" method="POST">
-
-<H2>EXPERT CONFIGURATION</H2>
-<H3>FILE DETAILS</H3>
-<DL>
-<%
-local tags = { "filename","filesize", "mtime", "sumerrors" }
-displayinfo(myform,tags,"viewonly")
-%>
-</DL>
-
-<% if (form.config.filecontent) then %>
-
-<H3>FILE CONTENT</H3>
-<input type="hidden" value="<%= myform.filename.value %>" name="<%= myform.filename.name %>">
-<%
-io.write(html.form[form.config.filecontent.type](form.config.filecontent))
-%>
-
-<H2>SAVE AND APPLY ABOVE SETTINGS</H2>
-<DL>
-<%
-local tags = { "cmdsave", }
-displayinfo(myform,tags)
-%>
-</DL>
-
-<% end %>
-
-<%
--- Management buttons
-local myform = form.management
-local tags = { "start", "stop", "restart" }
-if (myform) then
- io.write("<H1>MANAGEMENT</H1>\n<DL>")
- displaymanagement(myform,tags)
- io.write("</DL>")
-end
-%>
-</form>
-
+../filedetails-html.lsp \ No newline at end of file
diff --git a/shorewall-expert-html.lsp b/shorewall-expert-html.lsp
deleted file mode 100644
index 61ad046..0000000
--- a/shorewall-expert-html.lsp
+++ /dev/null
@@ -1,35 +0,0 @@
-<% local form, viewlibrary = ...
-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>")
---]]
-%>
-
-<% if viewlibrary and viewlibrary.dispatch_component then
- viewlibrary.dispatch_component("statusbasic")
-end %>
-
-<h1>EXPERT CONFIGURATION</h1>
-
-<% local myform = form.config %>
-<TABLE>
- <TR style="background:#eee;font-weight:bold;">
- <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">File</TD>
- <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Size</TD>
- <TD style="white-space:nowrap;text-align:left;" class="header">Last Modified</TD>
- </TR>
-
-
-<% for i = 1, table.maxn(myform) do %>
- <TR>
- <TD style="padding-right:20px;white-space:nowrap;"><%= html.link{value = "edit?name=" .. myform[i].value , label=myform[i].value } %></TD>
- <TD style="padding-right:20px;white-space:nowrap;"><%= myform[i].size %></TD>
- <TD style="white-space:nowrap;" width="90%"><%= myform[i].mtime %></TD>
- </TR>
-<% end %>
-</TABLE>
-
diff --git a/shorewall-listfiles-html.lsp b/shorewall-listfiles-html.lsp
new file mode 100644
index 0000000..df002b2
--- /dev/null
+++ b/shorewall-listfiles-html.lsp
@@ -0,0 +1,45 @@
+<% local data, viewlibrary, page_info, session = ...
+require("viewfunctions")
+%>
+<%
+--[[ DEBUG INFORMATION
+io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
+io.write(html.cfe_unpack(data))
+io.write("</span>")
+--]]
+%>
+
+<% displaycommandresults({"check"}, session) %>
+
+<% if viewlibrary and viewlibrary.dispatch_component then
+ viewlibrary.dispatch_component("status")
+end %>
+
+<h1><%= data.label %></h1>
+
+<TABLE>
+ <TR style="background:#eee;font-weight:bold;">
+ <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">File</TD>
+ <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Size</TD>
+ <TD style="white-space:nowrap;text-align:left;" class="header">Last Modified</TD>
+ </TR>
+
+
+<% for i,file in ipairs(data.value) do %>
+ <TR>
+ <TD style="padding-right:20px;white-space:nowrap;"><%= html.link{value = "edit?filename=" .. file.filename, label=file.filename} %></TD>
+ <TD style="padding-right:20px;white-space:nowrap;"><%= file.filesize %></TD>
+ <TD style="white-space:nowrap;" width="90%"><%= file.mtime %></TD>
+ </TR>
+<% end %>
+</TABLE>
+<DL>
+<form action="<%= page_info.script .. page_info.prefix .. page_info.controller .. "/check" %>">
+<DT>Check Configuration</DT>
+<DD><input class="submit" type="submit" value="Check"></DD>
+</form>
+</DL>
+
+<% if viewlibrary and viewlibrary.dispatch_component then
+ viewlibrary.dispatch_component("startstop")
+end %>
diff --git a/shorewall-logfile-html.lsp b/shorewall-logfile-html.lsp
index d3343b7..e939464 100644
--- a/shorewall-logfile-html.lsp
+++ b/shorewall-logfile-html.lsp
@@ -1,27 +1,12 @@
-<% local form, viewlibrary = ...
+<% local data, viewlibrary = ...
require("viewfunctions")
--[[ DEBUG INFORMATION
io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
-io.write(html.cfe_unpack(view))
+io.write(html.cfe_unpack(data))
io.write("</span>")
--]]
%>
<% if viewlibrary and viewlibrary.dispatch_component then
- viewlibrary.dispatch_component("statusbasic")
+ viewlibrary.dispatch_component("alpine-baselayout/logfiles/view", {name=data.value, grep="Shorewall"})
end %>
-
-<H1>LOGIFLES</H1>
-<H2>DETAILS</H2>
-<% local myform = form.config %>
-<H3>FILE DETAILS</H3>
-<DL>
-<%
-local tags = { "filename", "filesize", "mtime", "sumerrors" }
-displayinfo(myform,tags,"viewonly")
-%>
-</DL>
-
-<H3>FILE CONTENT</H3><%
-io.write(html.form[form.config.checkresult.type](form.config.checkresult))
-%>
diff --git a/shorewall-model.lua b/shorewall-model.lua
index a8627c7..53e56d7 100644
--- a/shorewall-model.lua
+++ b/shorewall-model.lua
@@ -1,45 +1,21 @@
module(..., package.seeall)
-- Load libraries
+require("modelfunctions")
require("fs")
-require("procps")
require("getopts")
-require("format")
-require("daemoncontrol")
-require("validator")
-require("processinfo")
-- Set variables
local configfile = "/etc/shorewall/shorewall.conf"
local processname = "shorewall"
local packagename = "shorewall"
local baseurl = "/etc/shorewall/"
+--[[
local config = {}
-- ################################################################################
-- LOCAL FUNCTIONS
-local function getloglevels()
- local loglevels = {}
- for i=1,8 do
- table.insert(loglevels,i)
- end
- return loglevels
-end
-
-local function getdetails()
- local f,error = io.popen("/sbin/shorewall status")
- local fake = f:read("*l")
- local fake = f:read("*l")
- local programstatus = f:read("*l") or ""
- local programstate = f:read("*l") or ""
- f:close()
- local f,error = io.popen("/sbin/shorewall version")
- local programversion = "shorewall-" .. f:read("*l")
- f:close()
- return programversion,programstatus,programstate
-end
-
local function read_config(file)
local path = baseurl .. file
if not (fs.is_file(path)) then
@@ -59,7 +35,6 @@ local function read_config(file)
return output
end
----[[
local function addremove_config( addremove, file, value, orgvalue )
filepath = baseurl .. file
local cmdoutput
@@ -195,13 +170,81 @@ end
-- ################################################################################
-- PUBLIC FUNCTIONS
-function modify_config(self, addremove, file, value, orgvalue )
- return addremove_config(addremove, file, value, orgvalue )
+function getstatus()
+ local status = modelfunctions.getstatus(processname, packagename, "Shorewall Status")
+ local details = getstatusdetails()
+ if string.match(details.value, "Shorewall is running") then
+ status.value.status.value = "Enabled"
+ end
+ return status
+end
+
+function getstatusdetails()
+ local f = io.popen("/sbin/shorewall status")
+ local programstate = f:read("*a") or ""
+ f:close()
+ return cfe({ value=programstate, label="Shorewall status report" })
+end
+
+function startstop_service(action)
+ return modelfunctions.startstop_service(processname, action)
+end
+
+function configcheck ()
+ local f = io.popen("/bin/echo -n '>> Check starts at: ';/bin/date; /bin/echo; /etc/init.d/shorewall check; /bin/echo; /bin/echo -n '>> Check stops at: '; /bin/date;")
+ local checkresult = f:read("*a")
+ f:close()
+ return cfe({ type="longtext", value=checkresult, label="Result of checking config" })
+end
+
+function getlogfile ()
+ local logfilepath = getopts.getoptsfromfile(configfile,"","LOGFILE") or ""
+ return cfe({ value=logfilepath, label="Shorewall logfile" })
+end
+
+function getfilelist ()
+ local listed_files = {}
+
+ for name in posix.files(baseurl) do
+ if not string.match(name, "^%.") and not string.match(name, "^Makefile") then
+ local filedetails = fs.stat(baseurl .. name)
+ table.insert ( listed_files , {filename=baseurl..name, mtime=filedetails.mtime, filesize=filedetails.size} )
+ end
+ end
+
+ table.sort(listed_files, function (a,b) return (a.filename < b.filename) end )
+
+ return cfe({ type="list", value=listed_files, label="Shorewall File List" })
+end
+
+function getfiledetails(filename)
+ --Validate filename
+ local available_files = getfilelist()
+ for i,file in ipairs(available_files.value) do
+ if file.filename == filename then
+ return modelfunctions.getfiledetails(filename)
+ end
+ end
+ local retval = modelfunctions.getfiledetails("")
+ retval.value.filename.value = filename
+ return retval
end
-function startstop_service ( self, action )
- local cmdresult,cmdmessage,cmderror,cmdaction = daemoncontrol.daemoncontrol(processname, action)
- return cfe({ type="boolean", value=cmdresult, descr=cmdmessage, errtxt=cmderror, label=action.." result" })
+function updatefiledetails (filedetails)
+ local available_files = getfilelist()
+ for i,file in ipairs(available_files.value) do
+ if file.filename == filedetails.value.filename.value then
+ return modelfunctions.setfiledetails(filedetails)
+ end
+ end
+ filedetails.value.filename.errtxt = "Invalid Filename"
+ filedetails.errtxt = "Failed to save file"
+ return filedetails
+end
+
+--[[
+function modify_config(self, addremove, file, value, orgvalue )
+ return addremove_config(addremove, file, value, orgvalue )
end
function getconfig()
@@ -257,57 +300,6 @@ function getconfig()
end
-function getversion()
- local value, errtxt = processinfo.package_version(packagename)
- local version = cfe({ name = "version",
- label="Program version",
- value=value,
- errtxt=errtxt,
- })
- return version
-end
-function getautostart()
- local autostart_sequense, autostart_errtxt = processinfo.process_botsequence(processname)
- local autostart = cfe({ name="autostart",
- label="Autostart sequence",
- value=autostart_sequense,
- errtxt=autostart_errtxt,
- })
- return autostart
-end
-
-function getstatus()
- local programversion,programstatus,programstate = getdetails()
- local status = cfe({ name="status",
- label="Program status",
- value=programstatus,
- })
- return status
-end
-function getstatusdetails()
- local details = {}
- local programversion,programstatus,programstate = getdetails()
- details.state = cfe({ name="state",
- label="Program reports",
- value=programstate,
- })
- return details
-end
-
-
-function configcheck ()
- local check = {}
- local f,err = io.popen("/bin/echo -n '>> Check starts at: ';/bin/date; /bin/echo; /etc/init.d/shorewall check; /bin/echo; /bin/echo -n '>> Check stops at: '; /bin/date;")
- local checkresult = f:read("*a")
- f:close()
- check.checkresult = cfe({ name = "checkresult",
- type="longtext",
- label="Result of checking config",
- value=checkresult,
- })
- return check
-end
-
function get_defined_zones ()
local output = {}
for k,v in pairs(read_config("zones")) do
@@ -315,105 +307,4 @@ function get_defined_zones ()
end
return output
end
-
-function getlogfile ()
- local logfile = {}
- local logfilepath = getopts.getoptsfromfile(configfile,"","LOGFILE") or ""
- local cmdaction = "grep Shorewall " .. logfilepath
- local f, error = io.popen(cmdaction ,r)
- local checkresult = f:read("*a")
- f:close()
- logfile.checkresult = cfe({ name = "checkresult",
- type="longtext",
- label="Result of logfiles",
- value=checkresult,
- })
- logfile.filename = cfe({
- name="filename",
- label="File name",
- value=cmdaction,
- })
- return logfile
-end
-
-function getfilelist ()
- local filepath = baseurl
- local listed_files = {}
-
- local k,v
- for name in posix.files(filepath) do
- if not string.match(name, "^%.") and not string.match(name, "^Makefile") then
- local filedetails = fs.stat(filepath .. name)
- table.insert ( listed_files , cfe({name=name, value=filepath .. name, mtime=filedetails.mtime, size=filedetails.size,}) )
- end
- end
-
- table.sort(listed_files, function (a,b) return (a.name < b.name) end )
-
- return listed_files
-end
-
-function getfiledetails(self,search)
- local file = {}
- local path = nil
- --Validate filename
- local available_files = getfilelist()
- for k,v in pairs(available_files) do
- if ( tostring(available_files[k]["value"]) == tostring(search.value) ) then
- path = tostring(search.value)
- end
- end
- if not (path) or (path == "") then
- file["filename"] = search
- file["filename"]["label"] = "File name"
- file["filename"]["errtxt"] = "Invalid path!"
- return file
- end
-
- local filedetails = fs.stat(path)
- file["filename"] = cfe({
- name="filename",
- label="File name",
- value=path,
- })
- file["filesize"] = cfe({
- name="filesize",
- label="File size",
- value=filedetails.size,
- })
- file["mtime"] = cfe({
- name="mtime",
- label="File name",
- value=filedetails.mtime,
- })
- file["filecontent"] = cfe({
- type="longtext",
- name="filecontent",
- label="File content",
- value=fs.read_file(path),
- })
-
- return file
-end
-
--- modifications should be a CFE
-function updatefilecontent (self, filetochange)
- local path = nil
- --Validate filename
- local available_files = getfilelist()
- for k,v in pairs(available_files) do
- if ( tostring(available_files[k]["value"]) == tostring(filetochange.name) ) then
- path = tostring(filetochange.name)
- end
- end
- if not (path) then
- filetochange.errtxt = "Invalid path!"
- return false, filetochange
- end
-
- local file_result,err = fs.write_file(path, format.dostounix(filetochange.value))
- return true
-end
-
-
-
+--]]
diff --git a/shorewall-startstop-html.lsp b/shorewall-startstop-html.lsp
index 3b706a9..0ea2627 100644..120000
--- a/shorewall-startstop-html.lsp
+++ b/shorewall-startstop-html.lsp
@@ -1,26 +1 @@
-<% local data = ... %>
-<% --[[
-io.write(html.cfe_unpack(data))
---]] %>
-
-<H1>MANAGEMENT</H1>
-<DL>
-<form action="startstop" method="POST">
-<DT>Program control-panel</DT>
-<DD>
-<input class="submit" type="submit" name="action" value="Start" <% if data.value.status.value== "Shorewall is running" then io.write("disabled") end %>>
-<input class="submit" type="submit" name="action" value="Stop" <% if data.value.status.value~= "Shorewall is running" then io.write("disabled") end %>>
-<input class="submit" type="submit" name="action" value="Restart" <% if data.value.status.value~= "Shorewall is running" then io.write("disabled") end %>>
-</DD>
-</form>
-
-<% if data.value.result then %>
-<DT>Previous action result</DT>
-<DD>
-<% if data.value.result.descr then %>
-<P CLASS='descr'><%= string.gsub(data.value.result.descr, "\n", "<BR>") %></P>
-<% end if data.value.result.errtxt then %>
-<P CLASS='error'><%= string.gsub(data.value.result.errtxt, "\n", "<BR>") %></P>
-<% end end %>
-</DD>
-</DL>
+../startstop-html.lsp \ No newline at end of file
diff --git a/shorewall-status-html.lsp b/shorewall-status-html.lsp
index f1a2d56..b2f8480 100644..120000
--- a/shorewall-status-html.lsp
+++ b/shorewall-status-html.lsp
@@ -1,23 +1 @@
-<% local form, viewlibrary = ...
-require("viewfunctions")
---[[ DEBUG INFORMATION
-io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
-io.write(html.cfe_unpack(viewlibrary))
-io.write("----------")
-io.write(html.cfe_unpack(form))
-io.write("</span>")
---]]
-%>
-
-<% if viewlibrary and viewlibrary.dispatch_component then
- viewlibrary.dispatch_component("statusbasic")
-end %>
-
-<H2>PROGRAM SPECIFIC OPTIONS/INFORMATION</H2>
-<DL>
-<%
-local myform = form.status
-local tags = { "state", }
-displayinfo(myform,tags,"viewonly")
-%>
-</DL>
+../status-html.lsp \ No newline at end of file
diff --git a/shorewall-statusbasic-html.lsp b/shorewall-statusbasic-html.lsp
deleted file mode 100644
index 99e7895..0000000
--- a/shorewall-statusbasic-html.lsp
+++ /dev/null
@@ -1,17 +0,0 @@
-<% 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
-local tags = { "status", "version", "autostart", }
-displayinfo(myform,tags,"viewonly")
-%>
-</DL>
diff --git a/shorewall.menu b/shorewall.menu
index 6ea1c18..8783eba 100644
--- a/shorewall.menu
+++ b/shorewall.menu
@@ -1,7 +1,6 @@
#CAT GROUP/DESC TAB ACTION
-Networking 40Firewall Status status
+Networking 40Firewall Status details
#Networking 40Firewall Config config
-Networking 40Firewall Expert expert
-Networking 40Firewall Check/Start/Stop/Restart check
+Networking 40Firewall Expert listfiles
Networking 40Firewall Logfile logfile
diff --git a/shorewall.roles b/shorewall.roles
index 270dea4..cd638fb 100644
--- a/shorewall.roles
+++ b/shorewall.roles
@@ -1,2 +1,2 @@
-READ=shorewall:status,shorewall:statusbasic,shorewall:logfile
-UPDATE=shorewall:editrecords,shorewall:config,shorewall:check,shorewall:expert,shorewall:edit,shorewall:startstop
+READ=shorewall:status,shorewall:details,shorewall:logfile
+UPDATE=shorewall:editrecords,shorewall:config,shorewall:check,shorewall:listfiles,shorewall:edit,shorewall:startstop