From 4d8673e709baeef88a89fe4b8124ee696d81e5b5 Mon Sep 17 00:00:00 2001 From: Nick Porter Date: Wed, 9 Oct 2024 12:40:54 +0100 Subject: [PATCH] Correct group attribute queries --- raddb/mods-config/sql/main/mssql/queries.conf | 24 +++++++------------ .../mods-config/sql/main/oracle/queries.conf | 22 +++++++---------- 2 files changed, 16 insertions(+), 30 deletions(-) diff --git a/raddb/mods-config/sql/main/mssql/queries.conf b/raddb/mods-config/sql/main/mssql/queries.conf index c0b1b3dadb9e..e4a4ba8d778f 100644 --- a/raddb/mods-config/sql/main/mssql/queries.conf +++ b/raddb/mods-config/sql/main/mssql/queries.conf @@ -76,24 +76,16 @@ authorize_reply_query = "\ ORDER BY id" authorize_group_check_query = "\ - SELECT \ - ${groupcheck_table}.id,${groupcheck_table}.GroupName, \ - ${groupcheck_table}.Attribute,${groupcheck_table}.Value, \ - ${groupcheck_table}.op \ - FROM ${groupcheck_table},${usergroup_table} \ - WHERE ${usergroup_table}.Username = '%{SQL-User-Name}' \ - AND ${usergroup_table}.GroupName = ${groupcheck_table}.GroupName \ - ORDER BY ${groupcheck_table}.id" + SELECT id, GroupName, Attribute, Value, op \ + FROM ${groupcheck_table} \ + WHERE GroupName = '%{${group_attribute}}' \ + ORDER BY id" authorize_group_reply_query = "\ - SELECT \ - ${groupreply_table}.id, ${groupreply_table}.GroupName, \ - ${groupreply_table}.Attribute,${groupreply_table}.Value, \ - ${groupreply_table}.op \ - FROM ${groupreply_table},${usergroup_table} \ - WHERE ${usergroup_table}.Username = '%{SQL-User-Name}' \ - AND ${usergroup_table}.GroupName = ${groupreply_table}.GroupName \ - ORDER BY ${groupreply_table}.id" + SELECT id, GroupName, Attribute, Value, op \ + FROM ${groupreply_table} \ + WHERE GroupName = '%{${group_attribute}}' \ + ORDER BY id" group_membership_query = "\ SELECT groupname \ diff --git a/raddb/mods-config/sql/main/oracle/queries.conf b/raddb/mods-config/sql/main/oracle/queries.conf index e2d07a4100f0..3413b2e6b661 100644 --- a/raddb/mods-config/sql/main/oracle/queries.conf +++ b/raddb/mods-config/sql/main/oracle/queries.conf @@ -77,22 +77,16 @@ authorize_reply_query = "\ ORDER BY id" authorize_group_check_query = "\ - SELECT \ - ${groupcheck_table}.id, ${groupcheck_table}.GroupName, ${groupcheck_table}.Attribute, \ - ${groupcheck_table}.Value,${groupcheck_table}.op \ - FROM ${groupcheck_table}, ${usergroup_table} \ - WHERE ${usergroup_table}.Username = '%{SQL-User-Name}' \ - AND ${usergroup_table}.GroupName = ${groupcheck_table}.GroupName \ - ORDER BY ${groupcheck_table}.id" + SELECT id, GroupName, Attribute, Value, op \ + FROM ${groupcheck_table} \ + WHERE GroupName = '%{${group_attribute}}' \ + ORDER BY id" authorize_group_reply_query = "\ - SELECT \ - ${groupreply_table}.id, ${groupreply_table}.GroupName, ${groupreply_table}.Attribute, \ - ${groupreply_table}.Value, ${groupreply_table}.op \ - FROM ${groupreply_table}, ${usergroup_table} \ - WHERE ${usergroup_table}.Username = '%{SQL-User-Name}' \ - AND ${usergroup_table}.GroupName = ${groupreply_table}.GroupName \ - ORDER BY ${groupreply_table}.id" + SELECT id, GroupName, Attribute, Value, op \ + FROM ${groupreply_table} \ + WHERE GroupName = '%{${group_attribute}}' \ + ORDER BY id" ####################################################################### # Group Membership Queries