File Manager
- keyhelpuser
- Posts: 30
- Joined: Sat 13. Mar 2021, 21:56
- Location: ...earth
- Contact:
File Manager
.cache ,
.config ,
.local ,
.ssh ,
files ,
logs ,
tmp ,
.bashrc ,
.bash_history ,
.bash_logout ,
.profile ,
I would like to only for user access to the www folder by File Manager. Is there such an option to configure?
Regards
Re: File Manager
you can use the white-label feature for that purpose. Just use some JavaScript code to hide the table rows you don't want to see.
Please note, that your users might like to still have access to at least the directories files/, logs/, tmp/.
Alexander Mahr
**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
- keyhelpuser
- Posts: 30
- Joined: Sat 13. Mar 2021, 21:56
- Location: ...earth
- Contact:
Re: File Manager
can you help me with this?
Re: File Manager
Okay, the following code should work.
It hides all the items in the hidePaths array and updates the total number in the table foot accordingly.
Code: Select all
let url = new URL(window.location.href);
let page = url.searchParams.get("page");
let path = url.searchParams.get("path");
if (page === "client_file_manager" && path === "/") {
// Hide paths
let hidePaths = [
".cache",
".config",
".local",
".ssh",
".bash_history",
".bash_logout",
".bashrc",
".profile",
"bin",
"dev",
"etc",
"lib",
"lib64",
"usr",
// ... add paths as you like
];
let rows = document.querySelectorAll('#form-file-manager table tbody tr');
rows.forEach(row => {
let path = row.querySelector('input[name="config_id"]');
if (!path) return;
if (hidePaths.includes(path.value)) {
row.style.display = "none";
}
});
// Update total number
let totalCell = document.querySelector(
'#form-file-manager table tfoot td'
);
if (totalCell) {
let visibleRows = Array.from(rows).filter(r => r.style.display !== "none").length;
totalCell.textContent = totalCell.textContent.replace(/^\s*\d+/, visibleRows);
}
}Alexander Mahr
**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
- keyhelpuser
- Posts: 30
- Joined: Sat 13. Mar 2021, 21:56
- Location: ...earth
- Contact:
Re: File Manager
unfortunately it doesn't workAlexander wrote: ↑Mon 17. Nov 2025, 15:44
Okay, the following code should work.
It hides all the items in the hidePaths array and updates the total number in the table foot accordingly.
Code: Select all
let url = new URL(window.location.href); let page = url.searchParams.get("page"); let path = url.searchParams.get("path"); if (page === "client_file_manager" && path === "/") { // Hide paths let hidePaths = [ ".cache", ".config", ".local", ".ssh", ".bash_history", ".bash_logout", ".bashrc", ".profile", "bin", "dev", "etc", "lib", "lib64", "usr", // ... add paths as you like ]; let rows = document.querySelectorAll('#form-file-manager table tbody tr'); rows.forEach(row => { let path = row.querySelector('input[name="config_id"]'); if (!path) return; if (hidePaths.includes(path.value)) { row.style.display = "none"; } }); // Update total number let totalCell = document.querySelector( '#form-file-manager table tfoot td' ); if (totalCell) { let visibleRows = Array.from(rows).filter(r => r.style.display !== "none").length; totalCell.textContent = totalCell.textContent.replace(/^\s*\d+/, visibleRows); } }
Re: File Manager
It works fine on multiple servers on my end.unfortunately it doesn't work
Without showing a potential error message from your browsers console there is now way someone could tell what went wrong on your side.
I see in your signature, you may use a custom theme, this might be the reason for this.
Alexander Mahr
**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
- keyhelpuser
- Posts: 30
- Joined: Sat 13. Mar 2021, 21:56
- Location: ...earth
- Contact:
Re: File Manager
Have you copied the code into the right input field?
What does the browser console say when accessing the page?
Alexander Mahr
**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
- keyhelpuser
- Posts: 30
- Joined: Sat 13. Mar 2021, 21:56
- Location: ...earth
- Contact: