1,9 → 1,10 |
<!DOCTYPE html> |
<?php |
|
require('/etc/freeradius-web/config.php'); |
require('../lib/functions.php'); |
require('../lib/sql/functions.php'); |
require('../lib/acctshow.php'); |
|
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php")) |
include_once("../lib/sql/drivers/$config[sql_type]/functions.php"); |
else{ |
10,8 → 11,8 |
echo <<<EOM |
<html> |
<head> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
<title>$l_title</title> |
<title>Générateur de rapports de comptes</title> |
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]"> |
<link rel="stylesheet" href="/css/acc.css"> |
</head> |
<body> |
22,16 → 23,6 |
EOM; |
exit(); |
} |
$Language = 'en'; |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
$Langue = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); |
$Language = strtolower(substr(chop($Langue[0]), 0, 2)); |
} |
if ($Language === 'fr') { |
$l_title = "Journal des connexions"; |
} else { |
$l_title = "Connections log"; |
} |
|
$operators=array( '=','<', '>', '<=', '>=', 'regexp', 'like' ); |
if ($config['sql_type'] == 'pg'){ |
39,7 → 30,10 |
} |
$link = da_sql_pconnect ($config) or die('cannot connect to sql databse'); |
$fields = da_sql_list_fields($config['sql_accounting_table'],$link,$config); |
|
|
unset($items); |
|
while($row = $fields->fetch_array()) |
{ |
$key = strtolower($row[0]); |
113,14 → 107,18 |
?> |
<html> |
<head> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
<title><?= $l_title ?></title> |
<link rel="stylesheet" href="/css/acc.css"> |
<title>Journal des connexions</title> |
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config['general_charset']?>"> |
<link rel="stylesheet" href="/css/acc.css"> |
</head> |
<body> |
<div class="panel"> |
<div class="panel-header"><?= $l_title ?></div> |
<div class="panel-row"> |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0"> |
<tr><th>Journal des connexions</th></tr> |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"> |
</td></tr> |
</TABLE> |
<TABLE width="100%" border="1" cellspacing="0" cellpadding="1"> |
<tr><td> |
<?php |
if(!isset($queryflag)) |
{ |
209,7 → 207,11 |
</tr> |
</table> |
</form> |
</table> |
</body> |
</html> |
EOM; |
|
} |
|
if ($queryflag == 1){ |
267,10 → 269,13 |
echo <<<EOM |
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top> |
<tr><td> |
<table border=1 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top> |
<tr bgcolor="#d0ddb0"> |
<p> |
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top> |
<tr bgcolor="#d0ddb0"> |
</tr> |
EOM; |
|
|
foreach($accounting_show_attrs as $val){ |
$desc = $sql_attrs[$val]['desc']; |
if($val == 'acctoutputoctets') |
296,7 → 301,7 |
$info = '-'; |
if ($val == 'username'){ |
$Info = urlencode($info); |
$info = "<a href=\"user_admin.php?login=$Info\" title=\"Edit user $info\">$info</a>"; |
$info = "<a href=\"user_admin.php?login=$Info\" title=\"Edit user $info\">$info<a/>"; |
} |
echo <<<EOM |
<td>$info</td> |
307,14 → 312,15 |
} |
else |
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n"; |
echo <<<EOM |
</table> |
echo <<<EOM |
</table> |
</td></tr> |
</table>\n |
</table> |
</td></tr> |
</table> |
</table> |
</body> |
</html> |
EOM; |
} |
?> |
</div> |
</div> |
</body> |
</html> |