From da295a514cb2c17fe3a4ee4e89df1ad5d2b18eda Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Wed, 17 Jul 2024 23:55:39 +0200 Subject: [PATCH] Admin: Fix query in users to URL assignation --- public/main/admin/access_url_add_users_to_url.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/main/admin/access_url_add_users_to_url.php b/public/main/admin/access_url_add_users_to_url.php index 25030c1d3a..e904027a96 100644 --- a/public/main/admin/access_url_add_users_to_url.php +++ b/public/main/admin/access_url_add_users_to_url.php @@ -80,9 +80,9 @@ $first_letter_user_lower = Database::escape_string(api_strtolower($first_letter_ $target_name = api_sort_by_first_name() ? 'firstname' : 'lastname'; $target_name = 'lastname'; -$sql = "SELECT user_id,lastname,firstname,username FROM $tbl_user +$sql = "SELECT id, lastname, firstname, username FROM $tbl_user WHERE active <> ".USER_SOFT_DELETED." AND ".$target_name." LIKE '".$first_letter_user_lower."%' OR ".$target_name." LIKE '".$first_letter_user_lower."%' - ORDER BY ".(count($users) > 0 ? '(user_id IN('.implode(',', $users).')) DESC,' : '').' '.$target_name; + ORDER BY ".(count($users) > 0 ? '(id IN('.implode(',', $users).')) DESC,' : '').' '.$target_name; $result = Database::query($sql); $db_users = Database::store_result($result); unset($result); @@ -119,7 +119,7 @@ unset($result); -