Sophie

Sophie

distrib > * > 2010.0 > * > by-pkgid > 500b9b21c010b3306169b72d768cb328 > files > 4

freeradius-mysql-2.1.8-6mdv2010.0.x86_64.rpm

# -*- text -*-

##
##  Queries to update the CUI table.
##
postauth_query = "INSERT IGNORE INTO ${cui_table} \
	(clientipaddress, callingstationid, username, cui, lastaccounting) \
        VALUES \
	('%{Client-IP-Address}', '%{Calling-Station-Id}', '%{User-Name}', '%{reply:Chargeable-User-Identity}', NULL) ON DUPLICATE KEY UPDATE lastaccounting='0000-00-00 00:00:00', cui='%{reply:Chargeable-User-Identity}'";

accounting_start_query = "UPDATE ${cui_table} \
	SET \
                lastaccounting = CURRENT_TIMESTAMP \
	WHERE clientipaddress = '%{Client-IP-Address}' \
        AND callingstationid = '%{Calling-Station-Id}' \
        AND username = '%{User-Name}' \
	AND cui = '%{Chargeable-User-Identity}'";
  
accounting_update_query = "UPDATE ${cui_table} \
	SET \
                lastaccounting = CURRENT_TIMESTAMP \
	WHERE clientipaddress = '%{Client-IP-Address}' \
        AND callingstationid = '%{Calling-Station-Id}' \
        AND username = '%{User-Name}' \
	AND cui = '%{Chargeable-User-Identity}'";

accounting_stop_query = "DELETE FROM ${cui_table} WHERE \
	clientipaddress = '%{Client-IP-Address}' \
	AND callingstationid = '%{Calling-Station-Id}' \
	AND username = '%{User-Name}' \
	AND cui = '%{Chargeable-User-Identity}'";