summaryrefslogtreecommitdiffstats
path: root/openssh-controller.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-09-24 15:21:17 +0000
committerTed Trask <ttrask01@yahoo.com>2008-09-24 15:21:17 +0000
commit651ba7cce4fd5bc01edf6902e0f08c7c93527d00 (patch)
treeb32701c4a876c5959b6208836fc250fcd34c725e /openssh-controller.lua
parent2a8551baa8f0025f836e7501c1cce71251357c78 (diff)
downloadacf-openssh-651ba7cce4fd5bc01edf6902e0f08c7c93527d00.tar.bz2
acf-openssh-651ba7cce4fd5bc01edf6902e0f08c7c93527d00.tar.xz
Modified openssh. Changed expert, status, and startstop to links. Modified config to use standard cfes. Modified peers to account for dns names.
git-svn-id: svn://svn.alpinelinux.org/acf/openssh/trunk@1489 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'openssh-controller.lua')
-rw-r--r--openssh-controller.lua74
1 files changed, 1 insertions, 73 deletions
diff --git a/openssh-controller.lua b/openssh-controller.lua
index 30800f5..6a76512 100644
--- a/openssh-controller.lua
+++ b/openssh-controller.lua
@@ -3,8 +3,6 @@ module(..., package.seeall)
-- Load libraries
require("controllerfunctions")
-local checkboxes = { "PermitRootLogin", "PasswordAuthentication", "UseDNS" }
-
default_action = "status"
function status(self)
@@ -12,75 +10,7 @@ function status(self)
end
function config(self)
- local output = {}
- local errtxt = {}
- local successfuledit
- if (self.clientdata.cmdsave) then
- local fields = { "Port", "ListenAddress", "PermitRootLogin", "PasswordAuthentication", "UseDNS", }
- local newconfig = {}
- for _ , v in pairs(fields) do
- newconfig[v] = self.clientdata[v] or ""
- end
- successfuledit, errtxt = self.model.write_config(newconfig)
- end
-
- local config = self.model.read_config() or {}
- output.cmdsave = cfe({
- name="cmdsave",
- label="Save above changes",
- value="Apply",
- type="submit",
- })
-
- output.Port = cfe({
- name="Port",
- label="Port",
- value=config.Port,
- })
- output.ListenAddress = cfe({
- name="ListenAddress",
- label="Listen address",
- value=config.ListenAddress,
- })
- output.PermitRootLogin = cfe({
- name="PermitRootLogin",
- label="Permit Root Login",
- })
-
- output.PasswordAuthentication = cfe({
- name="PasswordAuthentication",
- label="Password Authentication",
- })
-
- output.UseDNS = cfe({
- name="UseDNS",
- label="Use DNS",
- })
-
- -- Display checkboxes checked/unchecked
- for k,v in pairs(checkboxes) do
- output[v]['value']="yes"
- output[v]['type']="checkbox"
- if (config[v]) and (string.lower(tostring(config[v] or "")) == "yes") then
- output[v]['checked']="yes"
- end
- end
-
- -- Display results of previous save action
- if (self.clientdata.cmdsave) and not (successfuledit) then
- for k,v in pairs(self.clientdata) do
- if (output) and (output[k]) and (k) then
- output[k]['value'] = self.clientdata[k]
- output[k]['errtxt'] = errtxt[k]
- end
- end
-
- output.cmdsave.errtxt = "Save action was canceled because there was invalid input."
- elseif (self.clientdata.cmdsave) and (successfuledit) then
- output.cmdsave.descr = "* Configuration was succesfully saved"
- end
-
- return output
+ return controllerfunctions.handle_form(self, self.model.read_config, self.model.update_config, self.clientdata, "Save", "Edit Config", "Configuration Saved")
end
function startstop(self)
@@ -94,5 +24,3 @@ end
function connectedpeers(self)
return self.model.list_conn_peers()
end
-function welcome(self)
-end