Commit 72dedfca authored by Ted Trask's avatar Ted Trask

Started work on updating for acf-core-0.15

Removed controllerfunctions library (still needs more work and corresponding work in model)
Updated startstop functionality and deleted view
Updated for viewfunctions to htmlviewfunctions and modified require statements for acf libraries
parent 86c509c0
module(..., package.seeall)
-- Load libraries
require("controllerfunctions")
-- ################################################################################
-- LOCAL FUNCTIONS
-- ################################################################################
-- PUBLIC FUNCTIONS
default_action = "status"
function status(self)
......@@ -16,7 +7,7 @@ function status(self)
end
function startstop(self)
return controllerfunctions.handle_startstop(self, self.model.startstop_service, self.clientdata)
return self.handle_form(self, self.model.get_startstop, self.model.startstop_service, self.clientdata)
end
function details(self)
......@@ -24,11 +15,11 @@ function details(self)
end
function editracoon (self)
return controllerfunctions.handle_form(self, self.model.get_racoonfiledetails, self.model.update_racoonfiledetails, self.clientdata, "Save", "Edit Racoon Config", "Configuration Set")
return self.handle_form(self, self.model.get_racoonfiledetails, self.model.update_racoonfiledetails, self.clientdata, "Save", "Edit Racoon Config", "Configuration Set")
end
function editipsec (self)
return controllerfunctions.handle_form(self, self.model.get_ipsecfiledetails, self.model.update_ipsecfiledetails, self.clientdata, "Save", "Edit IPSec Config", "Configuration Set")
return self.handle_form(self, self.model.get_ipsecfiledetails, self.model.update_ipsecfiledetails, self.clientdata, "Save", "Edit IPSec Config", "Configuration Set")
end
function listcerts(self)
......@@ -40,7 +31,7 @@ function deletecert(self)
end
function uploadcert (self)
return controllerfunctions.handle_form(self, self.model.new_upload_cert, self.model.upload_cert, self.clientdata, "Upload", "Upload Certificate", "Certificate Uploaded")
return self.handle_form(self, self.model.new_upload_cert, self.model.upload_cert, self.clientdata, "Upload", "Upload Certificate", "Certificate Uploaded")
end
function viewcert(self)
......
<% local data, viewlibrary, page_info = ...
require("viewfunctions")
--require("htmlviewfunctions")
%>
<% viewlibrary.dispatch_component("status") %>
......@@ -31,6 +31,6 @@ else
end
end
end
--displayitem(data.value.ip_xfrm_policy)
--htmlviewfunctions.displayitem(data.value.ip_xfrm_policy)
%>
</DL>
<% local data, viewlibrary, page_info, session = ... %>
<% require("viewfunctions") %>
<% require("htmlviewfunctions") %>
<% displaycommandresults({"editracoon", "editipsec"}, session, true) %>
<% htmlviewfunctions.displaycommandresults({"editracoon", "editipsec"}, session, true) %>
<%
viewlibrary.dispatch_component("status")
......
<% local view, viewlibrary, page_info, session = ... %>
<% require("viewfunctions") %>
<% require("htmlviewfunctions") %>
<% displaycommandresults({"deletecert"}, session) %>
<% displaycommandresults({"uploadcert"}, session, true) %>
<% htmlviewfunctions.displaycommandresults({"deletecert"}, session) %>
<% htmlviewfunctions.displaycommandresults({"uploadcert"}, session, true) %>
<H1><%= html.html_escape(view.label) %></H1>
......
<% local data, viewlibrary = ...
require("viewfunctions")
%>
<% if viewlibrary and viewlibrary.dispatch_component then
......
......@@ -3,9 +3,9 @@ module(..., package.seeall)
-- Load libraries
require("posix")
require("modelfunctions")
require("fs")
require("format")
require("validator")
fs = require("acf.fs")
format = require("acf.format")
validator = require("acf.validator")
-- Set variables
local configfile = "/etc/racoon/racoon.conf"
......@@ -119,8 +119,12 @@ end
-- ################################################################################
-- PUBLIC FUNCTIONS
function startstop_service(action)
return modelfunctions.startstop_service(processname, action)
function get_startstop(clientdata)
return modelfunctions.get_startstop(processname)
end
function startstop_service(startstop, action)
return modelfunctions.startstop_service(startstop, action)
end
function getstatus()
......
../startstop-html.lsp
\ No newline at end of file
<% local form, viewlibrary, page_info = ... %>
<% require("viewfunctions") %>
<% require("htmlviewfunctions") %>
<H1><%= html.html_escape(form.label) %></H1>
<%
......@@ -8,5 +8,5 @@
form.value.cert.type="file"
form.value.password.type="password"
local order = {"cert", "password"}
displayform(form, order)
htmlviewfunctions.displayform(form, order)
%>
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