summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openssh-addauth-html.lsp11
-rw-r--r--openssh-config-html.lsp7
-rw-r--r--openssh-model.lua18
3 files changed, 11 insertions, 25 deletions
diff --git a/openssh-addauth-html.lsp b/openssh-addauth-html.lsp
deleted file mode 100644
index 43f7db6..0000000
--- a/openssh-addauth-html.lsp
+++ /dev/null
@@ -1,11 +0,0 @@
-<% local form, viewlibrary, page_info = ...
-require("htmlviewfunctions")
-html = require("acf.html")
-%>
-
-<H1><%= html.html_escape(form.label) %></H1>
-<%
- form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action
- form.value.user.type = "hidden"
- htmlviewfunctions.displayform(form)
-%>
diff --git a/openssh-config-html.lsp b/openssh-config-html.lsp
index 6669383..c48fef8 100644
--- a/openssh-config-html.lsp
+++ b/openssh-config-html.lsp
@@ -7,9 +7,4 @@ html = require("acf.html")
viewlibrary.dispatch_component("status")
end %>
-<H1><%= html.html_escape(form.label) %></H1>
-<%
- form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action
- local order = {"Port", "ListenAddress", "PermitRootLogin", "PasswordAuthentication", "UseDNS"}
- htmlviewfunctions.displayform(form, order)
-%>
+<% htmlviewfunctions.displayitem(form, 1, page_info) %>
diff --git a/openssh-model.lua b/openssh-model.lua
index de2a688..2ca966c 100644
--- a/openssh-model.lua
+++ b/openssh-model.lua
@@ -69,11 +69,11 @@ end
function read_config()
local output = {}
- output.Port = cfe({ value=22, label="Port" })
- output.ListenAddress = cfe({ value="0.0.0.0", label="Listen address" })
- output.PermitRootLogin = cfe({ type="boolean", value=true, label="Permit Root Login" })
- output.PasswordAuthentication = cfe({ type="boolean", value=true, label="Password Authentication" })
- output.UseDNS = cfe({ type="boolean", value=true, label="Use DNS" })
+ output.Port = cfe({ value=22, label="Port", seq=1 })
+ output.ListenAddress = cfe({ value="0.0.0.0", label="Listen address", seq=2 })
+ output.PermitRootLogin = cfe({ type="boolean", value=true, label="Permit Root Login", seq=3 })
+ output.PasswordAuthentication = cfe({ type="boolean", value=true, label="Password Authentication", seq=4 })
+ output.UseDNS = cfe({ type="boolean", value=true, label="Use DNS", seq=5 })
local config = format.parse_configfile(fs.read_file(configfile) or "")
if config then
@@ -269,10 +269,12 @@ function delete_auth(self, delauth)
end
function get_auth(user)
- user = user or "root"
local cmdresult = cfe({ type="group", value={}, label="Authorized Key List" })
- cmdresult.value.user = cfe({ value=user, label="User" })
- cmdresult.value.cert = cfe({ type="longtext", label="SSH Certificate Contents" })
+ cmdresult.value.user = cfe({ value=user or "root", label="User", seq=1 })
+ if user then
+ cmdresult.value.user.readonly=true
+ end
+ cmdresult.value.cert = cfe({ type="longtext", label="SSH Certificate Contents", seq=2 })
return cmdresult
end