diff options
Diffstat (limited to 'samba-listshares-html.lsp')
-rw-r--r-- | samba-listshares-html.lsp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/samba-listshares-html.lsp b/samba-listshares-html.lsp new file mode 100644 index 0000000..67af4c8 --- /dev/null +++ b/samba-listshares-html.lsp @@ -0,0 +1,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;"><%= share.name %></TD> + <TD style="padding-right:20px;white-space:nowrap;"><%= share.path %></TD> + <TD style="white-space:nowrap;"><%= 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="<%= page_info.script .. page_info.prefix .. page_info.controller %>/createshare" method="POST"> +<input class="hidden" type="hidden" name="redir" value="<%= page_info.orig_action %>" > +<dl><dt></dt><dd><input class="submit" type="submit" value="Create Share"></dd></dl> +</form> +<% end %> |