pool name per nas AND per user
tnt at kalik.net
tnt at kalik.net
Tue Oct 14 23:15:21 CEST 2008
>So In the authorize section i tried to add an update directive where i
>define a variable which has the result of the sql query as value.
>Then i want to concatenate this variable with the value of the Pool-Name
>attribute as defined in the users file and set it as the new value of
>Pool-Name. I think this would work for what i want to do.
>
>update control {
> "%{MANA-DSL-Type}" = mysqldb:"SELECT value FROM radcheck
>WHERE attribute='Subscription-Type' AND username='%{User-Name}'"
> if ("%{MANA-DSL-Type}") {
> Pool-Name := "%{Pool-Name}""%{ADSL-Type}"
> }
> }
>
Ugh.
1. Forget custom dictionaries. Use already defined temporary attributes
from freeradius internal dictionary (ie. Tmp-String-0,...,
Tmp-Integer-0, ... etc.)
2. "%{}" goes around the value not attribute name:
Tmp-String-0 = "%{mysqldb:SELECT value FROM...}"
3. You can't put if inside the control section. You can put update
control inside if section.
update control {
read temporary value from the database
}
if(whatever) {
update control { ...
Ivan Kalik
Kalik Informatika ISP
More information about the Freeradius-Users
mailing list