From ef27d19ee8c039b2aa8f2b3ace41abfc2f61d755 Mon Sep 17 00:00:00 2001 From: corentin-soriano Date: Fri, 29 Nov 2024 16:24:50 +0100 Subject: [PATCH] Add setting to disable drag and drop. --- includes/language/english.php | 1 + includes/language/french.php | 1 + pages/options.php | 9 +++++++++ sources/identify.php | 2 -- sources/items.queries.php | 5 ++++- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/includes/language/english.php b/includes/language/english.php index 283f1fb33..fd383a146 100755 --- a/includes/language/english.php +++ b/includes/language/english.php @@ -965,6 +965,7 @@ 'disable_user_edit_language' => 'Users can no longer change language', 'disable_user_edit_timezone' => 'Users can no longer change time zones', 'disable_user_edit_tree_load_strategy' => 'Users can no longer change tree loading strategy', + 'disable_drag_drop' => 'Disable item drag and drop', 'encrypt_key' => 'Encryption key', 'errors' => 'errors', 'error_group_exist' => 'This folder already exists!', diff --git a/includes/language/french.php b/includes/language/french.php index c415f993b..a9023cf49 100755 --- a/includes/language/french.php +++ b/includes/language/french.php @@ -1213,6 +1213,7 @@ 'disable_user_edit_language' => 'Les utilisateurs ne peuvent plus changer de langue', 'disable_user_edit_timezone' => 'Les utilisateurs ne peuvent plus changer de fuseau horaire', 'disable_user_edit_tree_load_strategy' => 'Les utilisateurs ne peuvent plus changer de stratégie de chargement', + 'disable_drag_drop' => 'Désactiver le glisser-déposer d'objets', 'bruteforce_wait' => 'Trop de tentatives échouées, votre compte est bloqué jusqu'à : ', ); diff --git a/pages/options.php b/pages/options.php index 841a405c4..08996d45d 100755 --- a/pages/options.php +++ b/pages/options.php @@ -722,6 +722,15 @@ +
+
+ get('disable_drag_drop'); ?> +
+
+
'>
' /> +
+
+
get('disable_user_edit_tree_load_strategy'); ?> diff --git a/sources/identify.php b/sources/identify.php index bb43eadf2..21dba18fd 100755 --- a/sources/identify.php +++ b/sources/identify.php @@ -232,8 +232,6 @@ function identifyUser(string $sentData, array $SETTINGS): bool if (empty($userInitialData['skip_anti_bruteforce']) || !$userInitialData['skip_anti_bruteforce']) { - error_log('test'); - // Add failed authentication log addFailedAuthentication($username, getClientIpServer()); } diff --git a/sources/items.queries.php b/sources/items.queries.php index f01ee8c01..414746b9b 100755 --- a/sources/items.queries.php +++ b/sources/items.queries.php @@ -4359,13 +4359,16 @@ } } + // Is drag and drop enabled? + $dragDrop = (int) $SETTINGS['disable_drag_drop'] !== 1; + // Now finalize the data to send back $html_json[$record['id']]['rights'] = $right; $html_json[$record['id']]['perso'] = 'fa-tag mi-red'; $html_json[$record['id']]['sk'] = $itemIsPersonal === true ? 1 : 0; $html_json[$record['id']]['display'] = $right > 0 ? 1 : 0; $html_json[$record['id']]['open_edit'] = in_array($right, array(40, 50, 60, 70)) === true ? 1 : 0; - $html_json[$record['id']]['canMove'] = in_array($right, array(30, 60, 70)) === true ? 1 : 0; + $html_json[$record['id']]['canMove'] = in_array($right, array(30, 60, 70)) === true ? (int) $dragDrop : 0; //*************** */