Commit f24d760c authored by Nigel Kukard's avatar Nigel Kukard

Stats should come after FUP so we can pickup FUP state

parent 39c09cec
...@@ -149,6 +149,7 @@ sub updateUserStats ...@@ -149,6 +149,7 @@ sub updateUserStats
} }
# Set user FUP state # Set user FUP state
# NK: Perhaps this should be moved to the mod_feature_fup module?
my $fupState = $user->{'AttributeConditionalVariables'}->{"SMRadius_FUP"}; my $fupState = $user->{'AttributeConditionalVariables'}->{"SMRadius_FUP"};
if (defined($fupState)) { if (defined($fupState)) {
$fupState = $fupState->[0]; $fupState = $fupState->[0];
...@@ -156,7 +157,7 @@ sub updateUserStats ...@@ -156,7 +157,7 @@ sub updateUserStats
$fupState = "-1"; $fupState = "-1";
} }
$res = $user->{'_UserDB'}->{'Users_data_set'}($server,$user, $res = $user->{'_UserDB'}->{'Users_data_set'}($server,$user,
'mod_feature_user_stats','FUPState', 'mod_feature_fup','State',
$fupState $fupState
); );
if (!defined($res)) { if (!defined($res)) {
......
...@@ -160,10 +160,10 @@ EOT ...@@ -160,10 +160,10 @@ EOT
[features] [features]
modules=<<EOT modules=<<EOT
mod_feature_capping mod_feature_capping
mod_feature_user_stats
mod_feature_update_user_stats_sql
mod_feature_validity mod_feature_validity
mod_feature_fup mod_feature_fup
mod_feature_user_stats
mod_feature_update_user_stats_sql
EOT EOT
......
...@@ -877,8 +877,8 @@ if ($child = fork()) { ...@@ -877,8 +877,8 @@ if ($child = fork()) {
"'14988:Mikrotik-Rate-Limit' is returned on the negative side of the IF"); "'14988:Mikrotik-Rate-Limit' is returned on the negative side of the IF");
testDBResults("Check FUP state was added to the user stats table as 0",'users_data', testDBResults("Check FUP state was added to the user stats table as 0",'users_data',
{'UserID' => $user5_ID, 'Name' => "FUPState"}, {'UserID' => $user5_ID, 'Name' => "mod_feature_fup/State"},
{'Value' => 0}, {'Value' => "0"},
1, # Disable order 1, # Disable order
); );
...@@ -951,8 +951,8 @@ if ($child = fork()) { ...@@ -951,8 +951,8 @@ if ($child = fork()) {
"vendor attribute '14988:Mikrotik-Rate-Limit' is returned on the success side of the FUP check"); "vendor attribute '14988:Mikrotik-Rate-Limit' is returned on the success side of the FUP check");
testDBResults("Check FUP state was added to the user stats table as 1",'users_data', testDBResults("Check FUP state was added to the user stats table as 1",'users_data',
{'UserID' => $user6_ID, 'Name' => "FUPState"}, {'UserID' => $user6_ID, 'Name' => "mod_feature_fup/State"},
{'Value' => 1}, {'Value' => "1"},
1, # Disable order 1, # Disable order
); );
......
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