refresh variable after exec module
bLn
pruebasradius at gmail.com
Wed Jun 10 17:45:49 CEST 2009
Hi,
I've reviewed those manuals (users and unlang) and I think I've got the
same way.
My script sets into radgroupreply 2 differents values Session-Timeout or
Reply-Message, when the script or exec module is finished.
Then, in Post-Auth section I do the "update", like this:
post-auth{
.....
exec
update reply {
Session-Timeout:="%{reply:Session-Timeout}"
}
}
Post-Auth-Type REJECT {
attr_filter.access_reject
update reply {
Reply-Message := "%{reply:Reply-Message}"
}
sql
}
I've set in all places (op into radgroupreply and those sentences) with
":=" operator
mysql> select * from radgroupreply;
+----+---------------+---------------------+----+------------+------+
| id | GroupName | Attribute | op | Value | prio |
+----+---------------+---------------------+----+------------+------+
| 1 | Navega Gratis | Idle-Timeout | := | 300 | 0 |
| 2 | Navega Gratis | Mikrotik-Rate-Limit | := | 128k/512k | 0 |
| 4 | Navega12meses | Idle-Timeout | := | 300 | 0 |
| 5 | Navega12meses | Mikrotik-Rate-Limit | := | 128k/6M | 0 |
| 7 | NavegaMes | Idle-Timeout | := | 300 | 0 |
| 8 | NavegaMes | Mikrotik-Rate-Limit | := | 128k/3M | 0 |
| 10 | Navega Hoy | Idle-Timeout | := | 300 | 0 |
| 11 | Navega Hoy | Mikrotik-Rate-Limit | := | 128k/3M | 0 |
| 13 | Navega24horas | Idle-Timeout | := | 300 | 0 |
| 14 | Navega24horas | Mikrotik-Rate-Limit | := | 128k/3072k | 0 |
| 3 | Navega Gratis | Session-Timeout | := | 1800 | 0 |
| 15 | Navega24horas | Session-Timeout | := | 8938 | 0 |
| 9 | NavegaMes | Reply-Message | := | NULL | 0 |
| 16 | Navega24horas | Reply-Message | := | NULL | 0 |
| 12 | Navega Gratis | Reply-Message | := | NULL | 0 |
| 17 | Navega12meses | Reply-Message | := | NULL | 0 |
| 18 | Navega Hoy | Reply-Message | := | NULL | 0 |
+----+---------------+---------------------+----+------------+------+
but the value is the same, the before one
I've got a dude.I've proved Reply-Message:="%{reply:Reply-Message}}" but
"%{reply:Reply-Message}}" is not the new value in Reply-Message
I think, my problem is the new value is being saved into database and
it's impossible get it again without a "select" query and I don't know
how I can exit the value out the script. I'm trying to salve this value
into a variable "Reply-Message" (however into the script is REPLY_MESSAGE).
Also I'm playing with the return value of the program run, ie:with exit
1 (reject), exit 2 (fail)...and then I'll do a conditional if with
Exit-Program...but unsuccessfully too
Alan DeKok escribió:
> bLn wrote:
>
>> My script returns 2 possible values:
>> a) If all is correct (ie: an user has time and money to connect) then I
>> set in Session-Timeout with the time available to this user
>> b) If not, then I set Reply-Message with the exactly error.
>>
>> Both of them are in radgroupreply in my database. For that, the value is
>> previously cached in auth section and I can't refresh or update the new
>> value after, in post-auth section
>>
>
> Yes, you can. See the documentation on the operators in "man users",
> or "man unlang". The ":=" operator is likely what you want.
>
> Alan DeKok.
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>
>
More information about the Freeradius-Users
mailing list