From fdb47b332087bacc5f1bbc341f3c3022a8ec3be9 Mon Sep 17 00:00:00 2001 From: Scott Armitage Date: Sun, 21 Oct 2012 17:13:31 +0100 Subject: [PATCH] Changed cui policy. Changed the updating of the cui in the database to occur in the cui.post-auth. Changed mods-available/cui module name --- raddb/mods-available/cui | 2 +- raddb/policy.d/cui | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/raddb/mods-available/cui b/raddb/mods-available/cui index fc444ff..f64cc3d 100644 --- a/raddb/mods-available/cui +++ b/raddb/mods-available/cui @@ -8,7 +8,7 @@ # Schema raddb/sql/DB/cui.sql # Queries raddb/sql/DB/cui.conf # -sql cui { +sql cuisql { # # Set the database to one of: # diff --git a/raddb/policy.d/cui b/raddb/policy.d/cui index d3faf67..b0df5b3 100644 --- a/raddb/policy.d/cui +++ b/raddb/policy.d/cui @@ -86,10 +86,21 @@ cui.post-auth { update reply { User-Name-="%{reply:User-Name}" } + # + # The section below will store a CUI for the User in the DB. + # You need to configure the cuisql module and your database for this to work. + # If your NAS-es can do CUI based accounting themselves + # or you do not care about accounting, comment out the three lines below. + # + if (reply:Chargeable-User-Identity) { + cuisql + } } } - +# +# If your NAS-es can do CUI based accounting or you do not care about +# accounting then just comment out the call to cui in ...... # # If we had stored a CUI for the User, add it to the request. # @@ -109,16 +120,6 @@ cui.accounting { # this CUI. # if (Chargeable-User-Identity && (Chargeable-User-Identity != "")) { - cui + cuisql } } - -# -# If there is a CUI attribute in the reply, add it to the DB. -# -cui_updatedb { - if (reply:Chargeable-User-Identity) { - cui - } -} - -- 2.1.4