Line 1... |
Line 1... |
1 |
<?php
|
1 |
<?php
|
- |
|
2 |
//gestion de la langue
|
- |
|
3 |
$origine='user_accounting';
|
- |
|
4 |
if (is_file("../lib/langues.php"))
|
- |
|
5 |
include("../lib/langues.php");
|
2 |
require('/etc/freeradius-web/config.php');
|
6 |
require('/etc/freeradius-web/config.php');
|
3 |
?>
|
- |
|
4 |
<html>
|
- |
|
5 |
<?php
|
- |
|
6 |
require('../lib/functions.php');
|
7 |
require('../lib/functions.php');
|
7 |
require('../lib/sql/functions.php');
|
8 |
require('../lib/sql/functions.php');
|
8 |
require('../lib/attrshow.php');
|
9 |
require('../lib/attrshow.php');
|
- |
|
10 |
if (is_file("../lib/$config[general_lib_type]/user_info.php"))
|
- |
|
11 |
include("../lib/$config[general_lib_type]/user_info.php");
|
9 |
|
12 |
|
10 |
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
|
13 |
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
|
11 |
include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
|
14 |
include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
|
12 |
else{
|
15 |
else{
|
13 |
echo <<<EOM
|
16 |
echo <<<EOM
|
- |
|
17 |
<html>
|
- |
|
18 |
<head>
|
14 |
<title>Analyse pour $login</title>
|
19 |
<title>$l_title</title>
|
15 |
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
|
20 |
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
|
16 |
<link rel="stylesheet" href="style.css">
|
21 |
<link rel="stylesheet" href="/css/style.css">
|
17 |
</head>
|
22 |
</head>
|
18 |
<body>
|
23 |
<body>
|
19 |
<center>
|
24 |
<center>
|
20 |
<b>Could not include SQL library functions. Aborting</b>
|
25 |
<b>Could not include SQL library functions. Aborting</b>
|
21 |
</body>
|
26 |
</body>
|
Line 46... |
Line 51... |
46 |
if (isset($_SESSION['da_name_cache']))
|
51 |
if (isset($_SESSION['da_name_cache']))
|
47 |
$da_name_cache = $_SESSION['da_name_cache'];
|
52 |
$da_name_cache = $_SESSION['da_name_cache'];
|
48 |
|
53 |
|
49 |
|
54 |
|
50 |
echo <<<EOM
|
55 |
echo <<<EOM
|
- |
|
56 |
<html>
|
51 |
<head>
|
57 |
<head>
|
52 |
<title>Analyse pour $login</title>
|
58 |
<title>i$l_title</title>
|
53 |
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
|
59 |
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
|
54 |
<link rel="stylesheet" href="/css/style.css">
|
60 |
<link rel="stylesheet" href="/css/style.css">
|
55 |
</head>
|
61 |
</head>
|
56 |
<body>
|
62 |
<body>
|
57 |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
|
63 |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
|
58 |
<tr><th>Statistique des connexions</th></tr>
|
64 |
<tr><th>$l_frame_top</th></tr>
|
59 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
|
65 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
|
60 |
height="2"></td></tr>
|
66 |
height="2"></td></tr>
|
61 |
</TABLE>
|
67 |
</TABLE>
|
62 |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
|
68 |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
|
63 |
<tr bgcolor="#666666"><td>
|
69 |
<tr bgcolor="#666666"><td>
|
64 |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
|
70 |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
|
65 |
<tr><td valign="middle" align="left">
|
71 |
<tr><td valign="middle" align="left">
|
66 |
<center>
|
72 |
<center>
|
67 |
<table border=0 width=550 cellpadding=0 cellspacing=0>
|
- |
|
68 |
<tr valign=top>
|
- |
|
69 |
<!--<td align=center><img src="images/title2.gif"></td>-->
|
- |
|
70 |
</tr>
|
- |
|
71 |
</table>
|
- |
|
72 |
<table border=0 width=400 cellpadding=0 cellspacing=2>
|
73 |
<table border=0 width=400 cellpadding=0 cellspacing=2>
|
73 |
EOM;
|
74 |
EOM;
|
74 |
|
75 |
|
75 |
include("../html/user_toolbar.html.php");
|
76 |
include("../html/user_toolbar.html.php");
|
76 |
|
77 |
|
Line 81... |
Line 82... |
81 |
<tr valign=top>
|
82 |
<tr valign=top>
|
82 |
<td width=65%></td>
|
83 |
<td width=65%></td>
|
83 |
<td bgcolor="black" width=35%>
|
84 |
<td bgcolor="black" width=35%>
|
84 |
<table border=0 width=100% cellpadding=2 cellspacing=0>
|
85 |
<table border=0 width=100% cellpadding=2 cellspacing=0>
|
85 |
<tr bgcolor="#907030" align=right valign=top><th>
|
86 |
<tr bgcolor="#907030" align=right valign=top><th>
|
86 |
<font color="white">Analyse pour $login</font>
|
87 |
<font color="white">$l_user : $login ($cn)</font>
|
87 |
</th></tr>
|
88 |
</th></tr>
|
88 |
</table>
|
89 |
</table>
|
89 |
</td></tr>
|
90 |
</td></tr>
|
90 |
<tr bgcolor="black" valign=top><td colspan=2>
|
91 |
<tr bgcolor="black" valign=top><td colspan=2>
|
91 |
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
|
92 |
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
|
92 |
<tr><td>
|
93 |
<tr><td>
|
93 |
Dates du <b>$prev_str</b> au <b>$now_str</b>
|
94 |
Dates : <b>$prev_str</b> to <b>$now_str</b>
|
94 |
EOM;
|
95 |
EOM;
|
95 |
?>
|
96 |
?>
|
96 |
|
- |
|
97 |
<p>
|
97 |
<p>
|
98 |
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
|
98 |
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
|
99 |
<tr bgcolor="#d0ddb0">
|
99 |
<tr bgcolor="#d0ddb0">
|
100 |
<th>#</th>
|
100 |
<td><b>#</b></td>
|
101 |
<?php
|
101 |
<?php
|
102 |
for($i=1;$i<=9;$i++){
|
102 |
for($i=1;$i<=9;$i++){
|
103 |
if ($acct_attrs['ua']["$i"] != '')
|
103 |
if (($acct_attrs['ua']["$i"] != '') && ($acct_attrs['ua']["$i"] != 'server') && ($acct_attrs['ua']["$i"] != 'callerid'))
|
104 |
echo "<th>" . $acct_attrs['ua']["$i"] . "</th>\n";
|
104 |
echo "<td><b>" . $acct_attrs['ua']["$i"] . "</b></td>\n";
|
105 |
}
|
105 |
}
|
106 |
$sql_extra_query = '';
|
106 |
$sql_extra_query = '';
|
107 |
if ($config[sql_accounting_extra_query] != '')
|
107 |
if ($config[sql_accounting_extra_query] != '')
|
108 |
$sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config);
|
108 |
$sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config);
|
109 |
?>
|
109 |
?>
|
Line 117... |
Line 117... |
117 |
WHERE username = '$login' AND acctstarttime <= '$now_str'
|
117 |
WHERE username = '$login' AND acctstarttime <= '$now_str'
|
118 |
AND acctstarttime >= '$prev_str' $sql_extra_query " . da_sql_limit($limit,1,$config) .
|
118 |
AND acctstarttime >= '$prev_str' $sql_extra_query " . da_sql_limit($limit,1,$config) .
|
119 |
" ORDER BY acctstarttime $order " . da_sql_limit($limit,2,$config). " ;");
|
119 |
" ORDER BY acctstarttime $order " . da_sql_limit($limit,2,$config). " ;");
|
120 |
if ($search){
|
120 |
if ($search){
|
121 |
while( $row = @da_sql_fetch_array($search,$config) ){
|
121 |
while( $row = @da_sql_fetch_array($search,$config) ){
|
122 |
$tr_color='white';
|
- |
|
123 |
$num++;
|
122 |
$num++;
|
124 |
$acct_type = "$row[framedprotocol]/$row[nasporttype]";
|
123 |
$acct_type = "$row[framedprotocol]/$row[nasporttype]";
|
125 |
if ($acct_type == '')
|
124 |
if ($acct_type == '')
|
126 |
$acct_type = '-';
|
125 |
$acct_type = '-';
|
127 |
$acct_logedin = $row[acctstarttime];
|
126 |
$acct_logedin = $row[acctstarttime];
|
Line 156... |
Line 155... |
156 |
$acct_terminate_cause = "$row[acctterminatecause]";
|
155 |
$acct_terminate_cause = "$row[acctterminatecause]";
|
157 |
if ($acct_terminate_cause == '')
|
156 |
if ($acct_terminate_cause == '')
|
158 |
$acct_terminate_cause = '-';
|
157 |
$acct_terminate_cause = '-';
|
159 |
if (ereg('Login-Incorrect',$acct_terminate_cause) ||
|
158 |
if (ereg('Login-Incorrect',$acct_terminate_cause) ||
|
160 |
ereg('Multiple-Logins', $acct_terminate_cause) || ereg('Invalid-User',$acct_terminate_cause))
|
159 |
ereg('Multiple-Logins', $acct_terminate_cause) || ereg('Invalid-User',$acct_terminate_cause))
|
161 |
$tr_color='#ffe8e0';
|
- |
|
162 |
$acct_callerid = "$row[callingstationid]";
|
160 |
$acct_callerid = "$row[callingstationid]";
|
163 |
if ($acct_callerid == '')
|
161 |
if ($acct_callerid == '')
|
164 |
$acct_callerid = '-';
|
162 |
$acct_callerid = '-';
|
165 |
echo <<<EOM
|
163 |
echo <<<EOM
|
166 |
<tr align=center bgcolor="$tr_color">
|
164 |
<tr align=center>
|
167 |
<td>$num</td>
|
165 |
<td>$num</td>
|
168 |
EOM;
|
166 |
EOM;
|
169 |
if ($acct_attrs[ua][1] != '') echo "<td>$acct_type</td>\n";
|
167 |
if ($acct_attrs[ua][1] != '') echo "<td>$acct_type</td>\n";
|
170 |
if ($acct_attrs[ua][2] != '') echo "<td>$acct_logedin</td>\n";
|
168 |
if ($acct_attrs[ua][2] != '') echo "<td>$acct_logedin</td>\n";
|
171 |
if ($acct_attrs[ua][3] != '') echo "<td>$acct_sessiontime</td>\n";
|
169 |
if ($acct_attrs[ua][3] != '') echo "<td>$acct_sessiontime</td>\n";
|
172 |
if ($acct_attrs[ua][4] != '') echo "<td>$acct_ip</td>\n";
|
170 |
if ($acct_attrs[ua][4] != '') echo "<td>$acct_ip</td>\n";
|
173 |
if ($acct_attrs[ua][5] != '') echo "<td>$acct_upload</td>\n";
|
171 |
if ($acct_attrs[ua][5] != '') echo "<td>$acct_upload</td>\n";
|
174 |
if ($acct_attrs[ua][6] != '') echo "<td>$acct_download</td>\n";
|
172 |
if ($acct_attrs[ua][6] != '') echo "<td>$acct_download</td>\n";
|
175 |
if ($acct_attrs[ua][7] != '') echo "<td>$acct_server</td>\n";
|
173 |
// if ($acct_attrs[ua][7] != '') echo "<td>$acct_server</td>\n";
|
176 |
if ($acct_attrs[ua][8] != '') echo "<td>$acct_terminate_cause</td>\n";
|
174 |
if ($acct_attrs[ua][8] != '') echo "<td>$acct_terminate_cause</td>\n";
|
177 |
if ($acct_attrs[ua][9] != '') echo "<td>$acct_callerid</td>\n";
|
175 |
// if ($acct_attrs[ua][9] != '') echo "<td>$acct_callerid</td>\n";
|
178 |
echo "</tr>\n";
|
176 |
echo "</tr>\n";
|
179 |
}
|
177 |
}
|
180 |
$acct_sessiontime_sum = time2str($acct_sessiontime_sum);
|
178 |
$acct_sessiontime_sum = time2str($acct_sessiontime_sum);
|
181 |
$acct_upload_sum = bytes2str($acct_upload_sum);
|
179 |
$acct_upload_sum = bytes2str($acct_upload_sum);
|
182 |
$acct_download_sum = bytes2str($acct_download_sum);
|
180 |
$acct_download_sum = bytes2str($acct_download_sum);
|
Line 190... |
Line 188... |
190 |
if ($acct_attrs[ua][1] == '')
|
188 |
if ($acct_attrs[ua][1] == '')
|
191 |
$colspan--;
|
189 |
$colspan--;
|
192 |
if ($acct_attrs[ua][2] == '')
|
190 |
if ($acct_attrs[ua][2] == '')
|
193 |
$colspan--;
|
191 |
$colspan--;
|
194 |
echo <<<EOM
|
192 |
echo <<<EOM
|
195 |
<tr bgcolor="lightyellow">
|
193 |
<tr bgcolor="lightyellow" align="center">
|
196 |
<td colspan=$colspan align="right">Total pages</td>
|
194 |
<td colspan=$colspan><b>Total</b></td>
|
197 |
EOM;
|
195 |
EOM;
|
198 |
if ($acct_attrs[ua][3] != '') echo "<td align=\"center\"><b>$acct_sessiontime_sum</td>\n";
|
196 |
if ($acct_attrs[ua][3] != '') echo "<td><b>$acct_sessiontime_sum</td>\n";
|
199 |
if ($acct_attrs[ua][4] != '') echo "<td> </td>\n";
|
197 |
if ($acct_attrs[ua][4] != '') echo "<td> </td>\n";
|
200 |
if ($acct_attrs[ua][5] != '') echo "<td align=\"right\" nowrap><b>$acct_upload_sum</td>\n";
|
198 |
if ($acct_attrs[ua][5] != '') echo "<td><b>$acct_upload_sum</td>\n";
|
201 |
if ($acct_attrs[ua][6] != '') echo "<td align=\"right\" nowrap><b>$acct_download_sum</td>\n";
|
199 |
if ($acct_attrs[ua][6] != '') echo "<td><b>$acct_download_sum</td>\n";
|
202 |
if ($acct_attrs[ua][7] != '') echo "<td> </td>\n";
|
200 |
// if ($acct_attrs[ua][7] != '') echo "<td> </td>\n";
|
203 |
if ($acct_attrs[ua][8] != '') echo "<td> </td>\n";
|
201 |
if ($acct_attrs[ua][8] != '') echo "<td> </td>\n";
|
204 |
if ($acct_attrs[ua][9] != '') echo "<td> </td>\n";
|
202 |
// if ($acct_attrs[ua][9] != '') echo "<td> </td>\n";
|
205 |
?>
|
203 |
?>
|
206 |
</tr>
|
204 |
</tr>
|
207 |
</table>
|
205 |
</table>
|
208 |
<tr><td>
|
206 |
<tr><td>
|
209 |
<hr>
|
207 |
<hr>
|
Line 211... |
Line 209... |
211 |
<form action="user_accounting.php" method="get" name="master">
|
209 |
<form action="user_accounting.php" method="get" name="master">
|
212 |
<table border=0>
|
210 |
<table border=0>
|
213 |
<tr><td colspan=6></td>
|
211 |
<tr><td colspan=6></td>
|
214 |
</tr>
|
212 |
</tr>
|
215 |
<tr valign="bottom">
|
213 |
<tr valign="bottom">
|
216 |
<td><small><b>Utilisateur</td><td><small><b>début date</td><td><small><b>fin date</td><td><small><b>nbr./page</td><td><b>classé le</td>
|
214 |
<td><small><b><?php echo "$l_user";?></td><td><small><b>from</td><td><small><b>to</td><td><small><b>nbr./page</td><td><b>order</td>
|
217 |
<tr valign="middle"><td>
|
215 |
<tr valign="middle"><td>
|
218 |
<?php
|
216 |
<?php
|
219 |
echo <<<EOM
|
217 |
echo <<<EOM
|
220 |
<input type="text" name="login" size="11" value="$login"></td>
|
218 |
<input type="text" name="login" size="11" value="$login"></td>
|
221 |
<td><input type="text" name="prev_str" size="11" value="$prev_str"></td>
|
219 |
<td><input type="text" name="prev_str" size="11" value="$prev_str"></td>
|
Line 229... |
Line 227... |
229 |
<option $selected[80] value="80">80
|
227 |
<option $selected[80] value="80">80
|
230 |
<option $selected[all] value="all">tous
|
228 |
<option $selected[all] value="all">tous
|
231 |
</select>
|
229 |
</select>
|
232 |
</td>
|
230 |
</td>
|
233 |
<td><select name="order">
|
231 |
<td><select name="order">
|
234 |
<option $selected[asc] value="asc">plus ancien en premier
|
232 |
<option $selected[asc] value="asc">older first
|
235 |
<option $selected[desc] value="desc">plus récent en premier
|
233 |
<option $selected[desc] value="desc">recent first
|
236 |
</select>
|
234 |
</select>
|
237 |
</td>
|
235 |
</td>
|
238 |
EOM;
|
236 |
EOM;
|
239 |
?>
|
237 |
?>
|
240 |
|
238 |
|