files, folders, documents: remove client_id post from edit and link modals as it should get the client_id in post, enforceClientAccess

This commit is contained in:
johnnyq
2026-03-06 17:16:04 -05:00
parent a1931f59f8
commit 8ad8fd07b3
9 changed files with 91 additions and 8 deletions

View File

@@ -17,6 +17,8 @@ if (isset($_POST['create_folder'])) {
$folder_name = sanitizeInput($_POST['folder_name']);
$parent_folder = intval($_POST['parent_folder']);
enforceClientAccess();
// Document folder add query
$add_folder = mysqli_query($mysqli,"INSERT INTO folders SET folder_name = '$folder_name', parent_folder = $parent_folder, folder_location = $folder_location, folder_client_id = $client_id");
$folder_id = mysqli_insert_id($mysqli);
@@ -44,6 +46,8 @@ if (isset($_POST['rename_folder'])) {
$old_folder_name = sanitizeInput($row['folder_name']);
$client_id = intval($row['folder_client_id']);
enforceClientAccess();
// Folder edit query
mysqli_query($mysqli,"UPDATE folders SET folder_name = '$folder_name' WHERE folder_id = $folder_id");
@@ -69,6 +73,8 @@ if (isset($_GET['delete_folder'])) {
$folder_name = sanitizeInput($row['folder_name']);
$client_id = intval($row['folder_client_id']);
enforceClientAccess();
mysqli_query($mysqli,"DELETE FROM folders WHERE folder_id = $folder_id");
// Move files in deleted folder back to the root folder /