Commit e5c1b0ef authored by Nigel Kukard's avatar Nigel Kukard

Use status codes for Acct-Status-Type, not text

Change-Id: I13f966f7d0845cea45b78b0fa166fcce6e52b948
parent eece52fb
......@@ -451,7 +451,7 @@ sub acct_log
#
# If its a new period we're going to trigger START
my $newPeriod;
if ($packet->attr('Acct-Status-Type') eq "Stop" || $packet->attr('Acct-Status-Type') eq "Alive") {
if ($packet->rawattr('Acct-Status-Type') eq "2" || $packet->rawattr('Acct-Status-Type') eq "3") {
# Replace template entries
my @dbDoParams = templateReplace($config->{'accounting_update_get_records_query'},$template);
......@@ -571,7 +571,7 @@ sub acct_log
# Possible aswell if we are missing a start packet for this session or for the period
#
if ($packet->attr('Acct-Status-Type') eq "Start" || $newPeriod) {
if ($packet->rawattr('Acct-Status-Type') eq "1" || $newPeriod) {
# Replace template entries
my @dbDoParams = templateReplace($config->{'accounting_start_query'},$template);
......@@ -599,7 +599,7 @@ sub acct_log
# S T O P P A C K E T specifics
#
if ($packet->attr('Acct-Status-Type') eq "Stop") {
if ($packet->rawattr('Acct-Status-Type') eq "2") {
# Replace template entries
my @dbDoParams = templateReplace($config->{'accounting_stop_status_query'},$template);
......
......@@ -101,13 +101,13 @@ Acct-Delay-Time: %{accounting.Acct-Delay-Time}
}
$template->{'user'} = $user;
if ($packet->attr('Acct-Status-Type') eq "Start") {
if ($packet->rawattr('Acct-Status-Type') eq "1") {
$server->log(LOG_DEBUG,"Start Packet: ".$packet->dump());
} elsif ($packet->attr('Acct-Status-Type') eq "Alive") {
} elsif ($packet->rawattr('Acct-Status-Type') eq "3") {
$server->log(LOG_DEBUG,"Alive Packet: ".$packet->dump());
} elsif ($packet->attr('Acct-Status-Type') eq "Stop") {
} elsif ($packet->rawattr('Acct-Status-Type') eq "2") {
$server->log(LOG_DEBUG,"Stop Packet: ".$packet->dump());
}
......
......@@ -423,7 +423,7 @@ sub post_acct_hook
return MOD_RES_SKIP if ($user->{'_UserDB'}->{'Name'} eq "SQL User Database (MAC authentication)");
# Exceeding maximum, must be disconnected
return MOD_RES_SKIP if ($packet->attr('Acct-Status-Type') ne "Alive");
return MOD_RES_SKIP if ($packet->rawattr('Acct-Status-Type') ne "3");
$server->log(LOG_DEBUG,"[MOD_FEATURE_CAPPING] POST ACCT HOOK");
......
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