Skip to content
GitLab
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
f24d760c
Commit
f24d760c
authored
May 16, 2019
by
Nigel Kukard
Browse files
Stats should come after FUP so we can pickup FUP state
parent
39c09cec
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/smradius/modules/features/mod_feature_user_stats.pm
View file @
f24d760c
...
...
@@ -149,6 +149,7 @@ sub updateUserStats
}
# Set user FUP state
# NK: Perhaps this should be moved to the mod_feature_fup module?
my
$fupState
=
$user
->
{'
AttributeConditionalVariables
'}
->
{"
SMRadius_FUP
"};
if
(
defined
(
$fupState
))
{
$fupState
=
$fupState
->
[
0
];
...
...
@@ -156,7 +157,7 @@ sub updateUserStats
$fupState
=
"
-1
";
}
$res
=
$user
->
{'
_UserDB
'}
->
{'
Users_data_set
'}(
$server
,
$user
,
'
mod_feature_
user_stats
','
FUP
State
',
'
mod_feature_
fup
','
State
',
$fupState
);
if
(
!
defined
(
$res
))
{
...
...
smradiusd.conf
View file @
f24d760c
...
...
@@ -160,10 +160,10 @@ EOT
[
features
]
modules
=<<
EOT
mod_feature_capping
mod_feature_user_stats
mod_feature_update_user_stats_sql
mod_feature_validity
mod_feature_fup
mod_feature_user_stats
mod_feature_update_user_stats_sql
EOT
...
...
t/200-dbtests.t
View file @
f24d760c
...
...
@@ -877,8 +877,8 @@ if ($child = fork()) {
"
'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
',
{'
UserID
'
=>
$user5_ID
,
'
Name
'
=>
"
FUP
State
"},
{'
Value
'
=>
0
},
{'
UserID
'
=>
$user5_ID
,
'
Name
'
=>
"
mod_feature_fup/
State
"},
{'
Value
'
=>
"
0
"
},
1
,
# Disable order
);
...
...
@@ -951,8 +951,8 @@ if ($child = fork()) {
"
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
',
{'
UserID
'
=>
$user6_ID
,
'
Name
'
=>
"
FUP
State
"},
{'
Value
'
=>
1
},
{'
UserID
'
=>
$user6_ID
,
'
Name
'
=>
"
mod_feature_fup/
State
"},
{'
Value
'
=>
"
1
"
},
1
,
# Disable order
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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