summaryrefslogtreecommitdiffstats
path: root/app/acf-util/password-status-html.lsp
blob: f322b5504b8f5b9ff2c1862356f181db291e25c0 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
<% local form, viewlibrary, page_info, session = ... %>
<% htmlviewfunctions = require("htmlviewfunctions") %>
<% html = require("acf.html") %>

<% htmlviewfunctions.displaycommandresults({"newuser", "edituser", "deleteuser"}, session) %>

<H1>User Accounts</H1>
<H2>Create new account</H2>
<form action="<%= page_info.script .. page_info.prefix .. page_info.controller %>/newuser" method="POST">
<input class="hidden" type="hidden"  name="redir"  value="<%= html.html_escape(page_info.orig_action) %>" >
<dl><dt></dt><dd><input class="submit" type="submit" value="Create"></dd></dl>
</form>
<H2>Existing account</H2>
<DL>
<% for i,user in ipairs(form.value) do
	local name = html.html_escape(user.value.userid.value) %>
	<DT><IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/apps/system-users.png' HEIGHT='16' WIDTH='16'> <%= name %></DT>
	<DD><TABLE>
		<TR>
			<TD STYLE='border:none;'><B><%= html.html_escape(user.value.userid.label) %></B></TD>
			<TD STYLE='border:none;' WIDTH='90%'><%= html.html_escape(user.value.userid.value) %></TD>
		</TR><TR>
			<TD STYLE='border:none;'><B><%= html.html_escape(user.value.username.label) %></B></TD>
			<TD STYLE='border:none;'><%= html.html_escape(user.value.username.value) %></TD>
		</TR><TR>
			<TD STYLE='border:none;'><B><%= html.html_escape(user.value.roles.label) %></B></TD>
			<TD STYLE='border:none;'><%= html.html_escape(table.concat(user.value.roles.value, ", ")) %></TD>
		</TR><TR>
			<TD STYLE='border:none;'><B>Option</B></TD>
			<TD STYLE='border:none;'>
			[<A HREF='edituser?userid=<%= name %>&redir=<%= html.html_escape(page_info.orig_action) %>'>Edit this account</A>]
			[<A HREF='deleteuser?userid=<%= name %>&submit=true'>Delete this account</A>]
			[<A HREF='<%= html.html_escape(page_info.script) %>/acf-util/roles/viewuserroles?userid=<%= name %>'>View roles for this account</A>]
			</TD>
		</TR>
	</TABLE></DD>
<% end %>
</DL>