Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
smradius
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
shail
smradius
Commits
d07d60f7
Commit
d07d60f7
authored
16 years ago
by
Robert Anderson
Browse files
Options
Downloads
Patches
Plain Diff
print totals and fixed up bandwidth usage calculations
parent
1f4fc1d6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
webui/user-logs.php
+71
-37
71 additions, 37 deletions
webui/user-logs.php
with
71 additions
and
37 deletions
webui/user-logs.php
+
71
−
37
View file @
d07d60f7
...
...
@@ -21,7 +21,7 @@
include_once
(
"includes/header.php"
);
include_once
(
"includes/footer.php"
);
include_once
(
"includes/db.php"
);
include
(
"includes/radiuscodes.php"
);
$db
=
connect_db
();
...
...
@@ -48,7 +48,7 @@ if (isset($_POST['user_id'])) {
?>
<form
id=
"main_form"
action=
"user-logs.php"
method=
"post"
>
<!--
Search thing
s -->
<!--
User input from and to date
s -->
<div>
<table>
<tr>
...
...
@@ -156,6 +156,9 @@ if (isset($_POST['user_id'])) {
$res
=
$db
->
prepare
(
$sql
);
$res
->
execute
(
$extraSQLVals
);
$totalInputData
=
0
;
$totalOutputData
=
0
;
$totalSessionTime
=
0
;
$rownums
=
0
;
while
(
$row
=
$res
->
fetchObject
())
{
...
...
@@ -169,60 +172,69 @@ if (isset($_POST['user_id'])) {
# ==========
# Input
$inputData
=
0
;
$inputData
Item
=
0
;
if
(
!
empty
(
$row
->
acctinputoctets
)
&&
$row
->
acctinputoctets
>
0
)
{
$inputData
=
(
$row
->
accinputoctets
/
1024
/
1024
);
$inputData
Item
=
(
$row
->
accinputoctets
/
1024
/
1024
);
}
if
(
!
empty
(
$row
->
acctinputgigawords
)
&&
$row
->
inputgigawords
>
0
)
{
$inputData
=
(
$row
->
acctinputgigawords
*
4096
);
$inputData
Item
=
(
$row
->
acctinputgigawords
*
4096
);
}
if
(
$inputData
!=
0
)
{
$inputDataDisplay
=
ceil
(
$inputData
*
100
)
/
100
;
if
(
$inputData
Item
!=
0
)
{
$inputData
Item
Display
=
ceil
(
$inputData
Item
*
100
)
/
100
;
}
else
{
$inputDataDisplay
=
0
;
$inputData
Item
Display
=
0
;
}
$totalInputData
=
$totalInputData
+
$inputData
;
$totalInputData
=
$totalInputData
+
$inputData
Item
;
# Output
$outputData
=
0
;
$outputData
Item
=
0
;
if
(
!
empty
(
$row
->
acctoutputoctets
)
&&
$row
->
acctoutputoctets
>
0
)
{
$outputData
=
(
$row
->
acctoutputoctets
/
1024
/
1024
);
$outputData
Item
=
(
$row
->
acctoutputoctets
/
1024
/
1024
);
}
if
(
!
empty
(
$row
->
acctoutputgigawords
)
&&
$row
->
acctoutputgigawords
>
0
)
{
$outputData
=
(
$row
->
acctoutputgigawords
*
4096
);
$outputData
Item
=
(
$row
->
acctoutputgigawords
*
4096
);
}
if
(
$outputData
!=
0
)
{
$outputData
Display
=
ceil
(
$outputData
*
100
)
/
100
;
if
(
$outputData
Item
!=
0
)
{
$outputData
Item
=
ceil
(
$outputData
Item
*
100
)
/
100
;
}
else
{
$outputData
Display
=
0
;
$outputData
Item
=
0
;
}
$totalOutputData
=
$totalOutputData
+
$outputData
;
$totalOutputData
=
$totalOutputData
+
$outputDataItem
;
# Add up time
if
(
!
empty
(
$row
->
acctsessiontime
)
&&
$row
->
acctsessiontime
>
0
)
{
$sessionTimeItem
=
$row
->
acctsessiontime
/
60
;
$sessionTimeItem
=
ceil
(
$sessionTimeItem
*
100
)
/
100
;
}
$totalSessionTime
=
$totalSessionTime
+
$sessionTimeItem
;
$totalSessionTime
=
ceil
(
$totalSessionTime
*
100
)
/
100
;
?>
<tr
class=
"resultsitem"
>
<td
class=
"textcenter"
>
<?php
echo
$row
->
eventtimestamp
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
servicetype
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
framedprotocol
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
nasport
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
nasporttype
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
callingstationid
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
calledstationid
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
nasportid
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
acctsessionid
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
framedipaddress
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
acctauthentic
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
nasidentifier
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
nasipaddress
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
acctdelaytime
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$
row
->
acct
session
t
ime
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$inputData
Display
?>
Mbytes
</td>
<td
class=
"textcenter"
>
<?php
echo
$outputData
Display
?>
Mbytes
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
acctstatustype
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
acctterminatecause
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
eventtimestamp
;
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
servicetype
;
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
framedprotocol
;
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
nasport
;
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
nasporttype
;
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
callingstationid
;
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
calledstationid
;
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
nasportid
;
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
acctsessionid
;
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
framedipaddress
;
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
acctauthentic
;
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
nasidentifier
;
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
nasipaddress
;
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
acctdelaytime
;
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
$session
T
ime
Item
;
?>
Min
</td>
<td
class=
"textcenter"
>
<?php
echo
$inputData
Item
;
?>
MB
</td>
<td
class=
"textcenter"
>
<?php
echo
$outputData
Item
;
?>
MB
</td>
<td
class=
"textcenter"
>
<?php
echo
$row
->
acctstatustype
;
?>
</td>
<td
class=
"textcenter"
>
<?php
echo
strRadiusTermCode
(
$row
->
acctterminatecause
);
?>
</td>
</tr>
<?php
}
...
...
@@ -233,10 +245,32 @@ if (isset($_POST['user_id'])) {
<tr>
<td
colspan=
"23"
class=
"textcenter"
>
No logs found for user:
<?php
echo
$getuser
?>
</td>
</tr>
<?php
}
else
{
?>
<tr
class=
"resultsitem"
>
<td
class=
"textcenter"
></td>
<td
class=
"textcenter"
></td>
<td
class=
"textcenter"
></td>
<td
class=
"textcenter"
></td>
<td
class=
"textcenter"
></td>
<td
class=
"textcenter"
></td>
<td
class=
"textcenter"
></td>
<td
class=
"textcenter"
></td>
<td
class=
"textcenter"
></td>
<td
class=
"textcenter"
></td>
<td
class=
"textcenter"
></td>
<td
class=
"textcenter"
></td>
<td
class=
"textcenter"
></td>
<td
class=
"textcenter"
></td>
<td
class=
"textcenter"
style=
"font-weight: bold;"
>
<?
echo
$totalSessionTime
?>
Min
</td>
<td
class=
"textcenter"
style=
"font-weight: bold;"
>
<?
echo
$totalInputData
?>
MB
</td>
<td
class=
"textcenter"
style=
"font-weight: bold;"
>
<?
echo
$totalOutputData
?>
MB
</td>
<td
class=
"textcenter"
></td>
<td
class=
"textcenter"
></td>
</tr>
<?php
}
unset
(
$rownums
);
}
else
{
?>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment