Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
smradius
smradius
Commits
411585c3
Commit
411585c3
authored
May 15, 2019
by
Nigel Kukard
Browse files
Changed wording from Client to User
parent
64a0f66c
Changes
1
Show whitespace changes
Inline
Side-by-side
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
Supports
Markdown
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