Dear rust,

First,  sql  should  be  _before_  mschap in authorize{}. Second, set NT
password (it's better to set both NT and LM passwords).

--Friday, April 19, 2002, 12:17:54 PM, you wrote to [EMAIL PROTECTED]:

r> Hello freeradius-users,


r> I build pppd with radius.so plugin and it work with freeradius and PAP auth with
r> encrypted passwords in mysql base.
r> Now I need authorize and accounting pptp with freeradius+mysql+ms-chap2

r> I add user "rust" with pass "qwerty"  in table radcheck in database radius

r> --------------------------------------------------------------------------------

r>  id UserName Attribute    Value
r>  1  rust     LM-Password 598DDCE2660D3193AAD3B435B51404EE

r> --------------------------------------------------------------------------------

r> ./radiusd -X logs next:


r> Starting - reading configuration files ...
r> reread_config:  reading radiusd.conf
r> Config:   including file: /usr/local/etc/raddb/proxy.conf
r> Config:   including file: /usr/local/etc/raddb/clients.conf
r> Config:   including file: /usr/local/etc/raddb/snmp.conf
r> Config:   including file: /usr/local/etc/raddb/sql.conf
r>  main: prefix = "/usr/local"
r>  main: localstatedir = "/usr/local/var"
r>  main: logdir = "/usr/local/var/log/radius"
r>  main: libdir = "/usr/local/lib"
r>  main: radacctdir = "/usr/local/var/log/radius/radacct"
r>  main: hostname_lookups = no
r> read_config_files:  reading dictionary
r> read_config_files:  reading clients
r> read_config_files:  reading realms
r> read_config_files:  reading naslist
r>  main: max_request_time = 30
r>  main: cleanup_delay = 5
r>  main: max_requests = 1024
r>  main: delete_blocked_requests = 0
r>  main: port = 0
r>  main: allow_core_dumps = no
r>  main: log_stripped_names = no
r>  main: log_auth = no
r>  main: log_auth_badpass = no
r>  main: log_auth_goodpass = no
r>  main: pidfile = "/usr/local/var/run/radiusd.pid"
r>  main: user = "root"
r>  main: group = "root"
r>  main: usercollide = no
r>  main: lower_user = "no"
r>  main: lower_pass = "no"
r>  main: nospace_user = "no"
r>  main: nospace_pass = "no"
r>  main: proxy_requests = yes
r>  proxy: retry_delay = 5
r>  proxy: retry_count = 3
r>  proxy: synchronous = no
r>  proxy: default_fallback = yes
r>  proxy: dead_time = 120
r>  security: max_attributes = 200
r>  security: reject_delay = 1
r>  main: debug_level = 0
r> read_config_files:  entering modules setup
r> Module: Library search path is /usr/local/lib
r> Module: Loaded MS-CHAP 
r>  mschap: ignore_password = no
r>  mschap: use_mppe = yes
r>  mschap: require_encryption = no
r>  mschap: require_strong = no
r>  mschap: passwd = "(null)"
r>  mschap: authtype = "MS-CHAP"
r> Module: Instantiated mschap (mschap) 
r> Module: Loaded preprocess 
r>  preprocess: huntgroups = "/usr/local/etc/raddb/huntgroups"
r>  preprocess: hints = "/usr/local/etc/raddb/hints"
r>  preprocess: with_ascend_hack = no
r>  preprocess: ascend_channels_per_line = 23
r>  preprocess: with_ntdomain_hack = no
r>  preprocess: with_specialix_jetstream_hack = no
r>  preprocess: with_cisco_vsa_hack = no
r> Module: Instantiated preprocess (preprocess) 
r> Module: Loaded realm 
r>  realm: format = "suffix"
r>  realm: delimiter = "@"
r> Module: Instantiated realm (suffix) 
r> Module: Loaded SQL 
r>  sql: driver = "rlm_sql_mysql"
r>  sql: server = "192.168.200.1"
r>  sql: port = ""
r>  sql: login = "radius"
r>  sql: password = "radpass"
r>  sql: radius_db = "radius"
r>  sql: acct_table = "radacct"
r>  sql: acct_table2 = "radacct"
r>  sql: authcheck_table = "radcheck"
r>  sql: authreply_table = "radreply"
r>  sql: groupcheck_table = "radgroupcheck"
r>  sql: groupreply_table = "radgroupreply"
r>  sql: usergroup_table = "usergroup"
r>  sql: nas_table = "nas"
r>  sql: dict_table = "dictionary"
r>  sql: sqltrace = yes
r>  sql: sqltracefile = "/usr/local/var/log/radius/sqltrace.sql"
r>  sql: deletestalesessions = yes
r>  sql: num_sql_socks = 5
r>  sql: sql_user_name = "%{User-Name}"
r>  sql: authorize_check_query = "SELECT id,UserName,Attribute,Value,op FROM radcheck 
WHERE Username = '%{SQL-User-Name}' ORDER BY id"
r>  sql: authorize_reply_query = "SELECT id,UserName,Attribute,Value,op FROM radreply 
WHERE Username = '%{SQL-User-Name}' ORDER BY id"
r>  sql: authorize_group_check_query = "SELECT 
radgroupcheck.id,radgroupcheck.GroupName,radgroupcheck.Attribute,radgroupcheck.Value,radgroupcheck.op
  FROM radgroupcheck,usergroup WHERE
r> usergroup.Username = '%{SQL-User-Name}' AND usergroup.GroupName = 
radgroupcheck.GroupName ORDER BY radgroupcheck.id"
r>  sql: authorize_group_reply_query = "SELECT 
radgroupreply.id,radgroupreply.GroupName,radgroupreply.Attribute,radgroupreply.Value,radgroupreply.op
  FROM radgroupreply,usergroup WHERE
r> usergroup.Username = '%{SQL-User-Name}' AND usergroup.GroupName = 
radgroupreply.GroupName ORDER BY radgroupreply.id"
r>  sql: authenticate_query = "SELECT Value,Attribute FROM radcheck WHERE UserName = 
'%{User-Name}' AND ( Attribute = 'User-Password' OR Attribute = 'Password' OR 
Attribute = 'Crypt-Password' ) ORDER
r> BY Attribute DESC"
r>  sql: accounting_onoff_query = "UPDATE radacct SET AcctStopTime='%S', 
AcctSessionTime=unix_timestamp('%S') - unix_timestamp(AcctStartTime), 
AcctTerminateCause='%{Acct-Terminate-Cause}',
r> AcctStopDelay = %{Acct-Delay-Time} WHERE AcctSessionTime=0 AND AcctStopTime=0 AND 
NASIPAddress= '%{NAS-IP-Address}' AND AcctStartTime <= '%S'"
r>  sql: accounting_update_query = "UPDATE radacct SET FramedIPAddress = 
'%{Framed-IP-Address}' WHERE AcctSessionId = '%{Acct-Session-Id}' AND UserName = 
'%{SQL-User-Name}' AND NASIPAddress=
r> '%{NAS-IP-Address}'"
r>  sql: accounting_start_query = "INSERT into radacct (RadAcctId, AcctSessionId, 
AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, 
AcctStopTime, AcctSessionTime,
r> AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, AcctInputOctets, 
AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause, ServiceType, 
FramedProtocol, FramedIPAddress,
r> AcctStartDelay, AcctStopDelay) values('', '%{Acct-Session-Id}', 
'%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', 
'%{NAS-Port-Id}', '%{NAS-Port-Type}', '%S', '0',
r> '0', '%{Acct-Authentic}', '%{Connect-Info}', '', '0', '0', '%{Called-Station-Id}', 
'%{Calling-Station-Id}', '', '%{Service-Type}', '%{Framed-Protocol}', 
'%{Framed-IP-Address}',
r> '%{Acct-Delay-Time}', '0')"
r>  sql: accounting_start_query_alt = "UPDATE radacct SET AcctStartTime = '%S', 
AcctStartDelay = '%{Acct-Delay-Time}', ConnectInfo_start = '%{Connect-Info}' WHERE 
AcctSessionId = '%{Acct-Session-Id}'
r> AND UserName = '%{SQL-User-Name}' AND NASIPAddress = '%{NAS-IP-Address}'"
r>  sql: accounting_stop_query = "UPDATE radacct SET AcctStopTime = '%S', 
AcctSessionTime = '%{Acct-Session-Time}', AcctInputOctets = '%{Acct-Input-Octets}', 
AcctOutputOctets =
r> '%{Acct-Output-Octets}', AcctTerminateCause = '%{Acct-Terminate-Cause}', 
AcctStopDelay = '%{Acct-Delay-Time}', ConnectInfo_stop = '%{Connect-Info}' WHERE 
AcctSessionId = '%{Acct-Session-Id}' AND
r> UserName = '%{SQL-User-Name}' AND NASIPAddress = '%{NAS-IP-Address}'"
r>  sql: accounting_stop_query_alt = "INSERT into radacct (RadAcctId, AcctSessionId, 
AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, 
AcctStopTime, AcctSessionTime,
r> AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, AcctInputOctets, 
AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause, ServiceType, 
FramedProtocol, FramedIPAddress,
r> AcctStartDelay, AcctStopDelay) values('', '%{Acct-Session-Id}', 
'%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', 
'%{NAS-Port-Id}', '%{NAS-Port-Type}', '0', '%S',
r> '%{Acct-Session-Time}', '%{Acct-Authentic}', '', '%{Connect-Info}', 
'%{Acct-Input-Octets}', '%{Acct-Output-Octets}', '%{Called-Station-Id}', 
'%{Calling-Station-Id}', '%{Acct-Terminate-Cause}',
r> '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', '0', 
'%{Acct-Delay-Time}')"
r>  sql: connect_failure_retry_delay = 60
r> rlm_sql: Driver rlm_sql_mysql loaded and linked
r> rlm_sql: Attempting to connect to [EMAIL PROTECTED]:/radius
r> rlm_sql:  Connected new DB handle, #0
r> rlm_sql:  Connected new DB handle, #1
r> rlm_sql:  Connected new DB handle, #2
r> rlm_sql:  Connected new DB handle, #3
r> rlm_sql:  Connected new DB handle, #4
r> Module: Instantiated sql (sql) 
r> Module: Loaded files 
r>  files: usersfile = "/usr/local/etc/raddb/users"
r>  files: acctusersfile = "/usr/local/etc/raddb/acct_users"
r>  files: compat = "no"
r> Module: Instantiated files (files) 
r> Module: Loaded detail 
r>  detail: detailfile = 
"/usr/local/var/log/radius/radacct/%{Client-IP-Address}/detail"
r>  detail: detailperm = 384
r>  detail: dirperm = 493
r> Module: Instantiated detail (detail) 
r> Module: Loaded radutmp 
r>  radutmp: filename = "/usr/local/var/log/radius/radutmp"
r>  radutmp: username = "%{User-Name}"
r>  radutmp: perm = 384
r>  radutmp: callerid = yes
r> Module: Instantiated radutmp (radutmp) 
r> Listening on IP address *, ports 1812/udp and 1813/udp, with proxy on 1814/udp.
r> Ready to process requests.
r> rad_recv: Access-Request packet from host 192.168.200.1:2030, id=227, length=132
r>         Service-Type = Framed-User
r>         Framed-Protocol = PPP
r>         User-Name = "rust"
r>         MS-CHAP-Challenge = 0xa5fc5492aac0394d71e99398bbcc4069
r>         MS-CHAP2-Response = 
0x010021491ab12f6af2948ffdaa9b4d88a6020000000000000000739f8fbb895e9a13288d2e4f5063fb4dfb0406c4196fcc90
r>         NAS-IP-Address = 127.0.0.1
r>         NAS-Port = 0
r> modcall: entering group authorize
r>   modcall[authorize]: module "preprocess" returns ok
r>   modcall[authorize]: module "suffix" returns ok
r>   modcall[authorize]: module "mschap" returns notfound
r> radius_xlat:  'rust'
r> sql_escape in:  'rust'
r> sql_escape out:  'rust'
r> sql_set_user:  escaped user --> 'rust'
r> radius_xlat:  'SELECT id,UserName,Attribute,Value,op FROM radcheck WHERE Username = 
'rust' ORDER BY id'
r> rlm_sql: Reserving sql socket id: 4
r> SELECT id,UserName,Attribute,Value,op FROM radcheck WHERE Username = 'rust' ORDER 
BY id
r> radius_xlat:  'SELECT 
radgroupcheck.id,radgroupcheck.GroupName,radgroupcheck.Attribute,radgroupcheck.Value,radgroupcheck.op
  FROM radgroupcheck,usergroup WHERE usergroup.Username = 'rust' AND
r> usergroup.GroupName = radgroupcheck.GroupName ORDER BY radgroupcheck.id'
r> SELECT 
radgroupcheck.id,radgroupcheck.GroupName,radgroupcheck.Attribute,radgroupcheck.Value,radgroupcheck.op
  FROM radgroupcheck,usergroup WHERE usergroup.Username = 'rust' AND 
usergroup.GroupName
r> = radgroupcheck.GroupName ORDER BY radgroupcheck.id
r> radius_xlat:  'SELECT id,UserName,Attribute,Value,op FROM radreply WHERE Username = 
'rust' ORDER BY id'
r> SELECT id,UserName,Attribute,Value,op FROM radreply WHERE Username = 'rust' ORDER 
BY id
r> radius_xlat:  'SELECT 
radgroupreply.id,radgroupreply.GroupName,radgroupreply.Attribute,radgroupreply.Value,radgroupreply.op
  FROM radgroupreply,usergroup WHERE usergroup.Username = 'rust' AND
r> usergroup.GroupName = radgroupreply.GroupName ORDER BY radgroupreply.id'
r> SELECT 
radgroupreply.id,radgroupreply.GroupName,radgroupreply.Attribute,radgroupreply.Value,radgroupreply.op
  FROM radgroupreply,usergroup WHERE usergroup.Username = 'rust' AND 
usergroup.GroupName
r> = radgroupreply.GroupName ORDER BY radgroupreply.id
r> rlm_sql: Pairs do not match [rust]
r> rlm_sql: Released sql socket id: 4
r>   modcall[authorize]: module "sql" returns notfound
r> modcall: group authorize returns ok
r> auth: No Auth-Type configuration for the request, rejecting the user
r> auth: Failed to validate the user.
r> Delaying request 0 for 1 seconds
r> Finished request 0
r> Going to the next request
r> --- Walking the entire request list ---
r> Waking up in 1 seconds...
r> --- Walking the entire request list ---
r> Waking up in 1 seconds...
r> --- Walking the entire request list ---
r> Sending Access-Reject of id 227 to 192.168.200.1:2030
r> Waking up in 4 seconds...




r> -----------------------------------------------

r> authorize {
r>         preprocess
r> #       counter
r> #       attr_filter
r> #       eap
r>         suffix
r> #       files
r>         mschap
r>         sql
r> }

r> authenticate {
r> #       pam
r> #       unix
r> #       ldap
r>         mschap
r> #       eap
r> }
r> preacct {
r>         suffix
r>         files
r>         preprocess
r> }

r> accounting {
r> #       acct_unique
r>         detail
r> #       counter
r> #       unix
r>         radutmp
r> #       sradutmp
r>         sql
r> }

r> session {
r>         radutmp
r> }

r> --------------------------------------------------------------------------------

r> #
r> #  Configuration for the SQL module.
r> #
r> sql {

r>         # Database type
r>         # Current supported are: rlm_sql_mysql, rlm_sql_postgresql,
r>         # rlm_sql_iodbc, rlm_sql_oracle, rlm_sql_unixodbc
r>         driver = "rlm_sql_mysql"

r>         # Connect info
r>         server = "192.168.200.1"
r>         login = "radius"
r>         password = "radpass"
        
r>         # Database table configuration
r>         radius_db = "radius"
                
r>         # If you want both stop and start records logged to the
r>         # same SQL table, leave this as is.  If you want them in
r>         # different tables, put the start table in acct_table1
r>         # and stop table in acct_table2
r>         acct_table1 = "radacct"
r>         acct_table2 = "radacct"
                
r>         authcheck_table = "radcheck"
r>         authreply_table = "radreply"
        
r>         groupcheck_table = "radgroupcheck"
r>         groupreply_table = "radgroupreply"
        
r>         usergroup_table = "usergroup"
        
r>         # Remove stale session if checkrad does not see a double login
r>         deletestalesessions = yes

r>         # Print all SQL statements when in debug mode (-x)
r>         sqltrace = yes
r>         sqltracefile = ${logdir}/sqltrace.sql

r>         # number of sql connections to make to server
r>         num_sql_socks = 5

r>         #######################################################################
r>         #  Query config:  Username
r>         #######################################################################
r>         # This is the username that will get substituted, escaped, and added 
r>         # as attribute 'SQL-User-Name'.  '%{SQL-User-Name}' should be used below 
r>         # everywhere a username substitution is needed so you you can be sure 
r>         # the username passed from the client is escaped properly.  
r>         #
r>         #  Uncomment the next line, if you want the sql_user_name to mean:
r>         #
r>         #    Use Stripped-User-Name, if it's there.
r>         #    Else use User-Name, if it's there,
r>         #    Else use hard-coded string "none" as the user name.
r>         #sql_user_name = "%{Stripped-User-Name:-%{User-Name:-none}}"
r>         #
r>         sql_user_name = "%{User-Name}"


r>         #######################################################################
r>         #  Authorization Queries
r>         #######################################################################
r>         #  These queries compare the check items for the user
r>         #  in ${authcheck_table} and setup the reply items in 
r>         #  ${authreply_table}.  You can use any query/tables
r>         #  you want, but the return data for each row MUST 
r>         #  be in the  following order:
r>         #
r>         #  0. Row ID (currently unused)
r>         #  1. UserName/GroupName
r>         #  2. Item Attr Name
r>         #  3. Item Attr Value
r>         #  4. Item Attr Operation
r>         #######################################################################
r>         # Use these for case sensitive usernames. WARNING: Slower queries!
r> #       authorize_check_query = "SELECT id,UserName,Attribute,Value,op FROM 
${authcheck_table} WHERE STRCMP(Username, '%{SQL-User-Name}') = 0 ORDER BY id"
r> #       authorize_reply_query = "SELECT id,UserName,Attribute,Value,op FROM 
${authreply_table} WHERE STRCMP(Username, '%{SQL-User-Name}') = 0 ORDER BY id"

r>         authorize_check_query = "SELECT id,UserName,Attribute,Value,op FROM 
${authcheck_table} WHERE Username = '%{SQL-User-Name}' ORDER BY id"
r>         authorize_reply_query = "SELECT id,UserName,Attribute,Value,op FROM 
${authreply_table} WHERE Username = '%{SQL-User-Name}' ORDER BY id"

r>         # Use these for case sensitive usernames. WANRING: Slower queries!
r> #       authorize_group_check_query = "SELECT 
${groupcheck_table}.id,${groupcheck_table}.GroupName,${groupcheck_table}.Attribute,${groupcheck_table}.Value,${groupcheck_table}.op
 FROM
r> ${groupcheck_table},${usergroup_table} WHERE STRCMP(${usergroup_table}.Username, 
'%{SQL-User-Name}') = 0 AND ${usergroup_table}.GroupName = 
${groupcheck_table}.GroupName ORDER BY
r> ${groupcheck_table}.id"
r> #       authorize_group_reply_query = "SELECT 
${groupreply_table}.id,${groupreply_table}.GroupName,${groupreply_table}.Attribute,${groupreply_table}.Value,${groupreply_table}.op
  FROM
r> ${groupreply_table},${usergroup_table} WHERE STRCMP(${usergroup_table}.Username, 
'%{SQL-User-Name}') = 0 AND ${usergroup_table}.GroupName = 
${groupreply_table}.GroupName ORDER BY
r> ${groupreply_table}.id"

r>         authorize_group_check_query = "SELECT 
${groupcheck_table}.id,${groupcheck_table}.GroupName,${groupcheck_table}.Attribute,${groupcheck_table}.Value,${groupcheck_table}.op
  FROM
r> ${groupcheck_table},${usergroup_table} WHERE ${usergroup_table}.Username = 
'%{SQL-User-Name}' AND ${usergroup_table}.GroupName = ${groupcheck_table}.GroupName 
ORDER BY ${groupcheck_table}.id"
r>         authorize_group_reply_query = "SELECT 
${groupreply_table}.id,${groupreply_table}.GroupName,${groupreply_table}.Attribute,${groupreply_table}.Value,${groupreply_table}.op
  FROM
r> ${groupreply_table},${usergroup_table} WHERE ${usergroup_table}.Username = 
'%{SQL-User-Name}' AND ${usergroup_table}.GroupName = ${groupreply_table}.GroupName 
ORDER BY ${groupreply_table}.id"


r>         #######################################################################
r>         #  Authentication Query
r>         #######################################################################
r>         # This query is used only to get the password for the
r>         # user we want to authenticate.  The password MUST
r>         # be the first field in the return row data.
r>         # The 'Password' attribute is deprecated in favor of 'User-Password'.
r>         #######################################################################

r>         authenticate_query = "SELECT Value,Attribute FROM ${authcheck_table} WHERE 
UserName = '%{User-Name}' AND ( Attribute = 'User-Password' OR Attribute = 'Password' 
OR Attribute =
r> 'Crypt-Password' ) ORDER BY Attribute DESC"

r>         #######################################################################
r>         #  Accounting Queries
r>         #######################################################################
r>         # accounting_onoff_query        - query for Accounting On/Off packets 
r>         # accounting_update_query       - query for Accounting update packets 
r>         # accounting_start_query        - query for Accounting start packets 
r>         # accounting_start_query_alt    - query for Accounting start packets 
r>         #                               (alternate in case first query fails)
r>         # accounting_stop_query         - query for Accounting stop packets 
r>         # accounting_stop_query_alt     - query for Accounting start packets 
r>         #                               (alternate in case first query doesn't
r>         #                                affect any existing rows in the table)
r>         #######################################################################
r>         accounting_onoff_query = "UPDATE ${acct_table1} SET AcctStopTime='%S', 
AcctSessionTime=unix_timestamp('%S') - unix_timestamp(AcctStartTime), 
AcctTerminateCause='%{Acct-Terminate-Cause}',
r> AcctStopDelay = %{Acct-Delay-Time} WHERE AcctSessionTime=0 AND AcctStopTime=0 AND 
NASIPAddress= '%{NAS-IP-Address}' AND AcctStartTime <= '%S'"

r>         accounting_update_query = "UPDATE ${acct_table1} SET FramedIPAddress = 
'%{Framed-IP-Address}' WHERE AcctSessionId = '%{Acct-Session-Id}' AND UserName = 
'%{SQL-User-Name}' AND NASIPAddress=
r> '%{NAS-IP-Address}'"

r>         accounting_start_query = "INSERT into radacct (RadAcctId, AcctSessionId, 
AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, 
AcctStopTime, AcctSessionTime,
r> AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, AcctInputOctets, 
AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause, ServiceType, 
FramedProtocol, FramedIPAddress,
r> AcctStartDelay, AcctStopDelay) values('', '%{Acct-Session-Id}', 
'%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', 
'%{NAS-Port-Id}', '%{NAS-Port-Type}', '%S', '0',
r> '0', '%{Acct-Authentic}', '%{Connect-Info}', '', '0', '0', '%{Called-Station-Id}', 
'%{Calling-Station-Id}', '', '%{Service-Type}', '%{Framed-Protocol}', 
'%{Framed-IP-Address}',
r> '%{Acct-Delay-Time}', '0')"

r>         accounting_start_query_alt  = "UPDATE ${acct_table1} SET AcctStartTime = 
'%S', AcctStartDelay = '%{Acct-Delay-Time}', ConnectInfo_start = '%{Connect-Info}' 
WHERE AcctSessionId =
r> '%{Acct-Session-Id}' AND UserName = '%{SQL-User-Name}' AND NASIPAddress = 
'%{NAS-IP-Address}'"

r>         accounting_stop_query = "UPDATE ${acct_table1} SET AcctStopTime = '%S', 
AcctSessionTime = '%{Acct-Session-Time}', AcctInputOctets = '%{Acct-Input-Octets}', 
AcctOutputOctets =
r> '%{Acct-Output-Octets}', AcctTerminateCause = '%{Acct-Terminate-Cause}', 
AcctStopDelay = '%{Acct-Delay-Time}', ConnectInfo_stop = '%{Connect-Info}' WHERE 
AcctSessionId = '%{Acct-Session-Id}' AND
r> UserName = '%{SQL-User-Name}' AND NASIPAddress = '%{NAS-IP-Address}'"

r>         accounting_stop_query_alt = "INSERT into radacct (RadAcctId, AcctSessionId, 
AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, 
AcctStopTime,
r> AcctSessionTime, AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, 
AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, 
AcctTerminateCause, ServiceType, FramedProtocol,
r> FramedIPAddress, AcctStartDelay, AcctStopDelay) values('', '%{Acct-Session-Id}', 
'%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', 
'%{NAS-Port-Id}',
r> '%{NAS-Port-Type}', '0', '%S', '%{Acct-Session-Time}', '%{Acct-Authentic}', '', 
'%{Connect-Info}', '%{Acct-Input-Octets}', '%{Acct-Output-Octets}', 
'%{Called-Station-Id}', '%{Calling-Station-Id}',
r> '%{Acct-Terminate-Cause}', '%{Service-Type}', '%{Framed-Protocol}', 
'%{Framed-IP-Address}', '0', '%{Acct-Delay-Time}')"

r> }


-- 
~/ZARAZA
�� � ������, ������, ���������� ������������ ��� ������ �������. (����)


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to