Update control in Post-Auth
Randeep
randeep123 at gmail.com
Tue Aug 9 19:54:54 CEST 2016
We had done it in authorize block. Will try this.
Thank you Alan.
On Mon, Aug 8, 2016 at 10:00 PM, Alan DeKok <aland at deployingradius.com>
wrote:
> On Aug 8, 2016, at 12:37 PM, Randeep <randeep123 at gmail.com> wrote:
> > I want to check two things in pre-auth.
> >
> > 1. Whether the user's network plan subscription is active or not.
> > 2. Whether the data usage has crossed the Max-Data cap or not.
> >
> > In post-auth,
> ...
> > #check1
> > #Checking condition for plan subscription expiry (days from
> > subscription > plan duration)
> > if ("%{control:Tmp-Integer-3}" > "%{control:Tmp-Integer-2}") {
> > update {
> > control:Auth-Type := "Reject"
>
> "authenticate" and "Auth-Type" are run *before* the post-auth section.
> So setting Auth-Type here does nothing.
>
> Just delete that line.
>
> Then, add a plain "reject" to the block. i.e.
>
> #Checking whether usage exceeded the Max-Data cap
> if ("%{control:Tmp-Integer-0}" > "%{control:Tmp-Integer-1}") {
> update reply {
> Mikrotik-Rate-Limit := "%{control:Tmp-String-1}"
> }
>
> reject
> }
>
> Alan DeKok.
>
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/
> list/users.html
--
Randeep
Mob: +919447831699[kerala]
Mob: +919880050349[B'lore]
http://twitter.com/Randeeppr
http://in.linkedin.com/in/randeeppr
[image: --]
Randeep Raman
[image: http://]about.me/Randeeppr
<http://about.me/Randeeppr>
More information about the Freeradius-Users
mailing list