summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-06-10 15:19:13 +0200
committerRoland Reichwein <mail@reichwein.it>2020-06-10 15:19:13 +0200
commit3b27ee2eaf30fbdbefa0d4ff2463bc3c7e2ca2bf (patch)
tree8340e69a5a44c26463692b8aa279581ab2e1beb8
parent3ab2eb72a5cc41446db3e04e4a710f3c72f8211d (diff)
Webbox: Download with HTTP Auth via onclick(), download via link in plain version
-rw-r--r--plugins/webbox/html/webbox.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/webbox/html/webbox.js b/plugins/webbox/html/webbox.js
index 963491d..1d6c31f 100644
--- a/plugins/webbox/html/webbox.js
+++ b/plugins/webbox/html/webbox.js
@@ -72,7 +72,15 @@ function loadContents(dir) {
var name_td;
if (type == "file") {
type = "<img src=\"webbox-html/file.png\"/>";
- name_td = "<td><a href=\"" + absolutePath(full_path) + "\"><div class=\"name\">" + filename + "</div></a></td>";
+
+ // Difference between HTTP Auth version (with login authorization) and plain version:
+ // HTTP Auth: download via onclick() of element. This automatically includes the HTTP auth for the download.
+ // Plain: download via generated link which can be used universally.
+ if (username == "notaname") { // plain version
+ name_td = "<td><a href=\"" + absolutePath(full_path) + "\"><div class=\"name\">" + filename + "</div></a></td>";
+ } else { // http auth version
+ name_td = "<td class=\"name\" " + mouse_click + ">" + filename + "</td>";
+ }
} else if (type == "dir") {
type = "<img src=\"webbox-html/directory.png\"/>";
name_td = "<td class=\"name\" " + mouse_click + ">" + filename + "</td>";