]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Correct group attribute queries
authorNick Porter <nick@portercomputing.co.uk>
Wed, 9 Oct 2024 11:40:54 +0000 (12:40 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 11 Oct 2024 09:48:44 +0000 (10:48 +0100)
raddb/mods-config/sql/main/mssql/queries.conf
raddb/mods-config/sql/main/oracle/queries.conf

index c0b1b3dadb9e9ad9f7f3b82bc2c223bebc4a703a..e4a4ba8d778fc5b5ce097612ecd97a1c90c97349 100644 (file)
@@ -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 \
index e2d07a4100f0e974ccff15f752355e3b86fe854c..3413b2e6b6615fe0ce90189f924d5ff29326d70e 100644 (file)
@@ -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