summaryrefslogtreecommitdiffstats
path: root/raddb/mods-config/sql/dhcp/oracle/queries.conf
blob: dd312d57575677b1d0c7abcdaf41c5b47d1d0f2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -*- text -*-
#
#  dhcp/oracle/queries.conf -- Oracle configuration for DHCP schema (schema.sql)
#
#  $Id$

#######################################################################
#  Query config:  Identifier
#######################################################################
# This is the identifier that will get substituted, escaped, and added
# as attribute 'SQL-User-Name'.  '%{SQL-User-Name}' should be used
# below everywhere an identifier substitution is needed so you you can
# be sure the identifier passed from the client is escaped properly.
#
sql_user_name = "%{control:DHCP-SQL-Option-Identifier}"

#######################################################################
#  Attribute Lookup Queries
#######################################################################
#  These queries setup the reply items in ${dhcpreply_table} and
#  ${group_reply_query}.  You can use any query/tables you want, but
#  the return data for each row MUST be in the following order:
#
#  0. Row ID (currently unused)
#  1. Identifier
#  2. Item Attr Name
#  3. Item Attr Value
#  4. Item Attr Operation
#######################################################################

authorize_reply_query = "\
	SELECT id, identifier, attribute, value, op \
	FROM ${dhcpreply_table} \
	WHERE identifier = '%{SQL-User-Name}' AND context = '%{control:DHCP-SQL-Option-Context}' \
	ORDER BY id"

authorize_group_reply_query = "\
	SELECT id, groupname, attribute, value, op \
	FROM ${groupreply_table} \
	WHERE groupname = '%{${group_attribute}}' AND context = '%{control:DHCP-SQL-Option-Context}' \
	ORDER BY id"

group_membership_query = "\
	SELECT groupname \
	FROM ${dhcpgroup_table} \
	WHERE identifier='%{SQL-User-Name}' AND context = '%{control:DHCP-SQL-Option-Context}' \
	ORDER BY priority"