summaryrefslogtreecommitdiffstats
path: root/samba-listshares-html.lsp
blob: 46a16786c1a15981e2ce83b4db39b08ff79ee096 (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
39
40
41
42
43
44
45
<% local view, viewlibrary, page_info, session = ... 
htmlviewfunctions = require("htmlviewfunctions")
html = require("acf.html")
%>

<% htmlviewfunctions.displaycommandresults({"editshare", "deleteshare"}, session) %>
<% htmlviewfunctions.displaycommandresults({"createshare"}, session, true) %>

<H1>Shares</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">Name</TD>
		<TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Path</TD>
		<TD style="white-space:nowrap;text-align:left;" class="header">Comment</TD>
	</TR>
<% for i,share in ipairs(view.value) do %>
	<TR>
		<TD style="padding-right:20px;white-space:nowrap;">
		<% if viewlibrary.check_permission("editshare") then %>	
			<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editshare?name="..share.name.."&redir="..page_info.orig_action, label="Edit "} %>
		<% end %>
		<% if viewlibrary.check_permission("deleteshare") then %>	
			<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deleteshare?submit=true&name="..share.name, label="Delete "} %>
		<% end %>
		</TD>
		<TD style="padding-right:20px;white-space:nowrap;"><%= html.html_escape(share.name) %></TD>
		<TD style="padding-right:20px;white-space:nowrap;"><%= html.html_escape(share.path) %></TD>
		<TD style="white-space:nowrap;"><%= html.html_escape(share.comment) %></TD>
	</TR>
<% end %>
</TABLE>
<% if #view.value == 0 then %>
No Shares Found
<% end %>
</DL>

<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createshare") then %>
<H2>Create new share</H2>
<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller) %>/createshare" 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 Share"></dd></dl>
</form>
<% end %>