summaryrefslogtreecommitdiffstats
path: root/openssh-listauth-html.lsp
blob: d93bc8b5d35a41acf2219cc5e5f74928d17ab7f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<% local view, viewlibrary, page_info, session = ... %>
<% require("viewfunctions") %>

<% displaycommandresults({"deleteauth"}, session) %>
<% displaycommandresults({"addauth"}, session, true) %>

<H1>Authorized Keys for <%= html.html_escape(view.value.user.value) %></H1>
<DL><TABLE>
	<TR style="background:#eee;font-weight:bold;">
		<TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Action</TD>
		<TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">ID</TD>
		<TD style="white-space:nowrap;text-align:left;" class="header">Key</TD>
	</TR>
<% for i,auth in ipairs(view.value.auth.value) do %>
	<TR>
		<TD style="padding-right:20px;white-space:nowrap;">
			<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deleteauth?user="..view.value.user.value.."&auth="..auth.id, label="Delete "} %>
		</TD>
		<TD style="padding-right:20px;white-space:nowrap;"><%= html.html_escape(auth.id) %></TD>
		<TD style="white-space:nowrap;"><% if #auth.key>32 then io.write(html.html_escape(string.sub(auth.key,0,16)) .. "  ...  " .. html.html_escape(string.sub(auth.key, -16))) else io.write(html.html_escape(auth.key)) end %></TD>
	</TR>
<% end %>
</TABLE></DL>

<% viewlibrary.dispatch_component("addauth", {user=view.value.user.value}) %>