diff options
-rw-r--r-- | dhcp-controller.lua | 16 | ||||
-rw-r--r-- | dhcp-edithost-html.lsp | 4 | ||||
-rw-r--r-- | dhcp-editsubnet-html.lsp | 4 | ||||
-rw-r--r-- | dhcp-home-html.lsp | 4 | ||||
-rw-r--r-- | dhcp-listfiles-html.lsp | 4 | ||||
-rw-r--r-- | dhcp-listhosts-html.lsp | 4 | ||||
-rw-r--r-- | dhcp-listsubnets-html.lsp | 4 | ||||
-rw-r--r-- | dhcp-model.lua | 11 | ||||
-rw-r--r-- | dhcp-settings-html.lsp | 4 | ||||
l--------- | dhcp-startstop-html.lsp | 1 |
10 files changed, 28 insertions, 28 deletions
diff --git a/dhcp-controller.lua b/dhcp-controller.lua index a3bda73..b48bcfd 100644 --- a/dhcp-controller.lua +++ b/dhcp-controller.lua @@ -1,8 +1,6 @@ -- the dhcpd controller module (..., package.seeall) -require("controllerfunctions") - default_action = "status" status = function ( self ) @@ -10,19 +8,19 @@ status = function ( self ) end startstop = function ( 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 settings = function( self ) - return controllerfunctions.handle_form(self, self.model.read_settings, self.model.update_settings, self.clientdata, "Save", "Update Global Settings", "Global Settings Updated") + return self.handle_form(self, self.model.read_settings, self.model.update_settings, self.clientdata, "Save", "Update Global Settings", "Global Settings Updated") end editsubnet = function ( self ) - return controllerfunctions.handle_form(self, function() return self.model.subnet_read(self.clientdata.subnet) end, self.model.subnet_update, self.clientdata, "Save", "Edit Subnet", "Subnet Settings Updated") + return self.handle_form(self, function() return self.model.subnet_read(self.clientdata.subnet) end, self.model.subnet_update, self.clientdata, "Save", "Edit Subnet", "Subnet Settings Updated") end createsubnet = function ( self ) - return controllerfunctions.handle_form(self, self.model.create_new_subnet, self.model.subnet_create, self.clientdata, "Create", "Create new subnet", "New subnet Created") + return self.handle_form(self, self.model.create_new_subnet, self.model.subnet_create, self.clientdata, "Create", "Create new subnet", "New subnet Created") end delsubnet = function(self) @@ -34,11 +32,11 @@ listsubnets = function ( self ) end edithost = function ( self ) - return controllerfunctions.handle_form(self, function() return self.model.host_read(self.clientdata.host) end, self.model.host_update, self.clientdata, "Save", "Edit Host", "Host Settings Updated") + return self.handle_form(self, function() return self.model.host_read(self.clientdata.host) end, self.model.host_update, self.clientdata, "Save", "Edit Host", "Host Settings Updated") end createhost = function ( self ) - return controllerfunctions.handle_form(self, self.model.create_new_host, self.model.host_create, self.clientdata, "Create", "Create new host", "New host Created") + return self.handle_form(self, self.model.create_new_host, self.model.host_create, self.clientdata, "Create", "Create new host", "New host Created") end delhost = function(self) @@ -58,5 +56,5 @@ listfiles = function(self) end expert = function(self) - return controllerfunctions.handle_form(self, function() return self.model.getconfigfile(self.clientdata.filename) end, self.model.setconfigfile, self.clientdata, "Save", "Edit DHCP File", "File Saved") + return self.handle_form(self, function() return self.model.getconfigfile(self.clientdata.filename) end, self.model.setconfigfile, self.clientdata, "Save", "Edit DHCP File", "File Saved") end diff --git a/dhcp-edithost-html.lsp b/dhcp-edithost-html.lsp index 6cf60fb..289bcdc 100644 --- a/dhcp-edithost-html.lsp +++ b/dhcp-edithost-html.lsp @@ -1,5 +1,5 @@ <% local form, viewlibrary, page_info = ... -require("viewfunctions") +require("htmlviewfunctions") %> <H1><%= html.html_escape(form.label) %></H1> @@ -9,5 +9,5 @@ require("viewfunctions") form.value.host.readonly = true end local order = {"host", "mac", "ip"} - displayform(form, order) + htmlviewfunctions.displayform(form, order) %> diff --git a/dhcp-editsubnet-html.lsp b/dhcp-editsubnet-html.lsp index e848d79..b9135b3 100644 --- a/dhcp-editsubnet-html.lsp +++ b/dhcp-editsubnet-html.lsp @@ -1,5 +1,5 @@ <% local form, viewlibrary, page_info = ... -require("viewfunctions") +require("htmlviewfunctions") %> <H1><%= html.html_escape(form.label) %></H1> @@ -9,5 +9,5 @@ require("viewfunctions") form.value.subnet.readonly = true end local order = {"subnet", "netmask", "leaserangestart", "leaserangeend", "unknownclients", "domainname", "domainnameservers", "routers", "defleasetime", "maxleasetime"} - displayform(form, order) + htmlviewfunctions.displayform(form, order) %> diff --git a/dhcp-home-html.lsp b/dhcp-home-html.lsp index 845f6bd..65c4fbf 100644 --- a/dhcp-home-html.lsp +++ b/dhcp-home-html.lsp @@ -1,7 +1,7 @@ <% local view, viewlibrary, page_info, session = ... %> -<% require("viewfunctions") %> +<% require("htmlviewfunctions") %> -<% displaycommandresults({"settings", "edithost", "delhost", "createhost", "editsubnet", "delsubnet", "createsubnet"}, session) %> +<% htmlviewfunctions.displaycommandresults({"settings", "edithost", "delhost", "createhost", "editsubnet", "delsubnet", "createsubnet"}, session) %> <% if viewlibrary and viewlibrary.dispatch_component then viewlibrary.dispatch_component("status") diff --git a/dhcp-listfiles-html.lsp b/dhcp-listfiles-html.lsp index 89b62de..5e100c0 100644 --- a/dhcp-listfiles-html.lsp +++ b/dhcp-listfiles-html.lsp @@ -1,8 +1,8 @@ <% local data, viewlibrary, page_info, session = ... -require("viewfunctions") +require("htmlviewfunctions") %> -<% displaycommandresults({"expert"}, session) %> +<% htmlviewfunctions.displaycommandresults({"expert"}, session) %> <% if viewlibrary and viewlibrary.dispatch_component then viewlibrary.dispatch_component("status") diff --git a/dhcp-listhosts-html.lsp b/dhcp-listhosts-html.lsp index 7a8dfd1..f19c9d1 100644 --- a/dhcp-listhosts-html.lsp +++ b/dhcp-listhosts-html.lsp @@ -1,7 +1,7 @@ <% local view, viewlibrary, page_info, session = ... %> -<% require("viewfunctions") %> +<% require("htmlviewfunctions") %> -<% displaycommandresults({"edithost", "delhost", "createhost"}, session) %> +<% htmlviewfunctions.displaycommandresults({"edithost", "delhost", "createhost"}, session) %> <H1>Host Declarations</H1> diff --git a/dhcp-listsubnets-html.lsp b/dhcp-listsubnets-html.lsp index db302d0..f79cf78 100644 --- a/dhcp-listsubnets-html.lsp +++ b/dhcp-listsubnets-html.lsp @@ -1,7 +1,7 @@ <% local view, viewlibrary, page_info, session = ... %> -<% require("viewfunctions") %> +<% require("htmlviewfunctions") %> -<% displaycommandresults({"editsubnet", "delsubnet", "createsubnet"}, session) %> +<% htmlviewfunctions.displaycommandresults({"editsubnet", "delsubnet", "createsubnet"}, session) %> <H1>Subnet Declarations</H1> diff --git a/dhcp-model.lua b/dhcp-model.lua index 247b6c3..18a82bd 100644 --- a/dhcp-model.lua +++ b/dhcp-model.lua @@ -4,7 +4,7 @@ module (..., package.seeall) --- get additional libraries require("modelfunctions") -require("validator") +validator = require("acf.validator") local subnet = {} local configfile = "/etc/dhcp/dhcpd.conf" @@ -396,10 +396,13 @@ 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 () return modelfunctions.getstatus(processname, packagename, "DHCP Status") diff --git a/dhcp-settings-html.lsp b/dhcp-settings-html.lsp index 3b1344a..f9d97bd 100644 --- a/dhcp-settings-html.lsp +++ b/dhcp-settings-html.lsp @@ -1,9 +1,9 @@ <% local form, viewlibrary, page_info = ... %> -<% require("viewfunctions") %> +<% require("htmlviewfunctions") %> <h1><%= html.html_escape(form.label) %></h1> <% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action local order = {"domainname", "domainnameservers", "dnsupdatestyle", "defleasetime", "maxleasetime"} - displayform(form, order) + htmlviewfunctions.displayform(form, order) %> diff --git a/dhcp-startstop-html.lsp b/dhcp-startstop-html.lsp deleted file mode 120000 index 0ea2627..0000000 --- a/dhcp-startstop-html.lsp +++ /dev/null @@ -1 +0,0 @@ -../startstop-html.lsp
\ No newline at end of file |