Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add setting to disable drag and drop. #4507

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions includes/language/english.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!',
Expand Down
1 change: 1 addition & 0 deletions includes/language/french.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'à : ',

);
9 changes: 9 additions & 0 deletions pages/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,15 @@
</div>
</div>

<div class='row mb-2 option' data-keywords="tree load strategy">
<div class='col-10'>
<?php echo $lang->get('disable_drag_drop'); ?>
</div>
<div class='col-2'>
<div class='toggle toggle-modern' id='disable_drag_drop' data-toggle-on='<?php echo isset($SETTINGS['disable_drag_drop']) === true && $SETTINGS['disable_drag_drop'] === '1' ? 'true' : 'false'; ?>'></div><input type='hidden' id='disable_drag_drop_input' value='<?php echo isset($SETTINGS['disable_drag_drop']) && $SETTINGS['disable_drag_drop'] === '1' ? '1' : '0'; ?>' />
</div>
</div>

<div class='row mb-2 option' data-keywords="tree load strategy">
<div class='col-10'>
<?php echo $lang->get('disable_user_edit_tree_load_strategy'); ?>
Expand Down
2 changes: 0 additions & 2 deletions sources/identify.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
5 changes: 4 additions & 1 deletion sources/items.queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

//*************** */

Expand Down