using groupname in accounting/authorize in deafult

firing neurons firingneurons at mail.com
Thu Nov 17 10:57:55 CET 2016


   Hi,

   TL;DR: read last 5 lines.

   I want to use the groupname of the user for which the NAS has sent
   Access/Accouting-Request or Interim update in a sql query (via xlat) in
   default.

   I have tired

   groupname='%{Group}'
   groupname='%{Sql-Group}' (this should be the one i think)
   groupname='%{Group-name}'

   but it always resolves to '' (empty) like the attributes doesn't exist.

   doing Tmp-String-0 := "%{sql: SELECT groupname FROM radusergroup WHERE
   username = '%{User-Name}' ORDER BY priority}"

   will set Tmp-String-0 to the groupname but when i try to use it in
   another query like groupname='%{Tmp-String-0}', it resovles to ''
   (empty).

   Basically I want this to happen:
   for two groups named abc and abc_ex with the same attribute name having
   diffrent vaules of said attribute:

   groupname = '%{Sql-Group}_Ex' resolves to groupname = abc_ex
   and
   groupname = '%{Sql-Group}' resolves to groupname = abc

   Regards,
   FN


More information about the Freeradius-Users mailing list