]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add simultaneous use queries for MS SQL
authorNick Porter <nick@portercomputing.co.uk>
Wed, 27 Apr 2022 11:06:37 +0000 (12:06 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Wed, 27 Apr 2022 11:06:37 +0000 (12:06 +0100)
raddb/mods-config/sql/main/mssql/queries.conf

index 9b9df1725fbfbfb40fcfbe0aa39c0cf0861c8680..f17a5ead1da6d7b06055a84ef807adc1e8ba105f 100644 (file)
@@ -101,6 +101,32 @@ group_membership_query = "\
        WHERE username = '%{SQL-User-Name}' \
        ORDER BY priority"
 
+#######################################################################
+#  Simultaneous Use Checking Queries
+#######################################################################
+#  simul_count_query   - query for the number of current connections
+#                      - If this is not defined, no simultaneous use checking
+#                      - will be performed by this module instance
+#  simul_verify_query  - query to return details of current connections
+#                              for verification
+#                      - Leave blank or commented out to disable verification step
+#                      - Note that the returned field order should not be changed.
+#######################################################################
+
+simul_count_query = "\
+       SELECT COUNT(*) \
+       FROM ${acct_table1} \
+       WHERE UserName = '%{SQL-User-Name}' \
+       AND AcctStopTime = 0"
+
+simul_verify_query = "\
+       SELECT \
+               RadAcctId, AcctSessionId, UserName, NASIPAddress, NASPortId, FramedIPAddress, \
+               CallingStationId, FramedProtocol \
+       FROM ${acct_table1} \
+       WHERE UserName = '%{SQL-User-Name}' \
+       AND AcctStopTime = 0"
+
 #######################################################################
 # Accounting and Post-Auth Queries
 #######################################################################