aboutsummaryrefslogtreecommitdiffstats
path: root/src/renderer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderer.rs')
-rw-r--r--src/renderer.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/renderer.rs b/src/renderer.rs
index c8958fe..38d2617 100644
--- a/src/renderer.rs
+++ b/src/renderer.rs
@@ -40,6 +40,12 @@ pub fn page(
let title_path = breadcrumbs_to_path_string(breadcrumbs);
+ let upload_allowed = conf.allowed_upload_dir.is_empty()
+ || conf
+ .allowed_upload_dir
+ .iter()
+ .any(|x| encoded_dir.starts_with(&format!("/{}", x)));
+
html! {
(DOCTYPE)
html {
@@ -120,7 +126,7 @@ pub fn page(
}
}
div.toolbar_box_group {
- @if conf.file_upload {
+ @if conf.file_upload && upload_allowed {
div.toolbar_box {
form id="file_submit" action=(upload_action) method="POST" enctype="multipart/form-data" {
p { "Select a file to upload or drag it anywhere into the window" }