From 0b9bf67d6e1407f0ada461f20bacdca2b8201abc Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 18 Apr 2012 01:29:47 +0000 Subject: 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 --- openssh-addauth-html.lsp | 4 ++-- openssh-config-html.lsp | 4 ++-- openssh-connectedpeers-html.lsp | 1 - openssh-controller.lua | 11 ++++------- openssh-listauth-html.lsp | 6 +++--- openssh-listusers-html.lsp | 1 - openssh-model.lua | 14 +++++++++----- openssh-startstop-html.lsp | 1 - 8 files changed, 20 insertions(+), 22 deletions(-) delete mode 120000 openssh-startstop-html.lsp diff --git a/openssh-addauth-html.lsp b/openssh-addauth-html.lsp index f532b68..1f9dbd5 100644 --- a/openssh-addauth-html.lsp +++ b/openssh-addauth-html.lsp @@ -1,10 +1,10 @@ <% local form, viewlibrary, page_info = ... -require("viewfunctions") +require("htmlviewfunctions") %>

<%= html.html_escape(form.label) %>

<% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action form.value.user.type = "hidden" - displayform(form) + htmlviewfunctions.displayform(form) %> diff --git a/openssh-config-html.lsp b/openssh-config-html.lsp index aee05a9..1bc7873 100644 --- a/openssh-config-html.lsp +++ b/openssh-config-html.lsp @@ -1,5 +1,5 @@ <% local form, viewlibrary, page_info, session = ... -require("viewfunctions") +require("htmlviewfunctions") %> <% if viewlibrary and viewlibrary.dispatch_component then @@ -10,5 +10,5 @@ end %> <% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action local order = {"Port", "ListenAddress", "PermitRootLogin", "PasswordAuthentication", "UseDNS"} - displayform(form, order) + htmlviewfunctions.displayform(form, order) %> diff --git a/openssh-connectedpeers-html.lsp b/openssh-connectedpeers-html.lsp index 6b3d7a0..74eb0ce 100644 --- a/openssh-connectedpeers-html.lsp +++ b/openssh-connectedpeers-html.lsp @@ -1,5 +1,4 @@ <% local data, viewlibrary, page_info = ... -require("viewfunctions") %>

Connected peers

diff --git a/openssh-controller.lua b/openssh-controller.lua index 99b7650..9e2f866 100644 --- a/openssh-controller.lua +++ b/openssh-controller.lua @@ -1,8 +1,5 @@ module(..., package.seeall) --- Load libraries -require("controllerfunctions") - default_action = "status" function status(self) @@ -10,15 +7,15 @@ function status(self) end function config(self) - return controllerfunctions.handle_form(self, self.model.read_config, self.model.update_config, self.clientdata, "Save", "Edit Config", "Configuration Saved") + return self.handle_form(self, self.model.read_config, self.model.update_config, self.clientdata, "Save", "Edit Config", "Configuration Saved") 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 expert(self) - return controllerfunctions.handle_form(self, self.model.getconfigfile, self.model.setconfigfile, self.clientdata, "Save", "Edit Config", "Configuration Saved") + return self.handle_form(self, self.model.getconfigfile, self.model.setconfigfile, self.clientdata, "Save", "Edit Config", "Configuration Saved") end function connectedpeers(self) @@ -38,5 +35,5 @@ function deleteauth(self) end function addauth(self) - return controllerfunctions.handle_form(self, function() return self.model.get_auth(self.clientdata.user) end, self.model.create_auth, self.clientdata, "Add", "Add New Authorized Key", "Key Added") + return self.handle_form(self, function() return self.model.get_auth(self.clientdata.user) end, self.model.create_auth, self.clientdata, "Add", "Add New Authorized Key", "Key Added") end diff --git a/openssh-listauth-html.lsp b/openssh-listauth-html.lsp index 6df3f0a..61abe47 100644 --- a/openssh-listauth-html.lsp +++ b/openssh-listauth-html.lsp @@ -1,8 +1,8 @@ <% local view, viewlibrary, page_info, session = ... %> -<% require("viewfunctions") %> +<% require("htmlviewfunctions") %> -<% displaycommandresults({"deleteauth"}, session) %> -<% displaycommandresults({"addauth"}, session, true) %> +<% htmlviewfunctions.displaycommandresults({"deleteauth"}, session) %> +<% htmlviewfunctions.displaycommandresults({"addauth"}, session, true) %>

Authorized Keys for <%= html.html_escape(view.value.user.value) %>

diff --git a/openssh-listusers-html.lsp b/openssh-listusers-html.lsp index d5e0fbc..85f35b2 100644 --- a/openssh-listusers-html.lsp +++ b/openssh-listusers-html.lsp @@ -1,5 +1,4 @@ <% local view, viewlibrary, page_info, session = ... %> -<% require("viewfunctions") %>

System User Accounts

diff --git a/openssh-model.lua b/openssh-model.lua index 2ece192..ab3f61b 100644 --- a/openssh-model.lua +++ b/openssh-model.lua @@ -3,9 +3,9 @@ module(..., package.seeall) -- Load libraries require("modelfunctions") require("posix") -require("validator") -require("fs") -require("format") +validator = require("acf.validator") +fs = require("acf.fs") +format = require("acf.format") -- Set variables local configfile = "/etc/ssh/sshd_config" @@ -47,8 +47,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() diff --git a/openssh-startstop-html.lsp b/openssh-startstop-html.lsp deleted file mode 120000 index 0ea2627..0000000 --- a/openssh-startstop-html.lsp +++ /dev/null @@ -1 +0,0 @@ -../startstop-html.lsp \ No newline at end of file -- cgit v1.2.3