Commit 411585c3 authored by Nigel Kukard's avatar Nigel Kukard

Changed wording from Client to User

parent 64a0f66c
# Capping support # Capping support
# Copyright (C) 2007-2017, AllWorldIT # Copyright (C) 2007-2019, AllWorldIT
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -219,7 +219,7 @@ sub post_auth_hook ...@@ -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'})) { if (defined($user->{'ConfigAttributes'}->{'SMRadius-Config-Capping-Uptime-Multiplier'})) {
...@@ -231,7 +231,7 @@ sub post_auth_hook ...@@ -231,7 +231,7 @@ sub post_auth_hook
$uptimeLimitWithTopups = $newLimit; $uptimeLimitWithTopups = $newLimit;
$accountingUsage->{'TotalSessionTime'} = $newSessionTime; $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 limit ('$uptimeLimitWithTopups' => '$newLimit'), ".
"uptime usage ('".$accountingUsage->{'TotalSessionTime'}."' => '$newSessionTime')" "uptime usage ('".$accountingUsage->{'TotalSessionTime'}."' => '$newSessionTime')"
); );
...@@ -245,7 +245,7 @@ sub post_auth_hook ...@@ -245,7 +245,7 @@ sub post_auth_hook
$trafficLimitWithTopups = $newLimit; $trafficLimitWithTopups = $newLimit;
$accountingUsage->{'TotalDataUsage'} = $newDataUsage; $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 limit ('$trafficLimitWithTopups' => '$newLimit'), ".
"traffic usage ('".$accountingUsage->{'TotalDataUsage'}."' => '$newDataUsage')" "traffic usage ('".$accountingUsage->{'TotalDataUsage'}."' => '$newDataUsage')"
); );
...@@ -346,7 +346,7 @@ sub post_acct_hook ...@@ -346,7 +346,7 @@ sub post_acct_hook
# Skip MAC authentication # Skip MAC authentication
return MOD_RES_SKIP if ($user->{'_UserDB'}->{'Name'} eq "SQL User Database (MAC authentication)"); return MOD_RES_SKIP if ($user->{'_UserDB'}->{'Name'} eq "SQL User Database (MAC authentication)");
# Exceeding maximum, must be disconnected # User is either connecting 'START' or disconnecting 'STOP'
return MOD_RES_SKIP if ($packet->rawattr('Acct-Status-Type') ne "1" && $packet->rawattr('Acct-Status-Type') ne "3"); 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"); $server->log(LOG_DEBUG,"[MOD_FEATURE_CAPPING] POST ACCT HOOK");
...@@ -440,20 +440,20 @@ sub 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'})) { if (defined($user->{'ConfigAttributes'}->{'SMRadius-Config-Capping-Uptime-Multiplier'})) {
my $multiplier = pop(@{$user->{'ConfigAttributes'}->{'SMRadius-Config-Capping-Uptime-Multiplier'}}); my $multiplier = pop(@{$user->{'ConfigAttributes'}->{'SMRadius-Config-Capping-Uptime-Multiplier'}});
my $newLimit = $uptimeLimitWithTopups * $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'"); "from '$uptimeLimitWithTopups' to '$newLimit'");
$uptimeLimitWithTopups = $newLimit; $uptimeLimitWithTopups = $newLimit;
} }
if (defined($user->{'ConfigAttributes'}->{'SMRadius-Config-Capping-Traffic-Multiplier'})) { if (defined($user->{'ConfigAttributes'}->{'SMRadius-Config-Capping-Traffic-Multiplier'})) {
my $multiplier = pop(@{$user->{'ConfigAttributes'}->{'SMRadius-Config-Capping-Traffic-Multiplier'}}); my $multiplier = pop(@{$user->{'ConfigAttributes'}->{'SMRadius-Config-Capping-Traffic-Multiplier'}});
my $newLimit = $trafficLimitWithTopups * $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'"); "from '$trafficLimitWithTopups' to '$newLimit'");
$trafficLimitWithTopups = $newLimit; $trafficLimitWithTopups = $newLimit;
} }
...@@ -491,7 +491,7 @@ sub post_acct_hook ...@@ -491,7 +491,7 @@ sub post_acct_hook
## @internal ## @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 sub _getAttributeKeyLimit
{ {
my ($server,$user,$attributeKey) = @_; my ($server,$user,$attributeKey) = @_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment