Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
smradius
smradius
Commits
411585c3
Commit
411585c3
authored
May 15, 2019
by
Nigel Kukard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed wording from Client to User
parent
64a0f66c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
lib/smradius/modules/features/mod_feature_capping.pm
lib/smradius/modules/features/mod_feature_capping.pm
+9
-9
No files found.
lib/smradius/modules/features/mod_feature_capping.pm
View file @
411585c3
# Capping support
# Copyright (C) 2007-201
7
, AllWorldIT
# Copyright (C) 2007-201
9
, AllWorldIT
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
...
...
@@ -219,7 +219,7 @@ sub post_auth_hook
#
# Allow for capping overrides by
client
attribute
# Allow for capping overrides by attribute
#
if
(
defined
(
$user
->
{'
ConfigAttributes
'}
->
{'
SMRadius-Config-Capping-Uptime-Multiplier
'}))
{
...
...
@@ -231,7 +231,7 @@ sub post_auth_hook
$uptimeLimitWithTopups
=
$newLimit
;
$accountingUsage
->
{'
TotalSessionTime
'}
=
$newSessionTime
;
$server
->
log
(
LOG_INFO
,"
[MOD_FEATURE_CAPPING]
Client
uptime multiplier '
$multiplier
' changes
"
.
$server
->
log
(
LOG_INFO
,"
[MOD_FEATURE_CAPPING]
User
uptime multiplier '
$multiplier
' changes
"
.
"
uptime limit ('
$uptimeLimitWithTopups
' => '
$newLimit
'),
"
.
"
uptime usage ('
"
.
$accountingUsage
->
{'
TotalSessionTime
'}
.
"
' => '
$newSessionTime
')
"
);
...
...
@@ -245,7 +245,7 @@ sub post_auth_hook
$trafficLimitWithTopups
=
$newLimit
;
$accountingUsage
->
{'
TotalDataUsage
'}
=
$newDataUsage
;
$server
->
log
(
LOG_INFO
,"
[MOD_FEATURE_CAPPING]
Client
traffic multiplier '
$multiplier
' changes
"
.
$server
->
log
(
LOG_INFO
,"
[MOD_FEATURE_CAPPING]
User
traffic multiplier '
$multiplier
' changes
"
.
"
traffic limit ('
$trafficLimitWithTopups
' => '
$newLimit
'),
"
.
"
traffic usage ('
"
.
$accountingUsage
->
{'
TotalDataUsage
'}
.
"
' => '
$newDataUsage
')
"
);
...
...
@@ -346,7 +346,7 @@ sub post_acct_hook
# Skip MAC authentication
return
MOD_RES_SKIP
if
(
$user
->
{'
_UserDB
'}
->
{'
Name
'}
eq
"
SQL User Database (MAC authentication)
");
#
Exceeding maximum, must be
disconnect
ed
#
User is either connecting 'START' or
disconnect
ing 'STOP'
return
MOD_RES_SKIP
if
(
$packet
->
rawattr
('
Acct-Status-Type
')
ne
"
1
"
&&
$packet
->
rawattr
('
Acct-Status-Type
')
ne
"
3
");
$server
->
log
(
LOG_DEBUG
,"
[MOD_FEATURE_CAPPING] POST ACCT HOOK
");
...
...
@@ -440,20 +440,20 @@ sub post_acct_hook
#
# Allow for capping overrides by
client
attribute
# Allow for capping overrides by
user
attribute
#
if
(
defined
(
$user
->
{'
ConfigAttributes
'}
->
{'
SMRadius-Config-Capping-Uptime-Multiplier
'}))
{
my
$multiplier
=
pop
(
@
{
$user
->
{'
ConfigAttributes
'}
->
{'
SMRadius-Config-Capping-Uptime-Multiplier
'}});
my
$newLimit
=
$uptimeLimitWithTopups
*
$multiplier
;
$server
->
log
(
LOG_INFO
,"
[MOD_FEATURE_CAPPING]
Client
cap uptime multiplier '
$multiplier
' changes limit
"
.
$server
->
log
(
LOG_INFO
,"
[MOD_FEATURE_CAPPING]
User
cap uptime multiplier '
$multiplier
' changes limit
"
.
"
from '
$uptimeLimitWithTopups
' to '
$newLimit
'
");
$uptimeLimitWithTopups
=
$newLimit
;
}
if
(
defined
(
$user
->
{'
ConfigAttributes
'}
->
{'
SMRadius-Config-Capping-Traffic-Multiplier
'}))
{
my
$multiplier
=
pop
(
@
{
$user
->
{'
ConfigAttributes
'}
->
{'
SMRadius-Config-Capping-Traffic-Multiplier
'}});
my
$newLimit
=
$trafficLimitWithTopups
*
$multiplier
;
$server
->
log
(
LOG_INFO
,"
[MOD_FEATURE_CAPPING]
Client
cap traffic multiplier '
$multiplier
' changes limit
"
.
$server
->
log
(
LOG_INFO
,"
[MOD_FEATURE_CAPPING]
User
cap traffic multiplier '
$multiplier
' changes limit
"
.
"
from '
$trafficLimitWithTopups
' to '
$newLimit
'
");
$trafficLimitWithTopups
=
$newLimit
;
}
...
...
@@ -491,7 +491,7 @@ sub post_acct_hook
## @internal
# Code snippet to grab the current
uptime
limit by processing the user attributes
# Code snippet to grab the current
attribute key
limit by processing the user attributes
sub
_getAttributeKeyLimit
{
my
(
$server
,
$user
,
$attributeKey
)
=
@_
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment