summaryrefslogtreecommitdiffstats
path: root/samba-listshares-html.lsp
blob: 748960192359bee49e517e4f886cf0afcb097eaa (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
<% local view, viewlibrary, page_info, session = ... 
require("viewfunctions")
%>

<% displaycommandresults({"editshare", "deleteshare"}, session) %>
<% 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>
<% if #view.value == 0 then %>
No Shares Found
<% end %>
<% for i,share in ipairs(view.value) do %>
	<TR>
		<TD style="padding-right:20px;white-space:nowrap;">
		<% if session.permissions.samba.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 session.permissions.samba.deleteshare then %>	
			<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deleteshare?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>
</DL>

<% if viewlibrary and viewlibrary.dispatch_component and session.permissions.samba.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 %>