diff --git a/FreeRadius.md b/FreeRadius.md index a145753..8c52a55 100644 --- a/FreeRadius.md +++ b/FreeRadius.md @@ -85,7 +85,25 @@ authorize { quotalimit accessperiod uptimelimit - .... + + if (User-Name){ + if("%{sql:UPDATE radacct set AcctStopTime=ADDDATE(AcctStartTime,INTERVAL AcctSessionTime SECOND), AcctTerminateCause='Clear-Stale Session' WHERE UserName='%{User-Name}' and CallingStationId='%{Calling-Station-Id}' and AcctStopTime is NULL}"){ + } + } + + expiration{ + userlock = 1 + } + if(userlock){ + # Let him connect with EXPIRED pool in reply + ok + update reply { + Reply-Message := "Your account has expired, %{User-Name} / Reason: DATE LIMIT REACHED" + Framed-Pool := "Expired" + } + } + + ..... } accounting {