Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1 → Rev 40

/gestion/manager/htdocs/user_info.php
0,0 → 1,124
<?php
require('/etc/freeradius-web/config.php');
?>
 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
<title>Page d'information personnelle</title>
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th>Gestion des usagers</th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
height="2"></td></tr>
</TABLE>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
<tr bgcolor="#666666"><td>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
<tr><td valign="middle" align="left">
<center>
<table border=0 width=550 cellpadding=0 cellspacing=0>
<tr valign=top>
<!--<td align=center><img src="images/title2.gif"></td>-->
</tr>
</table>
 
<table border=0 width=400 cellpadding=0 cellspacing=2>
<?php
include("../html/user_toolbar.html.php");
?>
</table>
 
<?php
if ($change == 1){
if (is_file("../lib/$config[general_lib_type]/user_info.php"))
include("../lib/$config[general_lib_type]/user_info.php");
if (is_file("../lib/$config[general_lib_type]/change_info.php"))
include("../lib/$config[general_lib_type]/change_info.php");
}
 
if (is_file("../lib/$config[general_lib_type]/user_info.php"))
include("../lib/$config[general_lib_type]/user_info.php");
?>
 
<br>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=200>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th>
<font color="white">Page d'information personnelle de <?php echo "$login ($cn)"?></font>&nbsp;
</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<form method=post>
<input type=hidden name=login value="<?php echo $login?>">
<input type=hidden name=change value="0">
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
<?php
echo <<<EOM
<tr>
<td align=right bgcolor="#d0ddb0">
Nom complet (NOM Pr&eacute;nom)
</td><td>
<input type=text name="Fcn" value="$cn" size=35>
</td>
</tr>
<tr>
<td align=right bgcolor="#d0ddb0">
Mail
</td><td>
<input type=text name="Fmail" value="$mail" size=35>
</td>
</tr>
<tr>
<td align=right bgcolor="#d0ddb0">
Service
</td><td>
<input type=text name="Fou" value="$ou" size=35>
</td>
</tr>
<tr>
<td align=right bgcolor="#d0ddb0">
T&eacute;l&eacute;phone personnel
</td><td>
<input type=text name="Fhomephone" value="$homephone" size=35>
</td>
</tr>
<tr>
<td align=right bgcolor="#d0ddb0">
T&eacute;l&eacute;phone bureau
</td><td>
<input type=text name="Ftelephonenumber" value="$telephonenumber" size=35>
</td>
</tr>
<tr>
<td align=right bgcolor="#d0ddb0">
T&eacute;l&eacute;phone mobile
</td><td>
<input type=text name="Fmobile" value="$mobile" size=35>
</td>
</tr>
EOM;
?>
</table>
<br>
<input type=submit class=button value="Modifier" OnClick="this.form.change.value=1">
</form>
</td></tr>
</table>
</tr>
</table>
</TD></TR>
</TABLE>
</td></tr>
</TABLE>
</body>
</html>
/gestion/manager/htdocs/accounting.php
0,0 → 1,298
<?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{
echo <<<EOM
<html>
<head>
<title>G&eacute;n&eacute;rateur de rapports de comptes</title>
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<center>
<b>Could not include SQL library functions. Aborting</b>
</body>
</html>
EOM;
exit();
}
 
$operators=array( '=','<', '>', '<=', '>=', 'regexp', 'like' );
if ($config[sql_type] == 'pg'){
$operators=array( '=','<', '>', '<=', '>=', '~', 'like', '~*', '~~*', '<<=' );
}
 
$link = @da_sql_pconnect ($config) or die('cannot connect to sql databse');
$fields = @da_sql_list_fields($config[sql_accounting_table],$link,$config);
$no_fields = @da_sql_num_fields($fields,$config);
 
unset($items);
 
for($i=0;$i<$no_fields;$i++){
$key = strtolower(@da_sql_field_name($fields,$i,$config));
$val = $sql_attrs[$key][desc];
if ($val == '')
continue;
$show = $sql_attrs[$key][show];
$selected[$key] = ($show == 'yes') ? 'selected' : '';
$items[$key] = "$val";
}
asort($items);
 
class Qi {
var $name;
var $item;
var $_item;
var $operator;
var $type;
var $typestr;
var $value;
function Qi($name,$item,$operator) {
$this->name=$name;
$this->item=$item;
$this->operator=$operator;
}
 
function show() { global $operators;
global $items;
$nam = $this->item;
echo <<<EOM
<tr><td align=left>
<i>$items[$nam]</i>
<input type=hidden name="item_of_$this->name" value="$this->item">
</td><td align=left>
<select name=operator_of_$this->name>
EOM;
foreach($operators as $operator){
if($this->operator == $operator)
$selected=" selected ";
else
$selected='';
print("<option value=\"$operator\" $selected>$operator</option>\n");
}
echo <<<EOM
</select>
</td><td align=left>
<input name="value_of_$this->name" type=text value="$this->value">
</td><td align=left>
<input type=hidden name="delete_$this->name" value=0>
<input type=submit class=button size=5 value=del onclick="this.form.delete_$this->name.value=1">
</td></tr>
EOM;
}
 
function get($designator) { global ${"item_of_$designator"};
global ${"value_of_$designator"};
global ${"operator_of_$designator"};
if(${"item_of_$designator"}){
$this->value= ${"value_of_$designator"};
$this->operator=${"operator_of_$designator"};
$this->item=${"item_of_$designator"};
}
}
function query(){
global $operators;
global $items;
return $items[$this->item]." $this->operator '$this->value'";
}
}
 
?>
<html>
<head>
<title>Journal des connexions</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<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>
<?php
if(!$queryflag) {
echo <<<EOM
<form method=post>
<table border=0 width=740 cellpadding=1 cellspacing=1>
<tr>
<td>
<b>Afficher les attributs suivants :</b><br>
<select name="accounting_show_attrs[]" size=5 multiple>
EOM;
foreach($items as $key => $val)
echo <<<EOM
<option $selected[$key] value="$key">$val</option>
EOM;
 
echo <<<EOM
</select>
<br><br>
<b>Class&eacute; par :</b><br>
<select name="order_by">
EOM;
 
foreach($items as $key => $val)
if ($val == 'username')
echo <<<EOM
<option selected value="$key">$val</option>
EOM;
else
echo <<<EOM
<option value="$key">$val</option>
EOM;
 
echo <<<EOM
</select>
<br><br>
<b>Nbr. Max. de r&eacute;sultats retourn&eacute;s :</b><br>
<input name=maxresults value=$config[sql_row_limit] size=5>
</td>
<td valign=top>
<input type=hidden name=add value=0>
<table border=0 width=340 cellpadding=1 cellspacing=1>
<tr><td>
<b>Crit&egrave;re de s&eacute;lection :</b>
</td></tr>
<tr><td>
<select name=item_name onchange="this.form.add.value=1;this.form.submit()">
<option>--Attribute--</option>
EOM;
 
foreach($items as $key => $val)
print("<option value=\"$key\">$val</option>");
 
echo <<<EOM
</select>
</td></tr>
EOM;
 
$number=1;
$offset=0;
while (${"item_of_w$number"}) {
if(${"delete_w$number"}==1) {$offset=1;$number++;}
else {
$designator=$number-$offset;
${"w$designator"} = new Qi("w$designator","","");
${"w$designator"}->get("w$number");
${"w$designator"}->show();
$number++;
}
}
if($add==1) {
${"w$number"} = new Qi("w$number","$item_name","$operators[0]");
${"w$number"}->show();
}
echo <<<EOM
</table>
</td>
<tr>
<td>
<input type=hidden name=queryflag value=0>
<br><input type=submit class=button onclick="this.form.queryflag.value=1">
</td>
</tr>
</table>
</form>
</body>
</html>
EOM;
 
}
 
if ($queryflag == 1){
$i = 1;
while (${"item_of_w$i"}){
$op_found = 0;
foreach ($operators as $operator){
if (${"operator_of_w$i"} == $operator){
$op_found = 1;
break;
}
}
if (!$op_found)
die("L'op&eacute;ration demand&eacute; n'est pas valide. Sortie anormale.");
${"item_of_w$i"} = preg_replace('/\s/','',${"item_of_w$i"});
${"value_of_w$i"} = da_sql_escape_string(${"value_of_w$i"});
$where .= ($i == 1) ? ' WHERE ' . ${"item_of_w$i"} . ' ' . ${"operator_of_w$i"} . " '" . ${"value_of_w$i"} . "'" :
' AND ' . ${"item_of_w$i"} . ' ' . ${"operator_of_w$i"} . " '" . ${"value_of_w$i"} . "'" ;
$i++;
}
 
$order = ($order_by != '') ? "$order_by" : 'username';
 
if (preg_match("/[\s;]/",$order))
die("ORDER BY pattern is illegal. Exiting abnornally.");
 
if (!is_numeric($maxresults))
die("Max Results is not in numeric form. Exiting abnormally.");
 
unset($query_view);
foreach ($accounting_show_attrs as $val)
$query_view .= $val . ',';
$query_view = ereg_replace(',$','',$query_view);
unset($sql_extra_query);
if ($config[sql_accounting_extra_query] != '')
$sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config);
$sql_extra_query = da_sql_escape_string($sql_extra_query);
$query="SELECT " . da_sql_limit($maxresults,0,$config) . " $query_view FROM $config[sql_accounting_table]
$where $sql_extra_query " . da_sql_limit($maxresults,1,$config) .
" ORDER BY $order " . da_sql_limit($maxresults,2,$config) . ";";
 
echo <<<EOM
<table border="0" width="100%" cellpadding="1" cellspacing="1">
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<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];
echo "<th>$desc</th>\n";
}
echo "</tr>\n";
 
$search = @da_sql_query($link,$config,$query);
if ($search){
while( $row = @da_sql_fetch_array($search,$config) ){
$num++;
echo "<tr align=center>\n";
foreach($accounting_show_attrs as $val){
$info = $row[$val];
if ($info == '')
$info = '-';
$info = $sql_attrs[$val][func]($info);
if ($val == 'username'){
$Info = urlencode($info);
$info = "<a href=\"user_admin.php?login=$Info\" title=\"Edit user $info\">$info<a/>";
}
echo <<<EOM
<td>$info</td>
EOM;
}
echo "</tr>\n";
}
}
else
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
echo <<<EOM
</table>
</td></tr>
</table>
</td></tr>
</table>
</body>
</html>
EOM;
}
?>
/gestion/manager/htdocs/user_stats.php
0,0 → 1,234
<?php
require('/etc/freeradius-web/config.php');
require('../lib/functions.php');
require('../lib/sql/nas_list.php');
require_once('../lib/xlat.php');
?>
<html>
<?php
 
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
else{
echo <<<EOM
<title>Statistiques utilisateurs</title>
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
<link rel="stylesheet" href="style.css">
</head>
<body>
<center>
<b>Could not include SQL library functions. Aborting</b>
</body>
</html>
EOM;
exit();
}
 
if ($start == '' && $stop == ''){
$now = time();
$stop = date($config[sql_date_format],$now);
$now -= 604800;
$start = date($config[sql_date_format],$now);
}
$start = da_sql_escape_string($start);
$stop = da_sql_escape_string($stop);
$pagesize = ($pagesize) ? $pagesize : 10;
if (!is_numeric($pagesize) && $pagesize != 'all')
$pagezise = 10;
if ($pagesize > 100)
$pagesize = 100;
$limit = ($pagesize == 'all') ? '100' : "$pagesize";
$selected[$pagesize] = 'selected';
$order = ($order) ? $order : $config[general_accounting_info_order];
if ($order != 'desc' && $order != 'asc')
$order = 'desc';
if ($sortby != '')
$order_attr = ($sortby == 'num') ? 'connnum' : 'conntotduration';
else
$order_attr = 'connnum';
if ($server != '' && $server != 'all'){
$server = da_sql_escape_string($server);
$server_str = "AND nasipaddress = '$server'";
}
$login_str = ($login) ? "AND username = '$login' " : '';
 
$selected[$order] = 'selected';
$selected[$sortby] = 'selected';
 
$sql_extra_query = '';
if ($config[sql_accounting_extra_query] != ''){
$sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config);
$sql_extra_query = da_sql_escape_string($sql_extra_query);
}
 
unset($da_name_cache);
if (isset($_SESSION['da_name_cache']))
$da_name_cache = $_SESSION['da_name_cache'];
 
?>
 
<head>
<title>Statistiques utilisateurs</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<center>
<table border=0 width=550 cellpadding=0 cellspacing=0>
<tr valign=top>
<!--<td align=center><img src="images/title2.gif"></td>-->
</tr>
</table>
<table border=0 width=400 cellpadding=0 cellspacing=2>
</table>
<br>
<table border=0 width=840 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=65%></td>
<td bgcolor="black" width=35%>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th>
<font color="white">Statistiques utilisateurs</font>&nbsp;
</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<?php
echo <<<EOM
De <b>$start</b> &agrave; <b>$stop</b>
EOM;
?>
 
<p>
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
<tr bgcolor="#d0ddb0">
<th>#</th><th>Identifiant</th><th>Date</th><th>Serveur</th><th>Nombres de connections</th><th>Dur&eacute;e des connections</th><th>Upload</th><th>Download</th>
</tr>
 
<?php
$link = @da_sql_pconnect($config);
if ($link){
$search = @da_sql_query($link,$config,
"SELECT " . da_sql_limit($limit,0,$config) . " * FROM $config[sql_total_accounting_table]
WHERE acctdate >= '$start' AND acctdate <= '$stop' $server_str $login_str $sql_extra_query " . da_sql_limit($limit,1,$config)
. " ORDER BY $order_attr $order " . da_sql_limit($limit,2,$config) . " ;");
 
if ($search){
while( $row = @da_sql_fetch_array($search,$config) ){
$num++;
$acct_login = $row[username];
if ($acct_login == '')
$acct_login = '-';
else{
$Acct_login = urlencode($acct_login);
$acct_login = "<a href=\"user_admin.php?login=$Acct_login\" title=\"Editer l'utilisateur $acct_login\">$acct_login</a>";
}
$acct_time = $row[conntotduration];
$acct_time = time2str($acct_time);
$acct_conn_num = $row[connnum];
$acct_date = $row[acctdate];
$acct_upload = $row[inputoctets];
$acct_download = $row[outputoctets];
$acct_upload = bytes2str($acct_upload);
$acct_download = bytes2str($acct_download);
$acct_server = $da_name_cache[$row[nasipaddress]];
if (!isset($acct_server)){
$acct_server = @gethostbyaddr($row[nasipaddress]);
if (!isset($da_name_cache) && $config[general_use_session] == 'yes'){
$da_name_cache[$row[nasipaddress]] = $acct_server;
session_register('da_name_cache');
}
else
$da_name_cache[$row[nasipaddress]] = $acct_server;
}
if ($acct_server == '')
$acct_server = '-';
echo <<<EOM
<tr align=center bgcolor="white">
<td>$num</td>
<td>$acct_login</td>
<td>$acct_date</td>
<td>$acct_server</td>
<td>$acct_conn_num</td>
<td>$acct_time</td>
<td>$acct_upload</td>
<td>$acct_download</td>
</tr>
EOM;
}
}
}
echo <<<EOM
</table>
<tr><td>
<hr>
<tr><td align="left">
<form action="user_stats.php" method="post" name="master">
<table border=0>
<tr valign="bottom">
<td><small><b>date d&eacute;but</td><td><small><b>date fin</td><td><small><b>nbr./page</td><td><small><b>tri&eacute; par</td><td><small><b>class&eacute; par ordre </td>
<tr valign="middle"><td>
<input type="hidden" name="show" value="0">
<input type="text" name="start" size="11" value="$start"></td>
<td><input type="text" name="stop" size="11" value="$stop"></td>
<td><select name="pagesize">
<option $selected[5] value="5" >05
<option $selected[10] value="10">10
<option $selected[15] value="15">15
<option $selected[20] value="20">20
<option $selected[40] value="40">40
<option $selected[80] value="80">80
<option $selected[all] value="all">tous
</select>
</td>
<td>
<select name="sortby">
<option $selected[num] value="num">Nombre de connexions
<option $selected[time] value="time">Dur&eacute;e des connexions
</select>
</td>
<td><select name="order">
<option $selected[asc] value="asc">croissant
<option $selected[desc] value="desc">d&eacute;croissant
</select>
</td>
EOM;
?>
 
<td><input type="submit" class=button value="show"></td></tr>
<tr><td>
<b>Sur le serveur d'acc&egrave;s :</b>
</td>
<td><b>Utilisateur</b></td></tr>
<tr><td>
<select name="server">
<?php
foreach ($nas_list as $nas){
$name = $nas[name];
if ($nas[ip] == '')
continue;
$servers[$name] = $nas[ip];
}
ksort($servers);
foreach ($servers as $name => $ip){
if ($server == $ip)
echo "<option selected value=\"$ip\">$name\n";
else
echo "<option value=\"$ip\">$name\n";
}
if ($server == '' || $server == 'all')
echo "<option selected value=\"all\">tous\n";
else
echo "<option value=\"all\">tous\n";
?>
</select>
</td>
<td><input type="text" name="login" size="11" value="<?php echo $login ?>"></td>
</tr>
</table></td></tr></form>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/.directory
0,0 → 1,3
[Dolphin]
Timestamp=2009,8,23,23,33,47
ViewMode=1
/gestion/manager/htdocs/clear_opensessions.php
0,0 → 1,193
<?php
require('/etc/freeradius-web/config.php');
require_once('../lib/xlat.php');
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
else{
echo <<<EOM
<title>Fermeture des sessions ouvertes pour l'utilisateur $login</title>
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
<link rel="stylesheet" href="style.css">
</head>
<body>
<center>
<b>Could not include SQL library functions. Aborting</b>
</body>
</html>
EOM;
exit();
}
 
echo <<<EOM
<html>
<head>
<title>Fermeture des sessions ouvertes pour l'usager : $login</title>
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th>Gestion des usagers</th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
height="2"></td></tr>
</TABLE>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
<tr bgcolor="#666666"><td>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
<tr><td valign="middle" align="left">
<center>
<table border=0 width=550 cellpadding=0 cellspacing=0>
<tr valign=top>
<!--<td align=center><img src="images/title2.gif"></td>-->
</tr>
</table>
 
<table border=0 width=400 cellpadding=0 cellspacing=2>
EOM;
 
include("../html/user_toolbar.html.php");
 
$open_sessions = 0;
 
$sql_extra_query = '';
if ($config[sql_accounting_extra_query] != ''){
$sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config);
$sql_extra_query = da_sql_escape_string($sql_extra_query);
}
 
print <<<EOM
</table>
 
<br>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=200>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th>
<font color="white">Fermeture des sessions ouvertes pour l'usager : $login</font>&nbsp;
</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
EOM;
if ($drop_conns == 1){
$method = 'snmp';
$nastype = 'cisco';
if ($config[general_sessionclear_method] != '')
$method = $config[general_sessionclear_method];
if ($config[general_nas_type] != '')
$nastype = $config[general_nas_type];
if ($config[general_ld_library_path] != '')
putenv("LD_LIBRARY_PATH=$config[general_ld_library_path]");
$nas_by_ip = array();
$meth_by_ip = array();
$nastype_by_ip = array();
foreach ($nas_list as $nas){
if ($nas[ip] != ''){
$ip = $nas[ip];
$nas_by_ip[$ip] = $nas[community];
$meth_by_ip[$ip] = $nas[sessionclear_method];
$nastype_by_ip[$ip] = $nas[nas_type];
}
}
 
$link = @da_sql_pconnect($config);
if ($link){
$search = @da_sql_query($link,$config,
"SELECT nasipaddress,acctsessionid FROM $config[sql_accounting_table]
WHERE username = '$login' AND acctstoptime IS NULL;");
if ($search){
while($row = @da_sql_fetch_array($search,$config)){
$sessionid = $row[acctsessionid];
$sessionid = hexdec($sessionid);
$nas = $row[nasipaddress];
$port = $row[nasportid];
$meth = $meth_by_ip[$nas];
$nastype = ($nastype_by_ip[$nas] != '') ? $nastype_by_ip[$nas] : $nastype;
$comm = $nas_by_ip[$nas];
if ($meth == '')
$meth = $method;
if ($meth == 'snmp' && $comm != '')
exec("$config[general_sessionclear_bin] $nas snmp $nastype $login $sessionid $comm");
if ($meth == 'telnet')
exec("$config[general_sessionclear_bin] $nas telnet $nastype $login $sessionid $port");
}
}
else
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
}
else
echo "<b>Could not connect to SQL database</b><br>\n";
}
if ($clear_sessions == 1)
{
exec ("sudo /usr/local/sbin/alcasar-logout.sh $login");
$sql_servers = array();
if ($config[sql_extra_servers] != '')
$sql_servers = explode(' ',$config[sql_extra_servers]);
$quer = '= 0';
if ($config[sql_type] == 'pg')
$quer = 'IS NULL';
$sql_servers[] = $config[sql_server];
foreach ($sql_servers as $server)
{
$link = @da_sql_host_connect($server,$config);
if ($link)
{
$res = @da_sql_query($link,$config,
"DELETE FROM $config[sql_accounting_table]
WHERE username='$login' AND acctstoptime $quer $sql_extra_query;");
if ($res)
echo "<b>La comptabilit&eacute; des sessions pour cet usager a &eacute;t&eacute; arr&eacute;t&eacute;e</b><br>\n";
else
echo "<b>Error deleting open sessions for user" . da_sql_error($link,$config) . "</b><br>\n";
}
else
echo "<b>Could not connect to SQL database</b><br>\n";
}
}
$link = @da_sql_pconnect($config);
if ($link){
$search = @da_sql_query($link,$config,
"SELECT COUNT(*) AS counter FROM $config[sql_accounting_table]
WHERE username = '$login' AND acctstoptime IS NULL $sql_extra_query;");
if ($search){
if ($row = @da_sql_fetch_array($search,$config))
$open_sessions = $row[counter];
}
else
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
}
else
echo "<b>Could not connect to SQL database</b><br>\n";
?>
<form method=post>
<input type=hidden name=login value=<?php print $login ?>>
<input type=hidden name=clear_sessions value="0">
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
<tr>
<td align=center>
<?
if ($open_sessions == 0)
{
echo "L'usager $login n'a pas de session ouverte";
}
else {
echo "L'usager $login a <i>$open_sessions</i> session(s) ouverte(s)<br><br>";
echo "&Ecirc;tes-vous certain de vouloir ";
if ($open_sessions == 1) { echo "la"; } else {echo "les"; }
echo " fermer ? ";
echo "<input type=submit class=button value=\"Oui, Fermer\" OnClick=\"this.form.clear_sessions.value=1\">";
}
?>
</form>
</td></tr></table>
<!--<input type=submit class=button value="Oui, poubelliser les connexions" OnClick="this.form.drop_conns.value=1">-->
</td></tr></table>
</TD></TR></TABLE>
</body>
</html>
/gestion/manager/htdocs/stats.php
0,0 → 1,186
<?php
require('/etc/freeradius-web/config.php');
require('../lib/sql/nas_list.php');
require_once('../lib/xlat.php');
?>
<html>
<head>
<title>Analyse des comptes</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
<link rel="stylesheet" href="style.css">
</head>
<body>
<center>
 
<?php
require_once('../lib/functions.php');
 
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
else{
echo <<<EOM
<b>Could not include SQL library functions. Aborting</b>
</body>
</html>
EOM;
exit();
}
 
$stats_num = array();
 
$date = strftime('%A, %e %B %Y, %T %Z');
$now = time();
if ($before == '')
$before = date($config[sql_date_format], $now + 86400);
$after = ($after != '') ? "$after" : date($config[sql_date_format], $now - 604800 );
 
$after_time = date2time($after);
$before_time = date2time($before);
$days[0] = $after;
$counter = $after_time + 86400;
$i = 1;
while($counter < $before_time){
$days[$i++] = date($config[sql_date_format],$counter);
$counter += 86400;
}
$days[$i] = $before;
$num_days = $i;
 
$column1 = ($column1 != '') ? "$column1" : 'sessions';
$column2 = ($column2 != '') ? "$column2" : 'usage';
$column3 = ($column3 != '') ? "$column3" : 'download';
$column[1] = "$column1";
$column[2] = "$column2";
$column[3] = "$column3";
$selected1["$column1"] = 'selected';
$selected2["$column2"] = 'selected';
$selected3["$column3"] = 'selected';
 
$message['sessions'] = 'sessions';
$message['usage'] = 'total usage time';
$message['usage'] = 'temps d\'utilisation total ';
$message['upload'] = 'uploads';
$message['download'] = 'downloads';
if ($config[general_stats_use_totacct] == 'yes'){
$sql_val['sessions'] = 'connnum';
$sql_val['usage'] = 'conntotduration';
$sql_val['upload'] = 'inputoctets';
$sql_val['download'] = 'outputoctets';
}
else{
$sql_val['usage'] = 'acctsessiontime';
$sql_val['upload'] = 'acctinputoctets';
$sql_val['download'] = 'acctoutputoctets';
}
$fun['sessions'] = nothing;
$fun['usage'] = time2strclock;
$fun['upload'] = bytes2str;
$fun['download'] = bytes2str;
$sql_val['user'] = ($login == '') ? "WHERE username LIKE '%'" : "WHERE username = '$login'";
for ($j = 1; $j <= 3; $j++){
$tmp = "{$sql_val[$column[$j]]}";
$res[$j] = ($tmp == "") ? "COUNT(radacctid) AS res_$j" : "sum($tmp) AS res_$j";
}
$i = 1;
$servers[all] = 'all';
foreach ($nas_list as $nas){
$name = $nas[name];
if ($nas[ip] == '')
continue;
$servers[$name] = $nas[ip];
$i++;
}
ksort($servers);
if ($server != 'all' && $server != ''){
$server = da_sql_escape_string($server);
$s = "AND nasipaddress = '$server'";
}
$sql_extra_query = '';
if ($config[sql_accounting_extra_query] != '')
$sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config);
 
$link = @da_sql_pconnect($config);
if ($link){
for ($i = $num_days;$i > -1; $i--){
$day = "$days[$i]";
if ($config[general_stats_use_totacct] == 'yes')
$search = @da_sql_query($link,$config,
"SELECT $res[1],$res[2],$res[3] FROM $config[sql_total_accounting_table]
$sql_val[user] AND acctdate = '$day' $s $sql_extra_query;");
else
$search = @da_sql_query($link,$config,
"SELECT $res[1],$res[2],$res[3] FROM $config[sql_accounting_table]
$sql_val[user] AND acctstoptime >= '$day 00:00:00'
AND acctstoptime <= '$day 23:59:59' $s $sql_extra_query;");
if ($search){
$row = @da_sql_fetch_array($search,$config);
$data[$day][1] = $row[res_1];
$data[sum][1] += $row[res_1];
$stats_num[1] = ($data[$day][1]) ? $stats_num[1] + 1 : $stats_num[1];
$data[$day][2] = $row[res_2];
$data[sum][2] += $row[res_2];
$stats_num[2] = ($data[$day][2]) ? $stats_num[2] + 1 : $stats_num[2];
$data[$day][3] = $row[res_3];
$data[sum][3] += $row[res_3];
$stats_num[3] = ($data[$day][3]) ? $stats_num[3] + 1 : $stats_num[3];
}
else
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
}
}
else
echo "<b>Could not connect to SQL database</b><br>\n";
 
$stats_num[1] = ($stats_num[1]) ? $stats_num[1] : 1;
$stats_num[2] = ($stats_num[2]) ? $stats_num[2] : 1;
$stats_num[3] = ($stats_num[3]) ? $stats_num[3] : 1;
 
$data['avg'][1] = ceil($data['sum'][1] / $stats_num[1]);
$data['avg'][2] = ceil($data['sum'][2] / $stats_num[2]);
$data['avg'][3] = ceil($data['sum'][3] / $stats_num[3]);
 
$data['avg'][1] = $fun[$column[1]]($data['avg'][1]);
$data['avg'][2] = $fun[$column[2]]($data['avg'][2]);
$data['avg'][3] = $fun[$column[3]]($data['avg'][3]);
 
$data['sum'][1] = $fun[$column[1]]($data['sum'][1]);
$data['sum'][2] = $fun[$column[2]]($data['sum'][2]);
$data['sum'][3] = $fun[$column[3]]($data['sum'][3]);
 
for ($i = 0; $i <= $num_days; $i++){
$day = "$days[$i]";
$max[1] = ($max[1] > $data[$day][1] ) ? $max[1] : $data[$day][1];
$max[2] = ($max[2] > $data[$day][2] ) ? $max[2] : $data[$day][2];
$max[3] = ($max[3] > $data[$day][3] ) ? $max[3] : $data[$day][3];
 
}
for ($i = 0; $i <= $num_days; $i++){
$day = "$days[$i]";
for ($j = 1; $j <= 3; $j++){
$tmp = $data[$day][$j];
if (!$max[$j])
$p = $w = $c = 0;
else{
$p = floor(100 * ($tmp / $max[$j]));
$w = floor(70 * ($tmp / $max[$j]));
$c = hexdec('f0e9e2') - (258 * $p);
$c = dechex($c);
}
if (!$w)
$w++;
$perc[$day][$j] = $p . "%";
$width[$day][$j] = $w;
$color[$day][$j] = $c;
}
 
$data[$day][1] = $fun[$column[1]]($data[$day][1]);
$data[$day][2] = $fun[$column[2]]($data[$day][2]);
$data[$day][3] = $fun[$column[3]]($data[$day][3]);
}
 
$data[max][1] = $fun[$column[1]]($max[1]);
$data[max][2] = $fun[$column[2]]($max[2]);
$data[max][3] = $fun[$column[3]]($max[3]);
 
require('../html/stats.html.php');
?>
/gestion/manager/htdocs/failed_logins.php
0,0 → 1,236
<?php
require('/etc/freeradius-web/config.php');
require('../lib/attrshow.php');
require('../lib/sql/nas_list.php');
require_once('../lib/xlat.php');
?>
<html>
<?php
 
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
else{
echo <<<EOM
<title>Failed logins</title>
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
<link rel="stylesheet" href="style.css">
</head>
<body>
<center>
<b>Could not include SQL library functions. Aborting</b>
</body>
</html>
EOM;
exit();
}
 
$now = time();
if (!isset($last))
$last = ($config[general_most_recent_fl]) ? $config[general_most_recent_fl] : 5;
if (!is_numeric($last))
$last = 5;
$start = $now - ($last*60);
$now_str = date($config[sql_full_date_format],$now);
$prev_str = date($config[sql_full_date_format],$start);
 
$now_str = da_sql_escape_string($now_str);
$prev_str = da_sql_escape_string($prev_str);
 
$pagesize = ($pagesize) ? $pagesize : 10;
if (!is_numeric($pagesize) && $pagesize != 'all')
$pagesize = 10;
$limit = ($pagesize == 'all') ? '' : "$pagesize";
$selected[$pagesize] = 'selected';
$order = ($order != '') ? $order : $config[general_accounting_info_order];
if ($order != 'desc' && $order != 'asc')
$order = 'desc';
$selected[$order] = 'selected';
if ($callerid != ''){
$callerid = da_sql_escape_string($callerid);
$callerid_str = "AND callingstationid = '$callerid'";
}
if ($server != '' && $server != 'all'){
$server = da_sql_escape_string($server);
$server_str = "AND nasipaddress = '$server'";
}
 
unset($da_name_cache);
if (isset($_SESSION['da_name_cache']))
$da_name_cache = $_SESSION['da_name_cache'];
 
?>
 
<head>
<title>Authentifications manqu&eacute;es</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
<link rel="stylesheet" href="style.css">
</head>
<body>
<center>
<table border=0 width=550 cellpadding=0 cellspacing=0>
<tr valign=top>
<!--<td align=center><img src="images/title2.gif"></td>-->
</tr>
</table>
<table border=0 width=400 cellpadding=0 cellspacing=2>
</table>
<br>
<table border=0 width=840 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=65%></td>
<td bgcolor="black" width=35%>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th>
<font color="white">Authentificatins manqu&eacute;es</font>&nbsp;
</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<?php
echo <<<EOM
<b>$prev_str</b> up to <b>$now_str</b>
EOM;
?>
 
<p>
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
<tr bgcolor="#d0ddb0">
<th>#</th><th>login</th>
<?php
if ($acct_attrs['fl'][2] != '') echo "<th>" . $acct_attrs['fl'][2] . "</th>\n";
if ($acct_attrs['fl'][7] != '') echo "<th>" . $acct_attrs['fl'][7] . "</th>\n";
if ($acct_attrs['fl'][8] != '') echo "<th>" . $acct_attrs['fl'][8] . "</th>\n";
if ($acct_attrs['fl'][9] != '') echo "<th>" . $acct_attrs['fl'][9] . "</th>\n";
unset($sql_extra_query);
if ($config[sql_accounting_extra_query] != ''){
$sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config);
$sql_extra_query = da_sql_escape_string($sql_extra_query);
}
?>
</tr>
 
<?php
$link = @da_sql_pconnect($config);
if ($link){
$search = @da_sql_query($link,$config,
"SELECT " . da_sql_limit($limit,0,$config) . " acctstoptime,username,nasipaddress,nasportid,acctterminatecause,callingstationid
FROM $config[sql_accounting_table]
WHERE acctstoptime <= '$now_str' AND acctstoptime >= '$prev_str'
AND (acctterminatecause LIKE 'Login-Incorrect%' OR
acctterminatecause LIKE 'Invalid-User%' OR
acctterminatecause LIKE 'Multiple-Logins%') $callerid_str $server_str $sql_extra_query " . da_sql_limit($limit,1,$config) .
" ORDER BY acctstoptime $order " . da_sql_limit($limit,2,$config) . " ;");
if ($search){
while( $row = @da_sql_fetch_array($search,$config) ){
$num++;
$acct_login = $row[username];
if ($acct_login == '')
$acct_login = '-';
else
$acct_login = "<a href=\"user_admin.php?login=$acct_login\" title=\"Editer l'utilisateur $acct_login\">$acct_login</a>";
$acct_time = $row[acctstoptime];
$acct_server = $row[nasipaddress];
if ($acct_server != ''){
$acct_server = $da_name_cache[$acct_server];
if (!isset($acct_server)){
$acct_server = $row[nasipaddress];
$acct_server = @gethostbyaddr($acct_server);
if (!isset($da_name_cache) && $config[general_use_session] == 'yes'){
$da_name_cache[$row[nasipaddress]] = $acct_server;
session_register('da_name_cache');
}
else
$da_name_cache[$row[nasipaddress]] = $acct_server;
}
}
else
$acct_server = '-';
$acct_server = "$acct_server:$row[nasportid]";
$acct_terminate_cause = "$row[acctterminatecause]";
if ($acct_terminate_cause == '')
$acct_terminate_cause = '-';
$acct_callerid = "$row[callingstationid]";
if ($acct_callerid == '')
$acct_callerid = '-';
echo <<<EOM
<tr align=center bgcolor="white">
<td>$num</td>
<td>$acct_login</td>
EOM;
if ($acct_attrs['fl'][2] != '') echo "<td>$acct_time</td>\n";
if ($acct_attrs['fl'][2] != '') echo "<td>$acct_server</td>\n";
if ($acct_attrs['fl'][2] != '') echo "<td>$acct_terminate_cause</td>\n";
if ($acct_attrs['fl'][2] != '') echo "<td>$acct_callerid</td>\n";
echo "</tr>\n";
}
}
else
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
}
else
echo "<b>Could not connect to SQL database</b><br>\n";
echo <<<EOM
</table>
<tr><td>
<hr>
<tr><td align="left">
<form action="failed_logins.php" method="get" name="master">
<table border=0>
<tr valign="bottom">
<td><small><b>time back (mins)</td><td><small><b>pagesize</td><td><small><b>caller id</td><td><b>order</td>
<tr valign="middle"><td>
<input type="text" name="last" size="11" value="$last"></td>
<td><select name="pagesize">
<option $selected[5] value="5" >05
<option $selected[10] value="10">10
<option $selected[15] value="15">15
<option $selected[20] value="20">20
<option $selected[40] value="40">40
<option $selected[80] value="80">80
<option $selected[all] value="all">all
</select>
</td>
<td>
<input type="text" name="callerid" size="11" value="$callerid"></td>
<td><select name="order">
<option $selected[asc] value="asc">older first
<option $selected[desc] value="desc">recent first
</select>
</td>
EOM;
?>
 
<td><input type="submit" class=button value="show"></td></tr>
<tr><td>
<b>Sur le serveur d'acc&eagrave; :</b>
</td></tr><tr><td>
<select name="server">
<?php
foreach ($nas_list as $nas){
$name = $nas[name];
if ($nas[ip] == '')
continue;
$servers[$name] = $nas[ip];
}
ksort($servers);
foreach ($servers as $name => $ip){
if ($server == $ip)
echo "<option selected value=\"$ip\">$name\n";
else
echo "<option value=\"$ip\">$name\n";
}
if ($server == '' || $server == 'all')
echo "<option selected value=\"all\">all\n";
else
echo "<option value=\"all\">all\n";
?>
</select>
</td></tr>
</table></td></tr></form>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/user_delete.php
0,0 → 1,131
<?php
require('/etc/freeradius-web/config.php');
if ($type != 'group')
if (is_file("../lib/$config[general_lib_type]/user_info.php"))
include("../lib/$config[general_lib_type]/user_info.php");
else
if (is_file("../lib/$config[general_lib_type]/group_info.php"))
include("../lib/$config[general_lib_type]/group_info.php");
 
$whatis = ($user_type == 'group') ? 'le groupe' : 'l\'usager';
$whatisL = ($user_type == 'group') ? 'de groupe' : 'd\'usager';
 
echo <<<EOM
<html>
<head>
EOM;
 
if ($user_type != 'group'){
echo "<title>delete user $login ($cn)</title>\n";
$util = "usagers";}
else{
echo "<title>delete group $login</title>\n";
$util = "groupes";}
 
echo <<<EOM
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th>Gestion des $util</th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
height="2"></td></tr>
</TABLE>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
<tr bgcolor="#666666"><td>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
<tr><td valign="middle" align="left">
<center>
<table border=0 width=550 cellpadding=0 cellspacing=0>
<tr valign=top>
<!--<td align=center><img src="images/title2.gif"></td>-->
</tr>
</table>
 
<table border=0 width=400 cellpadding=0 cellspacing=2>
EOM;
 
if ($user_type != 'group')
include("../html/user_toolbar.html.php");
else
include("../html/group_toolbar.html.php");
 
print <<<EOM
</table>
 
<br>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=200>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th>
<font color="white">Suppression $whatisL</font>&nbsp;
</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
EOM;
if ($delete_user == 1){
if ($user_type != 'group'){
if (is_file("../lib/$config[general_lib_type]/delete_user.php"))
include("../lib/$config[general_lib_type]/delete_user.php");
}
else{
if ($delete_users_of_group == 1){
unset($group_members);
$tmp_group_name=$login;
if (is_file("../lib/$config[general_lib_type]/group_info.php")){
include("../lib/$config[general_lib_type]/group_info.php");
}
foreach ($group_members as $member){
$login=$member;
if (is_file("../lib/$config[general_lib_type]/delete_user.php"))
include("../lib/$config[general_lib_type]/delete_user.php");
}
$login=$tmp_group_name;
}
if (is_file("../lib/$config[general_lib_type]/delete_group.php"))
include("../lib/$config[general_lib_type]/delete_group.php");
}
echo <<<EOM
</td></tr>
</table>
</tr>
</table>
</body>
</html>
EOM;
exit();
}
?>
<form method=post>
<input type=hidden name=login value=<?php print $login ?>>
<input type=hidden name=delete_user value="0">
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
<tr>
<td align=center>
<?php
if ($user_type == 'group'){
echo "Suppression automatique des membres du groupe : ";
echo "<input type=checkbox name=delete_users_of_group value=\"1\">";
}
echo "<br>";
echo "Etes-vous certain de vouloir supprimer $whatis $login ? ";
?>
<input type=submit class=button value="Oui supprimer" OnClick="this.form.delete_user.value=1">
</form>
</td></tr></table></td></tr>
</table>
</tr>
</table>
</TD></TR>
</TABLE>
</td></tr>
</TABLE>
</body>
</html>
/gestion/manager/htdocs/style.css
0,0 → 1,38
td {font-family:verdana,sans-serif;text-decoration:none;font-size:11px}
th {font-family:verdana,sans-serif;text-decoration:none;font-size:11px}
A {FONT-FAMILY: verdana,sans-serif; FONT-SIZE: 11px; TEXT-DECORATION: none}
H1 {FONT-FAMILY: lucida,sans-serif; FONT-SIZE: 24px; TEXT-DECORATION: none}
INPUT{
BACKGROUND-COLOR: #EEEEEE;
BORDER-BOTTOM: #3333CC 1px solid;
BORDER-LEFT: #3333CC 1px solid;
BORDER-RIGHT: #3333CC 1px solid;
BORDER-TOP: #3333CC 1px solid;
COLOR: #000000;
FONT-FAMILY: Verdana
}
INPUT.button{
BACKGROUND-COLOR: #999999;
BORDER-BOTTOM: #3333CC 1px solid;
BORDER-LEFT: #3333CC 1px solid;
BORDER-RIGHT: #3333CC 1px solid;
BORDER-TOP: #3333CC 1px solid;
COLOR: #000000;
FONT-FAMILY: Verdana
}
body
{
BACKGROUND-COLOR: #EFEFEF;
}
a:link {
color: #000000;
}
a:visited {
color:#000000;
}
a:hover {
color:#000000;
}
a:active {
color:#000000;
}
/gestion/manager/htdocs/help/simultaneous_use_help.html
0,0 → 1,37
<html>
<head>
<title>Simultaneous Use Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Page d'aide : session simultan&eacute;e</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
Cet attribut d&eacute;finit le nombre maximum de sessions simultan&eacute;es
qu'un usager peut ouvrir (non renseign&eacute; = infini)
This attribute defines the maximum number of concurrent logins
for a user. It is independent from the number of ports the user
is allowed to open in a multilink session.
</pre>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/callback_number_help.html
0,0 → 1,47
<html>
<head>
<title>Callback-Number Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Callback-Number Help Page</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
Attribute Number: 19
Value: String
</pre>
<br>
<pre>
The value of this attribute is the number to which the RADIUS client
gear should return a call to the authenticating user. Depending on
what packet this attribute is found in, different actions may be
configured. For instance, if <i>Callback-Number</i> is found in an
<i>Access Request</i> packet, the implementation may assume that the
end user is requesting callback service. If the attribute is found
in the <i>Access Accept</i> packet, it can mean everything that the
administrator configuring the gear wants it to mean. In fact, in
some cases, <i>Callback-ID</i> and <i>Callback-Number</i> will <i>not</i> be found
together in one packet.
</pre>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/class_help.html
0,0 → 1,45
<html>
<head>
<title>Class Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Class Help Page</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
Attribute Number: 25
Value: String
</pre>
<br>
<pre>
The Class attribute mainly exists to funnel identification and
property information to the accounting systems of RADIUS
implementations.<br>
From RFC2865:<br>"This Attribute is available to be sent by the server to the client
in an Access-Accept and SHOULD be sent unmodified by the client to
the accounting server as part of the Accounting-Request packet if
accounting is supported. The client MUST NOT interpret the
attribute locally."
</pre>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/callback_id_help.html
0,0 → 1,46
<html>
<head>
<title>Callback-ID Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Callback-ID Help Page</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
Attribute Number: 20
Value: String
</pre>
<br>
<pre>
This attribute is used when a RADIUS implementation is set up to
return a user's call. This is commonly used in corporate situations
to avoid long-distance charges in hotel rooms and other remote
locations. This value, A STRING, is often the identifier for a
profile configured on the service equipment; there is no specific
standrad for a string name, a triggered action, or something else.
In other words, it is environment specific. RADIUS client gear is
allowed to reject a connection if this attribute is present but
not supported by the gear.
</pre>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/badusers_help.html
0,0 → 1,36
<html>
<head>
<title>BADUSERS Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Expiration Help Page</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
The badusers table can be used to keep a history of unauthorized actions by
certain users.
To add a user to the badusers table you first have to insert a descriptive text
in the 'Lock Message' attribute
</pre>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/login_time_help2.html
0,0 → 1,49
<html>
<head>
<title>Login-Time Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Login-Time Help Page</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
Login-Time defines the time span a user may login to the system. The
format of a so-called time string is like the format used by UUCP.
A time string may be a list of simple time strings separated by "|" or ",".
 
Each simple time string must begin with a day definition. That can be just
one day, multiple days, or a range of days separated by a hyphen. A
day is Mo, Tu, We, Th, Fr, Sa or Su, or Wk for Mo-Fr. "Any" or "Al"
means all days.
 
After that a range of hours follows in hhmm-hhmm format.
 
For example, "Wk2305-0855,Sa,Su2305-1655".
 
Radiusd calculates the number of seconds left in the time span, and
sets the Session-Timeout to that number of seconds. So if someones
Login-Time is "Al0800-1800" and he logs in at 17:30, Session-Timeout
is set to 1800 seconds so that he is kicked off at 18:00.
</pre>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/framed_ip_netmask_help.html
0,0 → 1,38
<html>
<head>
<title>Framed-IP-Netmask Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Framed-IP-Netmask Help Page</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
Attribute Number: 9
Value: IPADDR
</pre>
<pre>
This attribute can be used to assign a specific netmask to
a connection.
</pre>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/framed_compression_help.html
0,0 → 1,38
<html>
<head>
<title>Framed Compression Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Framed Compression Help Page</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
Framed-Compression indicates a compression protocol to be used for the link.
Possible values are:
</pre>
<i>None</i><br>
<i>Van-Jacobson-TCP-IP</i><br>
<i>IPX-Header-Compression</i><br>
<i>Stac-LZS</i><br>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/framed_protocol_help.html
0,0 → 1,42
<html>
<head>
<title>Framed Protocol Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Framed Protocol Help Page</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
This Attribute indicates the framing to be used for framed access.
It MAY be used in both Access-Request and Access-Accept packets.
 
Possible values are:
</pre>
<i>1 PPP</i><br>
<i>2 SLIP</i><br>
<i>3 AppleTalk Remote Access Protocol (ARAP)</i><br>
<i>4 Gandalf proprietary SingleLink/Multilink protocol</i><br>
<i>5 Xylogics proprietary IPX/SLIP</i><br>
<i>6 X.75 Synchronous</i><br>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/expiration_help.html
0,0 → 1,40
<html>
<head>
<title>Expiration Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Page d'aide : date d'expiration</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
Cet attribut d&eacute;finit la date d'expiration du compte.
Le format est "jour mois ann&eacute;e" (ex: 20 april 2002).
Les mois en anglais sont : january, february, march, april, may, june,
july, august, september, october, november, december
<HR>
This attribute can be used to set the user expiration date. It
should be in the format "$month_day $month_name $year" like:
"20 april 2002"
</pre>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Fermer cette fen&ecirc;tre</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/port_limit_help.html
0,0 → 1,35
<html>
<head>
<title>Port Limit Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Port Limit Help Page</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
Port-Limit is intended for use in conjuction with Multilink PPP or similar uses.
It defines the maximum number of channels the user is allowed to open during
a multilink dialup session.
</pre>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/framed_mtu_help.html
0,0 → 1,39
<html>
<head>
<title>Framed-MTU Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Framed-MTU Help Page</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
Attribute Numer: 12
Value: Integer
</pre>
<pre>
MTU, the Maximum Transfer Unit, is the largest
packet size that can be transmitted over a connection.<br>
The value can be between 64 and 65535.
</pre>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/idle_timeout_help.html
0,0 → 1,35
<html>
<head>
<title>Idle Timeout Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Idle Timeout Help Page</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
This Attribute sets the maximum number of consecutive seconds of
idle connection allowed to the user before termination of the
session or prompt.
</pre>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/login_time_help.html
0,0 → 1,47
<html>
<head>
<title>Login-Time Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Login-Time Help Page</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
Cet attribut d&eacute;finit les p&eacute;riodes pendant lesquelles un usager ou un groupe
peut se connecter. Le format de cet attribut est le suivant :
 
C'est une liste de cha&icirc;nes de caract&egrave;res s&eacute;par&eacute;es par une ",".
Chaque cha&icirc;ne d&eacute;finit une p&eacute;riode pour une journ&eacute;e.
Les journ&eacute;es sont ainsi d&eacute;finies : mo, tu, we, th, fr, sa ou su.
"wk" couvre du lundi au vendredi. "any" couvre tous les jours de
la semaine.
Le jour est suivi du cr&eacute;neau horaire au format hhmm-hhmm
 
Exemple : Wk0755-1700,Sa,Su1655-2030
 
ALCASAR calcule le temps restant dans le cr&eacute;neau imparti. Ainsi, si un usager
se connecte &agrave; 17h30 et que son cr&eacute;neau a &eacute;t&eacute; d&eacute;fini &agrave; "any0800-1700",
sa session ne durera qu'une demi-heure.
</pre>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/session_timeout_help.html
0,0 → 1,37
<html>
<head>
<title>Session Timeout Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Page d'aide : dur&eacute;e de session</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
Ces attibuts ('dur&eacute;e limite mensuelle, journali&egrave;re et d'une session')
d&eacute;finissent la dur&eacute;e de connexion des usagers ou des groupes (en secondes).
<HR>
These Attributes set the maximum number of seconds of service to be
provided to the user before termination of the session or prompt.
</pre>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Fermer cette fen&ecirc;tre</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/framed_ip_address_help.html
0,0 → 1,40
<html>
<head>
<title>Framed-IP-Address Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Framed-IP-Address Help Page</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
Framed-IP-Address can be used to specify the IP address that
a dialup user will use. There are two special values:
</pre>
<i>255.255.255.255: Assign the user requested IP</i><br>
<i>255.255.255.254: Assign an IP from the NAS IP pool</i><br>
<pre>
All other values will be assigned as they are to the user dialup
interface
</pre>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/lock_message_help.html
0,0 → 1,37
<html>
<head>
<title>Lock Message Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Lock Message Help Page</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
The Lock Message will be included as a Reply-Item in all radius server responses for
the user. It will also appear in the Usefull User Description in the user admin page.
It is intended to be used as a hint to the user and to the administrator for the reason
of the user lock out.
In case it is a multi word message it should be enclosed in double quotes
</pre>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/dialup_access_help.html
0,0 → 1,36
<html>
<head>
<title>Dialup Access Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Dialup Access Help Page</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
If the Dialup-Access attribute is specified, the ldap module
checks for its existance in user object. If it exists and is
set to FALSE, user is denied remote access. Otherwise, the user
is allowed remote access.
</pre>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/reply_message_help.html
0,0 → 1,50
<html>
<head>
<title>Reply-Message Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Reply-Message Help Page</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
Attribute Numer: 18
Value: String
</pre>
<pre>
The Reply-Message attribute is used to send a message back to the client
in response of another packet.
RFC2865 describes it as easy as:<br>
"This attribute indicates text which MAY be displayed to the user.
When used in an Access-Accept, it is the success message.
When used in an Access-Reject, it is the failure message. It MAY
indicate a dialog message to prompt the user before another
Access-Request attempt.
When used in an Access-Challenge, it MAY indicate a dialog message
to prompt the user for a response.
Multiple Reply-Message's MAY be included and if any are displayed,
they MUST be displayed in the same order as they appear in the packet.
A summary of the Reply-Message Attribute format is shown below. The
fields are transmitted from left to right."
</pre>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/service_type_help.html
0,0 → 1,81
<html>
<head>
<title>Service-Type Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Service-Type Help Page</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
This Attribute indicates the type of service the user has
requested, or the type of service to be provided. It MAY be used
in both Access-Request and Access-Accept packets. A NAS is not
required to implement all of these service types, and MUST treat
unknown or unsupported Service-Types as though an Access-Reject
had been received instead.
 
Possible values are.
</pre>
<i>1 Login</i><br>
<i>2 Framed</i><br>
<i>3 Callback Login</i><br>
<i>4 Callback Framed</i><br>
<i>5 Outbound</i><br>
<i>6 Administrative</i><br>
<i>7 NAS Prompt</i><br>
<i>8 Authenticate Only</i><br>
<i>9 Callback NAS Prompt</i><br>
<pre>
The service types are defined as follows when used in an Access-
Accept. When used in an Access-Request, they should be considered
to be a hint to the RADIUS server that the NAS has reason to
believe the user would prefer the kind of service indicated, but
the server is not required to honor the hint.
 
Login The user should be connected to a host.
Framed A Framed Protocol should be started for the
User, such as PPP or SLIP.
Callback Login The user should be disconnected and called
back, then connected to a host.
Callback Framed The user should be disconnected and called
back, then a Framed Protocol should be started
for the User, such as PPP or SLIP.
Outbound The user should be granted access to outgoing
devices.
Administrative The user should be granted access to the
administrative interface to the NAS from which
privileged commands can be executed.
NAS Prompt The user should be provided a command prompt
on the NAS from which non-privileged commands
can be executed.
Authenticate Only Only Authentication is requested, and no
authorization information needs to be returned
in the Access-Accept (typically used by proxy
servers rather than the NAS itself).
Callback NAS Prompt The user should be disconnected and called
back, then provided a command prompt on the
NAS from which non-privileged commands can be
executed.
</pre>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/filter_id_help.html
0,0 → 1,38
<html>
<head>
<title>Framed-Id Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Filter-Id Help Page</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
This Attribute indicates the name of the filter list for this
user. Zero or more Filter-Id attributes MAY be sent in an
Access-Accept packet.
 
Identifying a filter list by name allows the filter to be used on
different NASes without regard to filter-list implementation
details.
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/auth_type_help.html
0,0 → 1,44
<html>
<head>
<title>Auth-Type Help Page</title>
<link rel="stylesheet" href="../style.css">
</head>
<body bgcolor="#80a040" background="../images/greenlines1.gif" link="black" alink="black">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Auth-Type Help Page</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
<center>
<pre>
Value: String
</pre>
<pre>
The Auth-Type attribute describes which authentication module to call.
Standard values from a default FreeRADIUS setup my be:
</pre>
<i>PAP</i><br>
<i>CHAP</i><br>
<i>MSCHAP</i><br>
<i>PAM</i><br>
<i>UNIX</i><br>
<i>LADP</i><br>
<i>EAP</i><br>
</td></tr>
<tr><td align=center>
<a href="javascript:window.close();"><b>Close Window</b></a>
</td></tr>
</center>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/help/help.php
0,0 → 1,76
<html>
<head>
<title>Help page</title>
<link rel="stylesheet" href="../style.css">
<!-- Fonctions JavaScript -->
<SCRIPT LANGUAGE="JavaScript">
function ouvrir(page)
{
window.open(page, "portail", "alwaysRaised=yes,toolbar=no,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=no,copyhistory=no,hotkeys=no,width=640 ,height=480");
}
</SCRIPT>
<!-- fin javascript -->
</head>
<body bgcolor="#EFEFEF">
<center>
<table border=0 width=550 cellpadding=0 cellspacing=0>
<tr valign=top>
<!--<td align=center><img src="../images/title2.gif"></td>-->
</tr>
</table>
 
<table border=0 width=400 cellpadding=0 cellspacing=2></table>
 
<br>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=540></td>
<td bgcolor="black" width=400>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th><font color="white">Page d'aide de Dialup Admin</font>&nbsp;</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<br>
 
<!--<b>Choisissez le fichier d'aide que vous voulez lire :</b><br><br>
<form name="readhelp" method=post>
<select name=help_file>
<?php
#$selected[$help_file] = 'selected';
#
#echo <<<EOM
#<option $selected[faq] value="faq">FAQ File
#<option $selected[readme] value="readme">README File
#<option $selected[howto] value="howto">HOWTO File
#EOM;
?>
</select>
<br><br>
<input type=submit class=button value="Read File">
</form>
-->
<td><a href=javascript:ouvrir("http://wiki.freeradius.org/index.php/FAQ")>http://wiki.freeradius.org/index.php/FAQ</a></td>
 
<pre>
<?php
#$in_file = '../../doc/FAQ_dialup.html';
#if ($help_file == 'readme')
# $in_file = '../../README';
#else if ($help_file == 'howto')
# $in_file = '../../doc/HOWTO';
#else if ($help_file == 'faq')
# $in_file = 'FAQ';
#if ($in_file != '')
# readfile("$in_file");
?>
</pre>
<br>
</td></tr>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/group_admin.php
0,0 → 1,141
<?php
require('/etc/freeradius-web/config.php');
if ($show == 1 && isset($del_members)){
header("Location: user_admin.php?login=$del_members[0]");
exit;
}
if ($config[general_lib_type] != 'sql'){
echo <<<EOM
<title>Page de gestion des groupes</title>
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
<link rel="stylesheet" href="style.css">
</head>
<body>
<center>
<b>This page is only available if you are using sql as general library type</b>
</body>
</html>
EOM;
exit();
}
 
unset($group_members);
if (is_file("../lib/$config[general_lib_type]/group_info.php")){
include("../lib/$config[general_lib_type]/group_info.php");
if ($group_exists == 'no'){
echo <<<EOM
<title>Page de gestion des groupes</title>
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
<link rel="stylesheet" href="style.css">
</head>
<body>
<center>
<form action="group_admin.php" method=get>
<b>Le groupe &nbsp;&nbsp;</b>
<input type="text" size=10 name="login" value="$login">
<b>&nbsp;&nbsp;n'existe pas</b><br>
<input type=submit class=button value="Show Group">
</body>
</html>
EOM;
exit();
}
}
?>
 
<html>
<head>
<title>Page de gestion des groupes</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th>Gestion des groupes</th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
height="2"></td></tr>
</TABLE>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
<tr bgcolor="#666666"><td>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
<tr><td valign="middle" align="left">
<center>
<table border=0 width=550 cellpadding=0 cellspacing=0>
<tr valign=top>
<!--<td align=center><img src="images/title2.gif"></td>-->
</tr>
</table>
<table border=0 width=400 cellpadding=0 cellspacing=2>
 
<?php
include("../html/group_toolbar.html.php");
?>
 
</table>
<br>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=200>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th>
<font color="white">Gestion du groupe <?php echo $login ?></font>&nbsp;
</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
 
<?php
if ($do_changes == 1){
if (is_file("../lib/$config[general_lib_type]/group_admin.php"))
include("../lib/$config[general_lib_type]/group_admin.php");
if (is_file("../lib/$config[general_lib_type]/group_info.php"))
include("../lib/$config[general_lib_type]/group_info.php");
}
?>
<form method=post>
<input type=hidden name=login value=<?php echo $login ?>>
<input type=hidden name=do_changes value=0>
<input type=hidden name=show value=0>
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
<tr>
<td align=right bgcolor="#d0ddb0">
<b>Membre(s) &agrave; effacer</b><br> (les membres s&eacute;lectionn&eacute;s seront effac&eacute;s du groupe<br>utilisez 'shift' ou 'Ctrl' pour une s&eacute;lection multiple)
</td>
<td>
<select name=del_members[] multiple size=5>
<?php
foreach ($group_members as $member){
echo "<option value=\"$member\">$member\n";
}
?>
</select>
</td>
</tr>
<tr>
<td align=right bgcolor="#d0ddb0">
<b>Membre(s) &agrave; ajouter</b><br>(s&eacute;parez les membres par un espace ou un 'retour chariot')
</td>
<td>
<textarea name=new_members cols="15" wrap="PHYSICAL" rows=5></textarea>
</td>
</tr>
</table>
<br>
<input type=submit class=button value="Effectuer les changements" OnClick="this.form.do_changes.value=1">
<br><br>
<input type=submit class=button value="G&eacute;rer l'utilisateur s&eacute;lectionn&eacute;" OnClick="this.form.show.value=1">
</form>
</td></tr>
</table>
</tr>
</table>
</TD></TR>
</TABLE>
</td></tr>
</TABLE>
</body>
</html>
/gestion/manager/htdocs/group_new.php
0,0 → 1,222
<?php
# Choice of language
$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 = "Cr&eacute;ation d'un groupe";
$l_frame_top = "Gestion des groupes";
$l_frame = "Gestion des groupes";
$l_group_create = "Cr&eacute;er un groupe";
}
else {
$l_title = "Create a group";
$l_frame_top = "Groups admin";
$l_frame = "Groups admin";
$l_group_create = "Create a group";
}
require('/etc/freeradius-web/config.php');
if ($show == 1){
header("Location: group_admin.php?login=$login");
exit;
}
 
if ($config[general_lib_type] != 'sql'){
echo <<<EOM
<title>$l_title</title>
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
<link rel="stylesheet" href="style.css">
</head>
<body>
<center>
<b>This page is only available if you are using sql as general library type</b>
</body>
</html>
EOM;
exit();
}
 
require('../lib/attrshow.php');
require('../lib/defaults.php');
require("../lib/$config[general_lib_type]/group_info.php");
 
if ($config[general_lib_type] == 'sql' && $config[sql_use_operators] == 'true'){
$colspan=2;
$show_ops=1;
}else{
$show_ops = 0;
$colspan=1;
}
echo "<html><head><title>$l_title</title>";
 
?>
 
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th><? echo "$l_frame_top"; ?></th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
height="2"></td></tr>
</TABLE>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
<tr bgcolor="#666666"><td>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
<tr><td valign="middle" align="left">
<center>
<table border=0 width=550 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=200>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th>
<font color="white"><? echo "$l_group_create"; ?></font>
</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<?php
if (is_file("../lib/$config[general_lib_type]/group_info.php"))
include("../lib/$config[general_lib_type]/group_info.php");
if ($create == 1){
if ($group_exists != "no"){
echo <<<EOM
<b>Le groupe <i>$login</i> existe d&eacute;j&agrave;.</b>
EOM;
}
else{
if (is_file("../lib/$config[general_lib_type]/create_group.php"))
include("../lib/$config[general_lib_type]/create_group.php");
if (is_file("../lib/$config[general_lib_type]/group_info.php"))
include("../lib/$config[general_lib_type]/group_info.php");
}
}
?>
<form method=post>
<input type=hidden name=create value="0">
<input type=hidden name=show value="0">
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
<?php
echo <<<EOM
<tr>
<td align=right colspan=$colspan bgcolor="#d0ddb0">
Groupe(s) d&eacute;j&agrave; cr&eacute;&eacute;(s)
</td><td>
EOM;
if (!isset($existing_groups))
echo "<b>Aucun groupe d&eacute;j&agrave; cr&eacute;&eacute;</b>\n";
else{
echo "<select name=\"existing_groups\">\n";
foreach ($existing_groups as $group => $count)
echo "<option value=\"$group\">$group\n";
echo "</select>\n";
}
echo <<<EOM
</td>
</tr>
<tr>
<td align=right colspan=$colspan bgcolor="#d0ddb0">
Nom du groupe
</td><td>
<input type=text name="login" value="$login" size=35>
</td>
</tr>
<tr>
<td align=right colspan=$colspan bgcolor="#d0ddb0">
Membres du groupe : s&eacute;par&eacute;s par un espace ou un 'retour chariot'.
</td><td>
<textarea name=members cols="15" wrap="PHYSICAL" rows=5></textarea>
</td>
</tr>
EOM;
foreach($show_attrs as $key => $desc){
$name = $attrmap["$key"];
if ($name == 'none')
continue;
$oper_name = $name . '_op';
$val = ($item_vals["$key"][0] != "") ? $item_vals["$key"][0] : $default_vals["$key"][0];
print <<<EOM
<tr>
<td align=right bgcolor="#d0ddb0">
$desc
</td>
EOM;
 
if ($show_ops){
switch ($key)
{
case 'Simultaneous-Use' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=";
break;
case 'Login-Time' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=";
break;
case 'Expiration' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=";
break;
case 'Session-Timeout' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=";
break;
case 'Max-Daily-Session' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=";
break;
case 'Max-Weekly-Session' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=";
break;
case 'Max-Monthly-Session' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=";
break;
default :
print <<<EOM
<td>
<select name=$oper_name>
<option $selected[$op_eq] value="=">=
<option $selected[$op_set] value=":=">:=
<option $selected[$op_add] value="+=">+=
<option $selected[$op_eq2] value="==">==
<option $selected[$op_ne] value="!=">!=
<option $selected[$op_gt] value=">">&gt;
<option $selected[$op_ge] value=">=">&gt;=
<option $selected[$op_lt] value="<">&lt;
<option $selected[$op_le] value="<=">&lt;=
<option $selected[$op_regeq] value="=~">=~
<option $selected[$op_regne] value="!~">!~
<option $selected[$op_exst] value="=*">=*
<option $selected[$op_nexst] value="!*">!*
</select>
</td>
EOM;
break;
}
}
print <<<EOM
<td>
<input type=text name="$name" value="$val" size=35>
</td>
</tr>
EOM;
}
echo "</table><BR>";
if ($create == 1)
echo "<input type=submit class=button value=\"Afficher le groupe\" OnClick=\"this.form.show.value=1\">";
else
echo "<input type=submit class=button value=\"Cr&eacute;er\" OnClick=\"this.form.create.value=1\">";
?>
<br><br>
</form>
</td></tr>
</table>
</tr>
</table>
</TD></TR>
</TABLE>
</td></tr>
</TABLE>
</body>
</html>
/gestion/manager/htdocs/import_user.php
0,0 → 1,236
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><!-- Written by Rexy, Romero P. & 3abTux -->
<HEAD>
<TITLE>Import d'usagers</TITLE>
<link rel="stylesheet" href="/css/style.css" type="text/css">
</HEAD>
<body>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th>Import d'usagers</th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
</TABLE>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
<tr bgcolor="#666666"><td>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
<tr><td valign="middle" align="left">
<CENTER><H3>&Eacute;tat actuel de la base : nombre de groupe =
<?php
function creatlog ($login,$password,$service,$RS_out)
{
/* génère un fichier en sortie avec les info de connexion en clair */
fputs($RS_out," --- Accès à Internet via ALCASAR --- "."\r\n\r\n");
fputs($RS_out,"Service : $service"."\r\n\r\n");
fputs($RS_out,"Nom de connexion : $login | Mot de passe : $password\r\n\r\n");
fputs($RS_out,"Pensez à changer votre mot de passe (lien sur la page d'authentification)"."\r\n\r\n");
fputs($RS_out,"--------------------------------------------------------------------------------"."\r\n\r\n");
}
 
function GenPassword($nb_car="8")
{
/* generation aléatoire du mot de passe */
$password = "";
$chaine = "aAzZeErRtTyYuUIopP152346897mMLkK";
$chaine .= "jJhHgGfFdDsSqQwWxXcCvVbBnN152346897";
while($nb_car != 0)
{
$i = rand(0,71);
$password .= $chaine[$i];
$nb_car --;
}
return $password ;
}
 
$LIBpath = "../";
require('/etc/freeradius-web/config.php');
if (is_file($LIBpath."lib/sql/drivers/$config[sql_type]/functions.php"))
{
include_once($LIBpath."lib/sql/drivers/$config[sql_type]/functions.php");
}
else
{
echo "<b>Could not include SQL library</b><br>\n";
exit();
}
include_once($LIBpath.'lib/functions.php');
if ($config[sql_use_operators] == 'true')
{
include($LIBpath."lib/operators.php");
$text = ',op';
$passwd_op = ",':='";
}
$link = @da_sql_pconnect($config);
$choix = $_POST ['choix'];
if ($choix == "raz")
{
exec ("sudo /usr/local/sbin/alcasar-mysql.sh -raz");
}
# un fichier est importé
if(isset($_FILES['import-users']))
{
unset($result);
$service = $_POST['service'];
$group = $_POST ['groupe'];
$destination = '/tmp/import_file.txt';
list($name_file , $extension) = explode("." , $_FILES['import-users']['name']);
$extension = strstr($_FILES['import-users']['name'], '.');
$file_out = "/tmp/$name_file.pwd" ;
if ($choix == "csv")
//import d'un fichier txt
{
if (($extension != '.csv') && ($extension != '.txt')) $result = 'Veuillez s&eacute;lectionner un fichier de type csv ou txt !';
else
{
exec ("sudo /usr/local/sbin/alcasar-mysql.sh -dump");
move_uploaded_file($_FILES['import-users']['tmp_name'], $destination);
$RS_in = file ($destination);
$da_abort=0;
if ($link)
{
if (is_file($LIBpath."lib/crypt/$config[general_encryption_method].php"))
{
include($LIBpath."lib/crypt/$config[general_encryption_method].php");
$RS_out = fopen ("$file_out", "wb");
foreach ($RS_in as $no => $ligne)
{
$tligne = split(" ",$ligne);
$login = str_replace("%0D","",str_replace("%0A","",urlencode ($tligne[0])));
$password = GenPassword();
$passwd = da_encrypt($password);
$passwd = da_sql_escape_string($passwd);
/* insertion (login + password) dans la table "radcheck" (si l'usager existe --> changement de mot de passe) */
$res = @da_sql_query($link,$config,"INSERT INTO $config[sql_check_table] (attribute,value,username $text) VALUES ('$config[sql_password_attribute]','$passwd','$login' $passwd_op);");
if (!$res || !@da_sql_affected_rows($link,$res,$config))
{
echo "<b>Unable to add user $login: " . da_sql_error($link,$config) . "</b><br>\n";
$da_abort=1;
}
else
{
creatlog ($login,$password,$service,$RS_out);
/*echo $login." : ".$password." , ";*/
}
/* insertion de l'usager dans la table "userinfo" */
if ($config[sql_use_user_info_table] == 'true' && !$da_abort)
{
$res = @da_sql_query($link,$config, "SELECT username FROM $config[sql_user_info_table] WHERE username = '$login';");
if ($res)
{
if (!@da_sql_num_rows($res,$config))
{
$res = @da_sql_query($link,$config,"INSERT INTO $config[sql_user_info_table] (username,department) VALUES ('$login','$service');");
if (!$res || !@da_sql_affected_rows($link,$res,$config))
echo "<b>Could not add user information in user info table: " . da_sql_error($link,$config) . "</b><br>\n";
}
else
echo "<b>User already exists in user info table.</b><br>\n";
}
else
echo "<b>Could not add user information in user info table: " . da_sql_error($link,$config) . "</b><br>\n";
if ($group != '')
{
$group = da_sql_escape_string($group);
$res = @da_sql_query($link,$config,"SELECT username FROM $config[sql_usergroup_table] WHERE username = '$login' AND groupname = '$group';");
if ($res)
{
if (!@da_sql_num_rows($res,$config))
{
$res = @da_sql_query($link,$config,"INSERT INTO $config[sql_usergroup_table] (username,groupname) VALUES ('$login','$group');");
if (!$res || !@da_sql_affected_rows($link,$res,$config))
echo "<b>Could not add user to group $group. SQL Error</b><br>\n";
} # end if
else
echo "<b>User already is a member of group $group</b><br>\n";
} # end if
else
echo "<b>Could not add user to group $group: " . da_sql_error($link,$config) . "</b><br>\n";
} # end if ($group)
} # end if ($config)
} # end foreach
fclose($RS_out);
}
} # end if (is_file ...
}
}
else if ($choix == "bdd")
//import d'une Bdd
{
echo $extention;
if ($extension != '.sql') $result = 'Veuillez s&eacute;lectionner un fichier de type sql !';
else
{
exec ("sudo /usr/local/sbin/alcasar-mysql.sh -dump");
move_uploaded_file($_FILES['import-users']['tmp_name'], $destination);
exec ("sudo /usr/local/sbin/alcasar-mysql.sh -import $destination");
}
}
}
if ($link)
{
$res = @da_sql_query($link,$config,"SELECT GroupName FROM radusergroup GROUP BY GroupName");
if ($res)
{
$nb_group = @da_sql_num_rows($res,$config);
echo $nb_group;
}
}
echo ", nombre d'usagers = ";
if ($link)
{
$res = @da_sql_query($link,$config,"SELECT UserName FROM userinfo");
if ($res)
{
$nb_user = @da_sql_num_rows($res,$config);
echo "$nb_user";
}
}
echo "</TD></TR></TABLE>";
echo "</TD></TR></TABLE>";
echo "<TABLE width=\"100%\" border=0 cellspacing=0 cellpadding=1>";
echo "<tr bgcolor=\"#666666\"><td>";
echo "<TABLE width=\"100%\" border=0 cellspacing=0 cellpadding=2>";
echo "<tr><td valign=\"middle\" align=\"left\">";
echo "<CENTER><H3>Importer &agrave; partir d'un fichier texte (format TXT)</H3></CENTER>";
echo "Cette fonctionalit&eacute; ne supporte actuellement qu'une liste simple de noms d'usagers (les uns sous les autres).<br>";
echo "Pour chaque importation, un fichier contenant les identifiants et les mots de passe des usagers est g&eacute;n&eacute;r&eacute; sous : /tmp/nomdufichier.pwd";
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST ENCTYPE=\"multipart/form-data\">";
echo "Fichier (.txt) : <input type=\"file\" name=\"import-users\"><br>";
echo "D&eacute;finissez leur service (facultatif) : <input type=\"input\" name=\"service\" value=\"\"><br>";
echo "D&eacute;finissez leur groupe (conseill&eacute;) : <input type=\"input\" name=\"groupe\" value=\"\"><br>";
echo "<input type='hidden' name='choix' value='csv'>";
if (($choix == "csv") && isset($result)) echo $result."<BR>";
echo "<input type=\"submit\" value=\"Envoyer\">";
echo "</FORM>";
echo "</TD></TR></TABLE>";
echo "</TD></TR></TABLE>";
echo "<TABLE width=\"100%\" border=0 cellspacing=0 cellpadding=1>";
echo "<tr bgcolor=\"#666666\"><td>";
echo "<TABLE width=\"100%\" border=0 cellspacing=0 cellpadding=2>";
echo "<tr><td valign=\"middle\" align=\"left\">";
echo "<H3><CENTER>Importer &agrave; partir de l'archive sauvegard&eacute;e d'une base d'usagers (format SQL)</CENTER></H3>";
echo "!!! ATTENTION !!! Cette action supprimera la base existante contenant les preuves d'imputabilit&eacute; des connexions.<BR>";
echo "Une sauvegarde de la base actuelle sera automatiquement r&eacute;alis&eacute;e.";
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST ENCTYPE=\"multipart/form-data\">";
echo "Fichier (.sql) : <input type=\"file\" name=\"import-users\"><br>";
echo "<input type='hidden' name='choix' value='bdd'>";
if (($choix == "bdd") && isset($result)) echo $result."<BR>";
echo "<input type=\"submit\" value=\"Envoyer\">";
echo "</FORM>";
echo "</TD></TR></TABLE>";
echo "</TD></TR></TABLE>";
echo "<TABLE width=\"100%\" border=0 cellspacing=0 cellpadding=1>";
echo "<tr bgcolor=\"#666666\"><td>";
echo "<TABLE width=\"100%\" border=0 cellspacing=0 cellpadding=2>";
echo "<tr><td valign=\"middle\" align=\"left\">";
echo "<H3><CENTER>Remise &agrave; z&eacute;ro de la base usagers (RAZ)</CENTER></H3>";
echo "!!! ATTENTION !!! cette action supprimera les preuves d'imputabilit&eacute; des connexions.<br>";
echo "Une sauvegarde de la base actuelle sera automatiquement r&eacute;alis&eacute;e.";
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
echo "<input type='hidden' name='choix' value='raz'>";
echo "<input type=\"submit\" value=\"Envoyer\">";
echo "</FORM>";
echo "</TD></TR></TABLE>";
echo "</TD></TR></TABLE>";
?>
</BODY>
</HTML>
<?php
/gestion/manager/htdocs/user_finger.php
0,0 → 1,236
<?php
require('/etc/freeradius-web/config.php');
require('../lib/attrshow.php');
require('../lib/sql/nas_list.php');
if (!isset($usage_summary)){
echo <<<EOM
<html>
<head>
<META HTTP-EQUIV="Refresh" CONTENT="50">
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
<title>Usagers connect&eacute;es</title>
<link rel="stylesheet" href="/css/style.css">
</head>
EOM;
}
 
if ($config[general_decode_normal_attributes] == 'yes'){
if (is_file("../lib/lang/$config[general_prefered_lang]/utf8.php"))
include_once("../lib/lang/$config[general_prefered_lang]/utf8.php");
else
include_once('../lib/lang/default/utf8.php');
$k = init_decoder();
$decode_normal = 1;
}
require_once('../lib/functions.php');
require("../lib/$config[general_lib_type]/functions.php");
 
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
else{
echo <<<EOM
<body>
<center>
<b>Could not include SQL library functions. Aborting</b>
</body>
</html>
EOM;
exit();
}
setlocale (LC_ALL, 'fr_FR');
$date = strftime('%A, %e %B %Y, %T %Z');
 
$sql_extra_query = '';
if ($config[sql_accounting_extra_query] != ''){
$sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config);
$sql_extra_query = da_sql_escape_string($sql_extra_query);
}
 
$link = @da_sql_pconnect($config);
$link2 = connect2db($config);
$tot_in = $tot_rem = 0;
if ($link){
$h = 21;
$servers_num = 0;
if ($config[general_ld_library_path] != '')
putenv("LD_LIBRARY_PATH=$config[general_ld_library_path]");
foreach($nas_list as $nas){
$j = 0;
$num = 0;
 
if ($server != ''){
if ($nas[name] == $server)
$servers_num++;
else
continue;
}
else
$servers_num++;
if ($nas[ip] == '')
continue;
$name_data = $nas[ip];
$community_data = $nas[community];
$server_name[$servers_num] = $nas[name];
$server_model[$servers_num] = $nas[model];
$extra = "";
$finger_type = $config[general_finger_type];
if ($nas[finger_type] != '')
$finger_type = $nas[finger_type];
if ($finger_type == 'snmp'){
$nas_type = ($nas[type] != '') ? $nas[type] : $config[general_nas_type];
if ($nas_type == '')
$nas_type = 'cisco';
 
$users=exec("$config[general_snmpfinger_bin] $name_data $community_data $nas_type");
if (strlen($users)){
$extra = "AND username IN ($users)";
if ($config[general_strip_realms] == 'yes'){
if ($config[general_realm_format] == 'prefix')
$match = "'[^']+" . $config[general_realm_delimiter];
else
$match = $config[general_realm_delimiter] . "[^']+'";
$extra = preg_replace("/$match/","'",$extra);
}
}
}
$search = @da_sql_query($link,$config,
"SELECT COUNT(*) AS onlineusers FROM $config[sql_accounting_table] WHERE
acctstoptime IS NULL AND nasipaddress = '$name_data' $extra $sql_extra_query;");
if ($search){
if (($row = @da_sql_fetch_array($search,$config)))
$num = $row[onlineusers];
}
$search = @da_sql_query($link,$config,
"SELECT DISTINCT username,acctstarttime,framedipaddress,callingstationid
FROM $config[sql_accounting_table] WHERE
acctstoptime IS NULL AND nasipaddress = '$name_data' $extra $sql_extra_query
GROUP BY username,acctstarttime,framedipaddress,callingstationid
ORDER BY acctstarttime;");
if ($search){
$now = time();
while($row = @da_sql_fetch_array($search,$config)){
$j++;
$h += 21;
$user = $row['username'];
$finger_info[$servers_num][$j]['ip'] = $row['framedipaddress'];
if ($finger_info[$servers_num][$j]['ip'] == '')
$finger_info[$servers_num][$j]['ip'] = '-';
$session_time = $row['acctstarttime'];
$session_time = date2timediv($session_time,$now);
$finger_info[$servers_num][$j]['session_time'] = time2strclock($session_time);
$finger_info[$servers_num][$j]['user'] = $user;
$finger_info[$servers_num][$j]['callerid'] = $row['callingstationid'];
if ($finger_info[$servers_num][$j]['callerid'] == '')
$finger_info[$servers_num][$j]['callerid'] = '-';
if ($user_info["$user"] == ''){
$user_info["$user"] = get_user_info($link2,$user,$config,$decode_normal,$k);
if ($user_info["$user"] == '' || $user_info["$user"] == ' ')
$user_info["$user"] = 'Unknown User';
}
}
$height[$servers_num] = $h;
}
$server_counting[$servers_num] = $j;
$server_loggedin[$servers_num] = $num;
$server_rem[$servers_num] = ($config[$portnum]) ? ($config[$portnum] - $num) : 'unknown';
$tot_in += $num;
if (is_numeric($server_rem[$servers_num]))
$tot_rem += $server_rem[$servers_num];
}
}
else
echo "<b>Could not connect to SQL database</b><br>\n";
if (isset($usage_summary)){
echo "Online: $tot_in Free: $tot_rem\n";
exit();
}
?>
 
<body>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th>Gestion des usagers</th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
height="2"></td></tr>
</TABLE>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
<tr bgcolor="#666666"><td>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
<tr><td valign="middle" align="left">
<center>
<table border=0 width=550 cellpadding=0 cellspacing=0>
<tr valign=top>
<!--<td align=center><img src="images/title2.gif"></td>-->
</tr>
</table>
<br>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=200>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th>
<font color="white">Usagers en ligne</font>&nbsp;
</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<?php
echo <<<EOM
<center><b>$date</b></center>
EOM;
for($j = 1; $j <= $servers_num; $j++){
echo <<<EOM
<p>
<table width=100% cellpadding=0 height=30><tr>
<th align=left>$server_name[$j]</th><th align=right><font color="red">$server_loggedin[$j] usager(s) connect&eacute;(s)</font></th><th>$server_model[$j]</th>
</tr>
</table>
<div height="$height[$j]" style="height:$height[$j]">
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
<tr bgcolor="#d0ddb0">
<th>#</th><th>usager</th>
EOM;
if ($acct_attrs['uf'][4] != '') echo "<th>" . $acct_attrs[uf][4] . "</th>\n";
if ($acct_attrs['uf'][9] != '') echo "<th>" . $acct_attrs[uf][9] . "</th>\n";
echo <<<EOM
<th>nom</th><th>dur&eacute;e</th>
</tr>
EOM;
for( $k = 1; $k <= $server_counting[$j]; $k++){
$user = $finger_info[$j][$k][user];
if ($user == '')
$user = '&nbsp;';
$User = urlencode($user);
$time = $finger_info[$j][$k][session_time];
$ip = $finger_info[$j][$k][ip];
$cid = $finger_info[$j][$k][callerid];
$inf = $user_info[$user];
echo <<<EOM
<tr align=center>
<td>$k</td><td><a href="user_admin.php?login=$User" title="Editer l'utilisateur $user">$user</a></td>
EOM;
if ($acct_attrs['uf'][4] != '') echo "<td>$ip</td>\n";
if ($acct_attrs['uf'][9] != '') echo "<td>$cid</td>\n";
echo <<<EOM
<td>$inf</td><td>$time</td>
</tr>
EOM;
}
 
echo <<<EOM
</table>
</div>
EOM;
}
?>
</td></tr>
</table>
</td></tr>
</table>
</TD></TR>
</TABLE>
</td></tr>
</TABLE><p>
</html>
/gestion/manager/htdocs/user_test.php
0,0 → 1,208
<?php
require('/etc/freeradius-web/config.php');
 
if ($login == 'da_server_test'){
$login = $config[general_test_account_login];
$test_login=1;
}
 
echo <<<EOM
<html>
<head>
<title>Test de l'utilisateur $login</title>
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
<link rel="stylesheet" href="style.css">
</head>
<body>
<center>
<table border=0 width=550 cellpadding=0 cellspacing=0>
<tr valign=top>
<!--<td align=center><img src="images/title2.gif"></td>-->
</tr>
</table>
 
<table border=0 width=400 cellpadding=0 cellspacing=2>
EOM;
 
if (!$test_login)
include("../html/user_toolbar.html.php");
 
print <<<EOM
</table>
 
<br>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=200>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th>
EOM;
 
if ($test_login){
print <<<EOM
<font color="white">Page de Test du serveur Radius</font>&nbsp;
EOM;
}else{
print <<<EOM
<font color="white">Page de Test de l'utilisateur $login</font>&nbsp;
EOM;
}
?>
</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
 
<?php
if ($server == '' || !preg_match('/^[\w\.]+$/',$server))
$server = $config[general_radius_server];
if ($port == 0 || !is_numeric($port))
$port = $config[general_radius_server_port];
if ($auth_proto == '')
$auth_proto = $config[general_radius_server_auth_proto];
$selected[$auth_proto] = 'selected';
 
if ($test_user == 1){
$tmp_file = tempnam("$config[general_tmp_dir]",'DA');
$req=file($config[general_auth_request_file]);
if ($config[general_ld_library_path] != '')
putenv("LD_LIBRARY_PATH=$config[general_ld_library_path]");
$comm = $config[general_radclient_bin] . " $server:$port" . ' auth ' . $config[general_radius_server_secret]
. ' >' . $tmp_file;
$fp = popen("$comm","w");
if ($fp){
foreach ($req as $val){
// Ignore comments
if (ereg('^[[:space:]]*#',$val) || ereg('^[[:space:]]*$',$val))
continue;
fwrite($fp,$val);
}
if ($test_login){
$test=1;
fwrite($fp, "User-Name = \"$config[general_test_account_login]\"\n");
fwrite($fp, "User-Password = \"$config[general_test_account_password]\"\n");
pclose($fp);
}
else{
fwrite($fp, "User-Name = \"$login\"\n");
if ($auth_proto == 'chap')
fwrite($fp, "CHAP-Password = \"$passwd\"\n");
else
fwrite($fp, "User-Password = \"$passwd\"\n");
if (strlen($extra))
fwrite($fp,$extra);
pclose($fp);
}
$reply = file($tmp_file);
unlink($tmp_file);
$msg = "<b>" . strftime('%A, %e %B %Y, %T %Z') . "</b><br>\n";
$msg .= "<b>Server: </b><i>$server:$port</i><br><br>\n";
if (ereg('code 2', $reply[0]))
$msg .= "<b>L'authentification a <font color=green>r&eacute;ussie</font>";
else if (ereg('code 3',$reply[0]))
$msg .= "<b>L'authentification a <font color=red>&eacute;chou&eacute;e</font>";
else if (ereg('no response from server', $reply[0]))
$msg .= "<b><font color=red>Pas de r&eacute;ponse du serveur</font>";
else if (ereg('Connection refused',$reply[0]))
$msg .= "<b><font color=red>La connection a &eacute;t&eacute; refus&eacute;e</font>";
if ($test_login)
$msg .= "</b><i> (test de l'utilisateur $login)</i><br>\n";
else
$msg .= "</b><br>\n";
array_shift($reply);
if (count($reply)){
$msg .= "<br><b>R&eacute;ponse du serveur :</b><br>\n";
foreach ($reply as $val){
$msg .= "<i>$val</i><br>\n";
}
}
if ($test_login){
print <<<EOM
$msg
<br>
</td></tr>
</table>
</tr>
</table>
</body>
</html>
EOM;
exit();
}
 
}
}
?>
<form method=post>
<input type=hidden name=login value=<?php print $login ?>>
<input type=hidden name=test_user value="0">
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
<tr>
<td align=right bgcolor="#d0ddb0">
Mot de passe utilisateur
</td>
<td>
<input type=password name=passwd value="<?php print $passwd ?>" size=25>
</td>
</tr>
<tr>
<td align=right bgcolor="#d0ddb0">
Serveur Radius
</td>
<td>
<input type=text name=server value="<?php print $server ?>" size=25>
</td>
</tr>
<tr>
<td align=right bgcolor="#d0ddb0">
Port du serveur Radius
</td>
<td>
<input type=text name=port value="<?php print $port ?>" size=25>
</td>
</tr>
<tr>
<td align=right bgcolor="#d0ddb0">
Attributs suppl&eacute;mentaires
</td>
<td>
<textarea name="extra" cols="35" wrap="PHYSICAL" rows="4"><?php print $extra ?></textarea>
</td>
</tr>
<tr>
<td align=right bgcolor="#d0ddb0">
Protocole d'authentification
</td>
<td>
<?php
echo <<<EOM
<select name="auth_proto" editable>
<option $selected[pap] value="pap">PAP
<option $selected[chap] value="chap">CHAP
EOM
?>
</select>
</td>
</tr>
 
</table>
<br>
<input type=submit class=button value="Lancement du Test" OnClick="this.form.test_user.value=1">
</form>
<?php
if ($test_user == 1){
echo <<<EOM
<br>
$msg
EOM;
}
?>
</td></tr>
</table>
</tr>
</table>
</body>
</html>
/gestion/manager/htdocs/show_groups.php
0,0 → 1,124
<?php
# Choice of language
$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 = "Liste des groupes d'usagers";
$l_frame_top = "Gestion des groupes";
$l_frame = "Liste des groupes";
$l_group = "groupe";
$l_nb_users = "Nombre d'usagers";
$l_empty_list = "La liste des groupes est vide";
}
else {
$l_title = "Create a group";
$l_frame_top = "Groups admin";
$l_frame = "Groups list";
$l_group = "group";
$l_nb_users = "Number of users";
$l_empty_list = "The groups list is empty";
}
require('/etc/freeradius-web/config.php');
?>
<html>
<?php
 
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
else{
echo <<<EOM
<title>$l_title</title>
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<center>
<b>Could not include SQL library functions. Aborting</b>
</body>
</html>
EOM;
exit();
}
if ($config[general_lib_type] != 'sql'){
echo <<<EOM
<title>$l_title</title>
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
<link rel="stylesheet" href="style.css">
</head>
<body>
<center>
<b>This page is only available if you are using sql as general library type</b>
</body>
</html>
EOM;
exit();
}
?>
<head>
<title><?php echo "$l_title"; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th><?php echo "$l_frame_top"; ?></th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
height="2"></td></tr>
</TABLE>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
<tr bgcolor="#666666"><td>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
<tr><td valign="middle" align="left">
<center>
<table border=0 width=550 cellpadding=0 cellspacing=0>
<tr valign=top>
</tr>
</table>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=55%></td>
<td bgcolor="black" width=45%>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th>
<font color="white"><?php echo "$l_frame"; ?></font>
</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<?php
unset($login);
$num = 0;
include_once("../lib/$config[general_lib_type]/group_info.php");
if (isset($existing_groups)){
echo "<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor=\"#ffffe0\" valign=top>";
echo "<tr bgcolor=\"#d0ddb0\">";
echo "<th>#</th><th>$l_group </th><th>$l_nb_users</th></tr>";
foreach ($existing_groups as $group => $num_members){
$num++;
$Group = urlencode($group);
echo <<<EOM
<tr align=center>
<td>$num</td>
<td><a href="group_admin.php?login=$Group" title="Editer le groupe $group">$group</a></td>
<td>$num_members</td>
</tr>
EOM;
}
}
else
echo "<b>$l_empty_list</b>\n";
?>
</table>
</table>
</tr>
</table>
</TD></TR>
</TABLE>
</td></tr>
</TABLE>
</body>
</html>
/gestion/manager/htdocs/find.php
0,0 → 1,155
<?php
require('/etc/freeradius-web/config.php');
if (isset($search_IN)) $selected[$search_IN] = 'selected';
if (isset ($radius_attr)) $selected[$radius_attr] = 'selected';
if (isset ($max_results)){ $max = ($max_results) ? $max_results : 40;}
?>
<html>
<head>
<title>Gestion des usager</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config['general_charset']?>">
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th>Gestion des usagers</th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
height="2"></td></tr>
</TABLE>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
<tr bgcolor="#666666"><td>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
<tr><td valign="middle" align="left">
<center>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=200>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th>
<font color="white">Filtre de recherche</font>&nbsp;
</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
 
<?php
if (isset($find_user)){
if ($find_user == 1){
unset($found_users);
if (is_file("../lib/$config[general_lib_type]/find.php"))
include("../lib/$config[general_lib_type]/find.php");
if (isset($found_users)){
$num = 0;
$msg .= <<<EOM
 
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
<tr bgcolor="#d0ddb0">
<th>#</th><th>Usager</th><th>Actions</th>
</tr>
EOM;
foreach ($found_users as $user){
if ($user == '')
$user = '-';
$User = urlencode($user);
$num++;
$msg .= <<<EOM
<tr align=center>
<td>$num</td>
<td>$user</td>
<td><a href="user_admin.php?login=$User" title="&Eacute;tat"><img src=/images/info.gif></a>
<a href="user_edit.php?login=$User" title="Attributs"><img src=/images/create.gif></a>
<a href="user_info.php?login=$User" title="Informations personnelles"><img src=/images/tpf.gif></a>
<a href="user_accounting.php?login=$User" title="Connexions effectu&eacute;es"><img src=/images/graph.gif></a>
<a href="clear_opensessions.php?login=$User" title="Sessions ouvertes"><img src=/images/state_ok.gif></a>
<a href="user_delete.php?login=$User" title="Supprimer"><img src=/images/state_error.gif></a></td>
</tr>
EOM;
}
$msg .= "</table>\n";
}
else
$msg = "<b>Pas d'usagers trouv&eacute;s</b><br>\n";
}
}
?>
<form method=post>
<input type=hidden name=find_user value="0">
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
<tr>
<td align=right bgcolor="#d0ddb0">
Crit&egrave;re de recherche
</td>
<td>
<?php
echo <<<EOM
<select name="search_IN" editable onChange="this.form.submit();">
<option $selected[username] value="username">Identifiant (login)
<option $selected[name] value="name">Nom complet (NOM Prenom)
<option $selected[department] value="department">Service
<option $selected[radius] value="radius">Attribut particulier
EOM;
?>
 
</select>
</td>
</tr>
<?php
if (isset($search_IN)){
if ($search_IN == 'radius'){
require('../lib/attrshow.php');
echo <<<EOM
<tr>
<td align=right bgcolor="#d0ddb0">
Attributs RADIUS
</td>
<td>
<select name="radius_attr" editable>
EOM;
foreach($show_attrs as $key => $desc)
echo "<option $selected[$key] value=\"$key\">$desc\n";
echo <<<EOM
</select>
</td>
</tr>
EOM;
}
}
?>
<tr>
<td align=right bgcolor="#d0ddb0">
qui contient<BR>
(champ vide = tout)
</td>
<td>
<input type=text name="search" value="<?php if (isset($search)) echo $search ;?>" size=25>
</td>
</tr>
<!--<tr>
<td align=right bgcolor="#d0ddb0">
Nombre de r&eacute;sultats Max.
</td>
<td>
<input type=text name="max_results" value="<?php echo $max ?>" size=25>
</td>
</tr> -->
</table>
<br>
<input type=submit class=button value="Lancer la recherche" OnClick="this.form.find_user.value=1">
</form>
<?php
if (isset($find_user)){
if ($find_user == 1){ echo $msg ;}}
?>
</td></tr>
</table>
</td></tr>
</table>
</td></tr>
</TABLE>
</td></tr>
</TABLE>
</body>
</html>
/gestion/manager/htdocs/user_edit.php
0,0 → 1,342
<?php
require('/etc/freeradius-web/config.php');
require('../lib/attrshow.php');
require('../lib/defaults.php');
$extra_text = '';
if ($user_type != 'group'){
if (is_file("../lib/$config[general_lib_type]/user_info.php"))
include("../lib/$config[general_lib_type]/user_info.php");
if ($config[general_lib_type] == 'sql' && $config[sql_show_all_groups] == 'true'){
$extra_text = "<br><font size=-2><i>(le groupe auquel apartient l'usager est surlign&eacute;)</i></font>";
$saved_login = $login;
$login = '';
if (is_file("../lib/sql/group_info.php"))
include("../lib/sql/group_info.php");
$login = $saved_login;
}
}
else{
if (is_file("../lib/$config[general_lib_type]/group_info.php"))
include("../lib/$config[general_lib_type]/group_info.php");
}
if ($config[general_lib_type] == 'sql' && $config[sql_use_operators] == 'true'){
$colspan=2;
$show_ops = 1;
include("../lib/operators.php");
}
else{
$show_ops = 0;
$colspan=1;
}
 
 
echo <<<EOM
<html>
<head>
EOM;
 
if ($user_type != 'group'){
echo " <title>subscription configuration for $login ($cn)</title>\n";
$util = "usagers";}
else{
echo " <title>subscription configuration for $login</title>\n";
$util = "groupes";}
?>
 
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
<link rel="stylesheet" href="/css/style.css">
<script language="javascript" type="text/javascript">
var chars='0123456789abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ'
function password(size)
{
var pass=''
while(pass.length < size)
{
pass+=chars.charAt(Math.round(Math.random() * (chars.length)))
}
document.edituser.passwd.value=pass
document.edituser.pwdgene.value=pass
}
</script>
</head>
<body>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th>Gestion des <?php echo $util?></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 valign="middle" align="left">
<center>
<table border=0 width=550 cellpadding=0 cellspacing=0>
<tr valign=top>
<!--<td align=center><img src="images/title2.gif"></td>-->
</tr>
</table>
<table border=0 width=400 cellpadding=0 cellspacing=2>
<?php
if ($user_type != 'group')
{
include("../html/user_toolbar.html.php");
$titre="de l'usager";
}
else
{
include("../html/group_toolbar.html.php");
$titre="du groupe";
}
print <<<EOM
</table>
<br>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=75%>&nbsp;</td>
<td bgcolor="black" width=25% align=right>
<table border=0 width="200" cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=center valign=top><th>
<font color="white">Attributs $titre : $login</font>&nbsp;
</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
EOM;
if ($change == 1){
if (is_file("../lib/$config[general_lib_type]/change_attrs.php"))
include("../lib/$config[general_lib_type]/change_attrs.php");
if ($user_type != 'group'){
if ($config[general_show_user_password] != 'no' && $passwd != ''
&& is_file("../lib/$config[general_lib_type]/change_passwd.php"))
include("../lib/$config[general_lib_type]/change_passwd.php");
if (is_file("../lib/$config[general_lib_type]/user_info.php"))
include("../lib/$config[general_lib_type]/user_info.php");
if ($group_change && $config[general_lib_type] == 'sql' && $config[sql_show_all_groups] == 'true'){
include("../lib/sql/group_change.php");
include("../lib/defaults.php");
}
}
else{
if (is_file("../lib/$config[general_lib_type]/group_info.php"))
include("../lib/$config[general_lib_type]/group_info.php");
}
}
else if ($badusers == 1){
if (is_file("../lib/add_badusers.php"))
include("../lib/add_badusers.php");
}
?>
<form name="edituser" method=post>
<input type=hidden name=login value=<?php print $login ?>>
<input type=hidden name=user_type value=<?php print $user_type ?>>
<input type=hidden name=change value="0">
<input type=hidden name=add value="0">
<input type=hidden name=badusers value="0">
<input type=hidden name=group_change value="0">
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
<?php
if ($user_type != 'group' && $config[general_show_user_password] != 'no'){
echo <<<EOM
<tr>
<td align=right colspan=$colspan bgcolor="#d0ddb0">
Nouveau mot de passe<br>
EOM;
if ($user_password_exists == 'yes')
echo "<font size=-2>Le mot de passe <font color=\"green\"><b>existe</b></font></font>\n";
else
echo "<font size=-2>Le mot de passe <font color=\"red\"><b> n'existe pas</b></font></font>\n";
echo <<<EOM
</td>
<td>
<input type=password name=passwd value="" size=40>
<br /><input type="button" value="g&eacute;n&eacute;rer" onclick="password(8)">
<input type="text" value="" name="pwdgene" size=20 readonly>
</td>
</tr>
EOM;
}
foreach($show_attrs as $key => $desc){
$name = $attrmap["$key"];
$generic = $attrmap[generic]["$key"];
if ($name == 'none')
continue;
unset($vals);
unset($selected);
unset($ops);
$def_added = 0;
if ($item_vals["$key"][count]){
for($i=0;$i<$item_vals["$key"][count];$i++){
$vals[] = $item_vals["$key"][$i];
$ops[] = $item_vals["$key"][operator][$i];
}
}
else{
if ($default_vals["$key"][count]){
for($i=0;$i<$default_vals["$key"][count];$i++){
$vals[] = $default_vals["$key"][$i];
$ops[] = $default_vals["$key"][operator][$i];
}
}
else{
$vals[] = '';
$ops[] = '=';
}
$def_added = 1;
}
if ($generic == 'generic' && $def_added == 0){
for($i=0;$i<$default_vals["$key"][count];$i++){
$vals[] = $default_vals["$key"][$i];
$ops[] = $default_vals["$key"][operator][$i];
}
}
if ($add && $name == $add_attr){
$vals[] = $default_vals["$key"][0];
$ops[] = ($default_vals["$key"][operator][0] != '') ? $default_vals["$key"][operator][0] : '=';
}
 
$i = 0;
foreach($vals as $val){
$name1 = $name . $i;
$val = ereg_replace('"','&quot;',$val);
$oper_name = $name1 . '_op';
$oper = $ops[$i];
$selected[$oper] = 'selected';
$i++;
print <<<EOM
<tr>
<td align=right bgcolor="#d0ddb0">
EOM;
$desc = addslashes($desc);
eval("\$desc = \"$desc\";");
$desc = stripslashes($desc);
if ($i == 1)
echo "$desc\n";
else
echo "$desc ($i)\n";
print <<<EOM
</td>
EOM;
if ($show_ops){
switch ($key)
{
case 'Simultaneous-Use' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=";
break;
case 'Login-Time' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=";
break;
case 'Expiration' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=";
break;
case 'Session-Timeout' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=";
break;
case 'Max-Daily-Session' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=";
break;
case 'Max-Weekly-Session' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=";
break;
case 'Max-Monthly-Session' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=";
break;
default :
print <<<EOM
<td>
<select name=$oper_name>
<option $selected[$op_eq] value="=">=
<option $selected[$op_set] value=":=">:=
<option $selected[$op_add] value="+=">+=
<option $selected[$op_eq2] value="==">==
<option $selected[$op_ne] value="!=">!=
<option $selected[$op_gt] value=">">&gt;
<option $selected[$op_ge] value=">=">&gt;=
<option $selected[$op_lt] value="<">&lt;
<option $selected[$op_le] value="<=">&lt;=
<option $selected[$op_regeq] value="=~">=~
<option $selected[$op_regne] value="!~">!~
<option $selected[$op_exst] value="=*">=*
<option $selected[$op_nexst] value="!*">!*
</select>
</td>
EOM;
break;
}
}
print <<<EOM
<td>
<input type=text name="$name1" value="$val" size=40>
</td>
</tr>
EOM;
}
}
?>
<!--
<tr>
<td align=right colspan=<?php print $colspan ?> bgcolor="#d0ddb0">
Ajouter un attribut
</td>
<td>
<select name="add_attr" OnChange="this.form.add.value=1;this.form.submit()">
<?php
foreach ($show_attrs as $key => $desc){
$name = $attrmap["$key"];
print <<<EOM
<option value="$name">$desc
EOM;
}
?>
</select>
</td>
</tr>
-->
<?php
if ($user_type != 'group'){
echo <<<EOM
<tr>
<td align=right colspan=$colspan bgcolor="#d0ddb0">
Membre de $extra_text
</td>
<td>
EOM;
if (isset($member_groups)){
echo "<select size=5 name=\"edited_groups[]\" multiple OnChange=\"this.form.group_change.value=1\">";
if ($config[sql_show_all_groups] == 'true'){
foreach ($existing_groups as $group => $count){
if ($member_groups[$group] == $group)
echo "<option selected value=\"$group\">$group\n";
else
echo "<option value=\"$group\">$group\n";
}
}else{
foreach ($member_groups as $group)
echo "<option value=\"$group\">$group\n";
}
echo "</select></td></tr>";
}
else{
echo "aucun group</td></tr>";
}
}
echo "</table><br>";
echo "<input type=submit class=button value=Change OnClick=\"this.form.change.value=1\">";
//if ($user_type != 'group'){
// echo <<<EOM
//<br><br>
//<input type=submit class=button value="Add to Badusers" OnClick="this.form.badusers.value=1">
//<a href="help/badusers_help.html" target=bu_help onclick=window.open("help/badusers_help.html","bu_help","width=600,height=210,toolbar=no,scrollbars=no,resizable=yes") title="BADUSERS Help Page"><font color="blue">&lt;--Help</font></a>
//EOM;
//}
?>
</form>
</td></tr>
</table>
</tr>
</table>
</td></tr>
</TABLE>
</body>
</html>
/gestion/manager/htdocs/user_admin.php
0,0 → 1,323
<?php
require('/etc/freeradius-web/config.php');
?>
<html>
<head>
<?php
require('../lib/functions.php');
require('../lib/defaults.php');
$date = strftime('%A, %e %B %Y, %T %Z');
 
if (is_file("../lib/$config[general_lib_type]/user_info.php")){
include("../lib/$config[general_lib_type]/user_info.php");
if ($user_exists == 'no'){
echo <<<EOM
<title>Page d'information d'utilisateur</title>
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<center>
<form action="user_admin.php" method=get>
<b>User Name&nbsp;&nbsp;</b>
<input type="text" size=10 name="login" value="$login">
<b>&nbsp;&nbsp;does not exist</b><br>
<input type=submit class=button value="Show User">
</body>
</html>
EOM;
exit();
}
}
 
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
else{
echo <<<EOM
<title>Page d'information d'utilisateur</title>
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
<link rel="stylesheet" href="style.css">
</head>
<body>
<center>
<b>Could not include SQL library functions. Aborting</b>
</body>
</html>
EOM;
exit();
}
 
$monthly_limit = ($item_vals['Max-Monthly-Session'][0] != '') ? $item_vals['Max-Monthly-Session'][0] : $default_vals['Max-Monthly-Session'][0];
$monthly_limit = ($monthly_limit) ? $monthly_limit : $config[counter_default_monthly];
$weekly_limit = ($item_vals['Max-Weekly-Session'][0] != '') ? $item_vals['Max-Weekly-Session'][0] : $default_vals['Max-Weekly-Session'][0];
$weekly_limit = ($weekly_limit) ? $weekly_limit : $config[counter_default_weekly];
$daily_limit = ($item_vals['Max-Daily-Session'][0] != '') ? $item_vals['Max-Daily-Session'][0] : $default_vals['Max-Daily-Session'][0];
$daily_limit = ($daily_limit) ? $daily_limit : $config[counter_default_daily];
$session_limit = ($item_vals['Session-Timeout'][0] != '') ? $item_vals['Session-Timeout'][0] : $default_vals['Session-Timeout'][0];
$session_limit = ($session_limit) ? $session_limit : 'none';
$remaining = 'unlimited time';
$log_color = 'green';
 
$now = time();
$week = $now - 604800;
$now_str = date("$config[sql_date_format]",$now + 86400);
$week_str = date("$config[sql_date_format]",$week);
$day = date('w');
$week_start = date($config[sql_date_format],$now - ($day)*86400);
$month_start = date($config[sql_date_format],$now - date('j')*86400);
$today = $day;
$now_tmp = $now;
for ($i = $day; $i >-1; $i--){
$days[$i] = date($config[sql_date_format],$now_tmp);
$now_tmp -= 86400;
}
$day++;
//$now -= ($day * 86400);
$now -= 604800;
$now += 86400;
for ($i = $day; $i <= 6; $i++){
$days[$i] = date($config[sql_date_format],$now);
// $now -= 86400;
$now += 86400;
}
 
$daily_used = $weekly_used = $monthly_used = $lastlog_session_time = '-';
$extra_msg = '';
$used = array('-','-','-','-','-','-','-');
 
$link = @da_sql_pconnect($config);
if ($link){
$search = @da_sql_query($link,$config,
"SELECT sum(acctsessiontime) AS sum_sess_time,
sum(acctinputoctets) AS sum_in_octets,
sum(acctoutputoctets) AS sum_out_octets,
avg(acctsessiontime) AS avg_sess_time,
avg(acctinputoctets) AS avg_in_octets,
avg(acctoutputoctets) AS avg_out_octets,
COUNT(*) as counter FROM
$config[sql_accounting_table] WHERE username = '$login'
AND acctstarttime >= '$week_str' AND acctstarttime <= '$now_str';");
if ($search){
$row = @da_sql_fetch_array($search,$config);
$tot_time = time2str($row[sum_sess_time]);
$tot_input = bytes2str($row[sum_in_octets]);
$tot_output = bytes2str($row[sum_out_octets]);
$avg_time = time2str($row[avg_sess_time]);
$avg_input = bytes2str($row[avg_in_octets]);
$avg_output = bytes2str($row[avg_out_octets]);
$tot_conns = $row[counter];
}
else
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
$search = @da_sql_query($link,$config,
"SELECT sum(acctsessiontime) AS sum_sess_time FROM $config[sql_accounting_table] WHERE username = '$login'
AND acctstarttime >= '$week_start' AND acctstarttime <= '$now_str';");
if ($search){
$row = @da_sql_fetch_array($search,$config);
$weekly_used = $row[sum_sess_time];
}
else
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
if ($monthly_limit != 'none' || $config[counter_monthly_calculate_usage] == 'true'){
$search = @da_sql_query($link,$config,
"SELECT sum(acctsessiontime) AS sum_sess_time FROM $config[sql_accounting_table] WHERE username = '$login'
AND acctstarttime >= '$month_start' AND acctstarttime <= '$now_str';");
if ($search){
$row = @da_sql_fetch_array($search,$config);
$monthly_used = $row[sum_sess_time];
}
else
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
}
$search = @da_sql_query($link,$config,
"SELECT COUNT(*) AS counter FROM $config[sql_accounting_table] WHERE username = '$login'
AND acctstoptime >= '$week_str' AND acctstoptime <= '$now_str'
AND (acctterminatecause LIKE 'Login-Incorrect%' OR
acctterminatecause LIKE 'Invalid-User%' OR
acctterminatecause LIKE 'Multiple-Logins%');");
if ($search){
$row = @da_sql_fetch_array($search,$config);
$tot_badlogins = $row[counter];
}
else
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
for($i = 0; $i <=6; $i++){
if ($days[$i] == '')
continue;
$search = @da_sql_query($link,$config,
"SELECT sum(acctsessiontime) AS sum_sess_time FROM $config[sql_accounting_table] WHERE
username = '$login' AND acctstoptime >= '$days[$i] 00:00:00'
AND acctstoptime <= '$days[$i] 23:59:59';");
if ($search){
$row = @da_sql_fetch_array($search,$config);
$used[$i] = $row[sum_sess_time];
if ($daily_limit != 'none' && $used[$i] > $daily_limit)
$used[$i] = "<font color=red>" . time2str($used[$i]) . "</font>";
else
$used[$i] = time2str($used[$i]);
if ($today == $i){
$daily_used = $row[sum_sess_time];
if ($daily_limit != 'none'){
$remaining = $daily_limit - $daily_used;
if ($remaining <=0)
$remaining = 0;
$log_color = ($remaining) ? 'green' : 'red';
if (!$remaining)
$extra_msg = '(Out of daily quota)';
}
$daily_used = time2str($daily_used);
if ($daily_limit != 'none' && !$remaining)
$daily_used = "<font color=red>$daily_used</font>";
}
}
else
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
}
if ($weekly_limit != 'none'){
$tmp = $weekly_limit - $weekly_used;
if ($tmp <=0){
$tmp = 0;
$extra_msg .= '(Out of weekly quota)';
}
if (!is_numeric($remaining))
$remaining = $tmp;
if ($remaining > $tmp)
$remaining = $tmp;
$log_color = ($remaining) ? 'green' : 'red';
}
$weekly_used = time2str($weekly_used);
if ($weekly_limit != 'none' && !$tmp)
$weekly_used = "<font color=red>$weekly_used</font>";
 
if ($monthly_limit != 'none'){
$tmp = $monthly_limit - $monthly_used;
if ($tmp <=0){
$tmp = 0;
$extra_msg .= '(Out of monthly quota)';
}
if (!is_numeric($remaining))
$remaining = $tmp;
if ($remaining > $tmp)
$remaining = $tmp;
$log_color = ($remaining) ? 'green' : 'red';
}
if ($monthly_limit != 'none' || $config[counter_monthly_calculate_usage] == 'true'){
$monthly_used = time2str($monthly_used);
if ($monthly_limit != 'none' && !$tmp)
$monthly_used = "<font color=red>$monthly_used</font>";
}
if ($session_limit != 'none'){
if (!is_numeric($remaining))
$remaining = $session_limit;
if ($remaining > $session_limit)
$remaining = $session_limit;
}
 
$search = @da_sql_query($link,$config,
"SELECT " . da_sql_limit(1,0,$config) . " * FROM $config[sql_accounting_table]
WHERE username = '$login' AND acctstoptime IS NULL " . da_sql_limit(1,1,$config) . "
ORDER BY acctstarttime DESC " . da_sql_limit(1,2,$config). " ;");
if ($search){
if (@da_sql_num_rows($search,$config)){
$logged_now = 1;
$row = @da_sql_fetch_array($search,$config);
$lastlog_time = $row['acctstarttime'];
$lastlog_server_ip = $row['nasipaddress'];
$lastlog_server_port = $row['nasportid'];
$lastlog_session_time = date2timediv($lastlog_time,0);
if ($daily_limit != 'none'){
$remaining = $remaining - $lastlog_session_time;
if ($remaining < 0)
$remaining = 0;
$log_color = ($remaining) ? 'green' : 'red';
}
$lastlog_session_time_jvs = 1000 * $lastlog_session_time;
$lastlog_session_time = time2strclock($lastlog_session_time);
$lastlog_client_ip = $row['framedipaddress'];
$lastlog_server_name = @gethostbyaddr($lastlog_server_ip);
$lastlog_client_name = @gethostbyaddr($lastlog_client_ip);
$lastlog_callerid = $row['callingstationid'];
if ($lastlog_callerid == '')
$lastlog_callerid = 'not available';
$lastlog_input = $row['acctinputoctets'];
if ($lastlog_input)
$lastlog_input = bytes2str($lastlog_input);
else
$lastlog_input = 'not available';
$lastlog_output = $row['acctoutputoctets'];
if ($lastlog_output)
$lastlog_output = bytes2str($lastlog_output);
else
$lastlog_output = 'not available';
}
}
else
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
if (! $logged_now){
$search = @da_sql_query($link,$config,
"SELECT " . da_sql_limit(1,0,$config) . " * FROM $config[sql_accounting_table]
WHERE username = '$login' AND acctsessiontime != '0' " . da_sql_limit(1,1,$config) . "
ORDER BY acctstoptime DESC " . da_sql_limit(1,2,$config). " ;");
if ($search){
if (@da_sql_num_rows($search,$config)){
$row = @da_sql_fetch_array($search,$config);
$lastlog_time = $row['acctstarttime'];
$lastlog_server_ip = $row['nasipaddress'];
$lastlog_server_port = $row['nasportid'];
$lastlog_session_time = time2str($row['acctsessiontime']);
$lastlog_client_ip = $row['framedipaddress'];
$lastlog_server_name = ($lastlog_server_ip != '') ? @gethostbyaddr($lastlog_server_ip) : '-';
$lastlog_client_name = ($lastlog_client_ip != '') ? @gethostbyaddr($lastlog_client_ip) : '-';
$lastlog_callerid = $row['callingstationid'];
if ($lastlog_callerid == '')
$lastlog_callerid = 'not available';
$lastlog_input = $row['acctinputoctets'];
$lastlog_input = bytes2str($lastlog_input);
$lastlog_output = $row['acctoutputoctets'];
$lastlog_output = bytes2str($lastlog_output);
}
else
$not_known = 1;
}
else
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
}
}
else
echo "<b>Could not connect to SQL database</b><br>\n";
 
$monthly_limit = (is_numeric($monthly_limit)) ? time2str($monthly_limit) : $monthly_limit;
$weekly_limit = (is_numeric($weekly_limit)) ? time2str($weekly_limit) : $weekly_limit;
$daily_limit = (is_numeric($daily_limit)) ? time2str($daily_limit) : $daily_limit;
$session_limit = (is_numeric($session_limit)) ? time2str($session_limit) : $session_limit;
$remaining = (is_numeric($remaining)) ? time2str($remaining) : $remaining;
 
if ($item_vals['Dialup-Access'][0] == 'FALSE' || (!isset($item_vals['Dialup-Access'][0]) && $attrmap['Dialup-Access'] != '' && $attrmap['Dialup-Access'] != 'none'))
$msg =<<<EON
<font color=red><b> Le compte de l'utilisateur est verrouill&eacute; </b></font>
EON;
else
$msg =<<<EON
L'utilisateur peut s'identifier pendant <font color="$log_color"> <b>$remaining $extra_msg</font>
EON;
$lock_msg = $item_vals['Dialup-Lock-Msg'][0];
if ($lock_msg != '')
$descr =<<<EON
<font color=red><b>$lock_msg </b</font>
EON;
else
$descr = '-';
 
$expiration = $default_vals['Expiration'][0];
if ($item_vals['Expiration'][0] != '')
$expiration = $item_vals['Expiration'][0];
if ($expiration != ''){
$expiration = strtotime($expiration);
if ($expiration != -1 && $expiration < time())
$descr = <<<EOM
<font color=red><b>Le compte de l'utilisateur a expir&eacute</b></font>
EOM;
}
 
require('../html/user_admin.html.php');
?>
/gestion/manager/htdocs/user_new.php
0,0 → 1,288
<?php
# Choice of language
$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 = "Cr&eacute;ation d'un usager";
$l_frame_top = "Gestion des usagers";
$l_frame = "Cr&eacute;ation d'un usager";
$l_user_exist = "existe d&eacute;j&agrave;";
$l_login = "Identifiant";
$l_password = "Mot de passe";
$l_passwd_gen = "g&eacute;n&eacute;rer";
$l_group = "Groupe";
$l_group_empty = "La liste des groupes est vide";
$l_name = "Nom et pr&eacute;nom";
$l_email = "Adresse de couriel";
}
else {
$l_title = "Create a user";
$l_frame_top = "Users admin";
$l_frame = "Create a user";
$l_user_exist = "already exist";
$l_login = "Login";
$l_password = "Password";
$l_passwd_gen = "generate";
$l_group = "Group";
$l_group_empty = "The group list is empty";
$l_name = "Surname and name";
$l_email = "Email Address";
}
 
 
require('/etc/freeradius-web/config.php');
if ($show == 1){
header("Location: user_admin.php?login=$login");
exit;
}
require('../lib/attrshow.php');
require('../lib/defaults.php');
 
if ($config[general_lib_type] == 'sql' && $config[sql_use_operators] == 'true'){
$colspan=2;
$show_ops=1;
}else{
$show_ops = 0;
$colspan=1;
}
echo "<html><head><title>$l_title</title>";
?>
 
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
<link rel="stylesheet" href="/css/style.css">
<script language="javascript" type="text/javascript">
var chars='0123456789abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ'
function password(size)
{
var pass=''
while(pass.length < size)
{
pass+=chars.charAt(Math.round(Math.random() * (chars.length)))
}
document.form1.passwd.value=pass
document.form1.pwdgene.value=pass
}
</script>
</head>
<body>
 
<?php
include("password_generator.jsc");
echo "<TABLE width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<tr><th>$l_frame_top</th></tr>";
?>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
height="2"></td></tr>
</TABLE>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
<tr bgcolor="#666666"><td>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
<tr><td valign="middle" align="left">
<center>
<table border=0 width=550 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=200>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th>
<font color="white"><? echo "$l_frame"; ?></font>
</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<?php
if ($create == 1){
if (is_file("../lib/$config[general_lib_type]/user_info.php"))
include("../lib/$config[general_lib_type]/user_info.php");
if ($user_exists != "no"){
echo <<<EOM
<b><i>$login</i> $l_user_exist</b>
EOM;
}
else{
if (is_file("../lib/$config[general_lib_type]/create_user.php"))
include("../lib/$config[general_lib_type]/create_user.php");
require("../lib/defaults.php");
if (is_file("../lib/$config[general_lib_type]/user_info.php"))
include("../lib/$config[general_lib_type]/user_info.php");
}
}
?>
<form name="form1" method=post>
<input type=hidden name=create value="0">
<input type=hidden name=show value="0">
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
<?php
echo <<<EOM
<tr>
<td align=right colspan=$colspan bgcolor="#d0ddb0">
$l_login
</td><td>
<input type=text name="login" value="$login" size=35>
</td>
</tr>
<tr>
<td align=right colspan=$colspan bgcolor="#d0ddb0">
$l_password
</td><td>
<input type=password name="passwd" size=35>
<br /><input type="button" value="$l_passwd_gen" onclick="password(8)">
<input type="text" value="" name="pwdgene" size=20 readonly>
</td>
</tr>
EOM;
if ($config[general_lib_type] == 'sql'){
if (isset($member_groups))
$selected[$member_groups[0]] = 'selected';
echo <<<EOM
<tr>
<td align=right colspan=$colspan bgcolor="#d0ddb0">
$l_group
</td><td>
EOM;
include_once("../lib/$config[general_lib_type]/group_info.php");
if (isset($existing_groups)){
echo " <select name=\"Fgroup\">";
foreach ($member_groups as $group)
echo "<option value=\"$group\" $selected[$group]>$group\n";
echo " </select>";
}
else echo "$l_group_empty";
echo "</td></tr>";
}
if ($config[general_lib_type] == 'ldap' ||
($config[general_lib_type] == 'sql' && $config[sql_use_user_info_table] == 'true')){
echo <<<EOM
<tr>
<td align=right colspan=$colspan bgcolor="#d0ddb0">
$l_name
</td><td>
<input type=text name="Fcn" value="$cn" size=35>
</td>
</tr>
<tr>
<td align=right colspan=$colspan bgcolor="#d0ddb0">
$l_email
</td><td>
<input type=text name="Fmail" value="$mail" size=35>
</td>
</tr>
<tr>
<td align=right colspan=$colspan bgcolor="#d0ddb0">
Service
</td><td>
<input type=text name="Fou" value="$ou" size=35>
</td>
</tr>
<tr>
<td align=right colspan=$colspan bgcolor="#d0ddb0">
Nro TPH personnel
</td><td>
<input type=text name="Fhomephone" value="$homephone" size=35>
</td>
</tr>
<tr>
<td align=right colspan=$colspan bgcolor="#d0ddb0">
Nro TPH bureau
</td><td>
<input type=text name="Ftelephonenumber" value="$telephonenumber" size=35>
</td>
</tr>
<tr>
<td align=right colspan=$colspan bgcolor="#d0ddb0">
Nro TPH mobile
</td><td>
<input type=text name="Fmobile" value="$mobile" size=35>
</td>
</tr>
EOM;
}
foreach($show_attrs as $key => $desc){
$name = $attrmap["$key"];
if ($name == 'none')
continue;
$oper_name = $name . '_op';
$val = ($item_vals["$key"][0] != "") ? $item_vals["$key"][0] : $default_vals["$key"][0];
print <<<EOM
<tr>
<td align=right bgcolor="#d0ddb0">
$desc
</td>
EOM;
 
if ($show_ops){
switch ($key)
{
case 'Simultaneous-Use' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=";
break;
case 'Login-Time' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=";
break;
case 'Expiration' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=";
break;
case 'Session-Timeout' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=";
break;
case 'Max-Daily-Session' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=";
break;
case 'Max-Weekly-Session' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=";
break;
case 'Max-Monthly-Session' :
echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=";
break;
default :
print <<<EOM
<td>
<select name=$oper_name>
<option $selected[$op_eq] value="=">=
<option $selected[$op_set] value=":=">:=
<option $selected[$op_add] value="+=">+=
<option $selected[$op_eq2] value="==">==
<option $selected[$op_ne] value="!=">!=
<option $selected[$op_gt] value=">">&gt;
<option $selected[$op_ge] value=">=">&gt;=
<option $selected[$op_lt] value="<">&lt;
<option $selected[$op_le] value="<=">&lt;=
<option $selected[$op_regeq] value="=~">=~
<option $selected[$op_regne] value="!~">!~
<option $selected[$op_exst] value="=*">=*
<option $selected[$op_nexst] value="!*">!*
</select>
</td>
EOM;
break;
}
}
print <<<EOM
<td>
<input type=text name="$name" value="$val" size=35>
</td>
</tr>
EOM;
}
echo "</table><BR>";
if ($create == 1)
echo "<input type=submit class=button value=\"Afficher le profil de l'utilisateur\" OnClick=\"this.form.show.value=1\">";
else{
echo "<input type=submit class=button value=\"Cr&eacute;er\" OnClick=\"this.form.create.value=1\">";}
?>
</form>
</td></tr>
</table>
</tr>
</table>
</TD></TR>
</TABLE>
</td></tr>
</TABLE>
</body>
</html>
/gestion/manager/htdocs/user_accounting.php
0,0 → 1,249
<?php
require('/etc/freeradius-web/config.php');
?>
<html>
<?php
require('../lib/functions.php');
require('../lib/sql/functions.php');
require('../lib/attrshow.php');
 
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
else{
echo <<<EOM
<title>Analyse pour $login</title>
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
<link rel="stylesheet" href="style.css">
</head>
<body>
<center>
<b>Could not include SQL library functions. Aborting</b>
</body>
</html>
EOM;
exit();
}
 
$now = time();
$now_str = ($now_str != '') ? "$now_str" : date($config[sql_date_format],$now + 86400);
$prev_str = ($prev_str != '') ? "$prev_str" : date($config[sql_date_format], $now - 604800 );
$num = 0;
$pagesize = ($pagesize) ? $pagesize : 10;
if (!is_numeric($pagesize) && $pagesize != 'all')
$pagesize = 10;
$limit = ($pagesize == 'all') ? '' : "$pagesize";
$selected[$pagesize] = 'selected';
$order = ($order != '') ? $order : $config[general_accounting_info_order];
if ($order != 'desc' && $order != 'asc')
$order = 'desc';
$selected[$order] = 'selected';
$now_str = da_sql_escape_string($now_str);
$prev_str = da_sql_escape_string($prev_str);
 
unset($da_name_cache);
if (isset($_SESSION['da_name_cache']))
$da_name_cache = $_SESSION['da_name_cache'];
 
 
echo <<<EOM
<head>
<title>Analyse pour $login</title>
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th>Statistique des connexions</th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
height="2"></td></tr>
</TABLE>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
<tr bgcolor="#666666"><td>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
<tr><td valign="middle" align="left">
<center>
<table border=0 width=550 cellpadding=0 cellspacing=0>
<tr valign=top>
<!--<td align=center><img src="images/title2.gif"></td>-->
</tr>
</table>
<table border=0 width=400 cellpadding=0 cellspacing=2>
EOM;
 
include("../html/user_toolbar.html.php");
 
print <<<EOM
</table>
<br>
<table border=0 width=840 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=65%></td>
<td bgcolor="black" width=35%>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th>
<font color="white">Analyse pour $login</font>&nbsp;
</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
Dates du <b>$prev_str</b> au <b>$now_str</b>
EOM;
?>
 
<p>
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
<tr bgcolor="#d0ddb0">
<th>#</th>
<?php
for($i=1;$i<=9;$i++){
if ($acct_attrs['ua']["$i"] != '')
echo "<th>" . $acct_attrs['ua']["$i"] . "</th>\n";
}
$sql_extra_query = '';
if ($config[sql_accounting_extra_query] != '')
$sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config);
?>
</tr>
 
<?php
$link = @da_sql_pconnect($config);
if ($link){
$search = @da_sql_query($link,$config,
"SELECT " . da_sql_limit($limit,0,$config) . " * FROM $config[sql_accounting_table]
WHERE username = '$login' AND acctstarttime <= '$now_str'
AND acctstarttime >= '$prev_str' $sql_extra_query " . da_sql_limit($limit,1,$config) .
" ORDER BY acctstarttime $order " . da_sql_limit($limit,2,$config). " ;");
if ($search){
while( $row = @da_sql_fetch_array($search,$config) ){
$tr_color='white';
$num++;
$acct_type = "$row[framedprotocol]/$row[nasporttype]";
if ($acct_type == '')
$acct_type = '-';
$acct_logedin = $row[acctstarttime];
$acct_sessiontime = $row[acctsessiontime];
$acct_sessiontime_sum += $acct_sessiontime;
$acct_sessiontime = time2str($acct_sessiontime);
$acct_ip = $row[framedipaddress];
if ($acct_ip == '')
$acct_ip = '-';
$acct_upload = $row[acctinputoctets];
$acct_upload_sum += $acct_upload;
$acct_upload = bytes2str($acct_upload);
$acct_download = $row[acctoutputoctets];
$acct_download_sum += $acct_download;
$acct_download = bytes2str($acct_download);
$acct_server = $row[nasipaddress];
if ($acct_server != ''){
$acct_server = $da_name_cache[$row[nasipaddress]];
if (!isset($acct_server)){
$acct_server = @gethostbyaddr($row[nasipaddress]);
if (!isset($da_name_cache) && $config[general_use_session] == 'yes'){
$da_name_cache[$row[nasipaddress]] = $acct_server;
session_register('da_name_cache');
}
else
$da_name_cache[$row[nasipaddress]] = $acct_server;
}
}
else
$acct_server = '-';
$acct_server = "$acct_server:$row[nasportid]";
$acct_terminate_cause = "$row[acctterminatecause]";
if ($acct_terminate_cause == '')
$acct_terminate_cause = '-';
if (ereg('Login-Incorrect',$acct_terminate_cause) ||
ereg('Multiple-Logins', $acct_terminate_cause) || ereg('Invalid-User',$acct_terminate_cause))
$tr_color='#ffe8e0';
$acct_callerid = "$row[callingstationid]";
if ($acct_callerid == '')
$acct_callerid = '-';
echo <<<EOM
<tr align=center bgcolor="$tr_color">
<td>$num</td>
EOM;
if ($acct_attrs[ua][1] != '') echo "<td>$acct_type</td>\n";
if ($acct_attrs[ua][2] != '') echo "<td>$acct_logedin</td>\n";
if ($acct_attrs[ua][3] != '') echo "<td>$acct_sessiontime</td>\n";
if ($acct_attrs[ua][4] != '') echo "<td>$acct_ip</td>\n";
if ($acct_attrs[ua][5] != '') echo "<td>$acct_upload</td>\n";
if ($acct_attrs[ua][6] != '') echo "<td>$acct_download</td>\n";
if ($acct_attrs[ua][7] != '') echo "<td>$acct_server</td>\n";
if ($acct_attrs[ua][8] != '') echo "<td>$acct_terminate_cause</td>\n";
if ($acct_attrs[ua][9] != '') echo "<td>$acct_callerid</td>\n";
echo "</tr>\n";
}
$acct_sessiontime_sum = time2str($acct_sessiontime_sum);
$acct_upload_sum = bytes2str($acct_upload_sum);
$acct_download_sum = bytes2str($acct_download_sum);
}
else
echo "<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
}
else
echo "<b>Could not connect to SQL database</b><br>\n";
$colspan = 3;
if ($acct_attrs[ua][1] == '')
$colspan--;
if ($acct_attrs[ua][2] == '')
$colspan--;
echo <<<EOM
<tr bgcolor="lightyellow">
<td colspan=$colspan align="right">Total pages</td>
EOM;
if ($acct_attrs[ua][3] != '') echo "<td align=\"center\"><b>$acct_sessiontime_sum</td>\n";
if ($acct_attrs[ua][4] != '') echo "<td>&nbsp;</td>\n";
if ($acct_attrs[ua][5] != '') echo "<td align=\"right\" nowrap><b>$acct_upload_sum</td>\n";
if ($acct_attrs[ua][6] != '') echo "<td align=\"right\" nowrap><b>$acct_download_sum</td>\n";
if ($acct_attrs[ua][7] != '') echo "<td>&nbsp;</td>\n";
if ($acct_attrs[ua][8] != '') echo "<td>&nbsp;</td>\n";
if ($acct_attrs[ua][9] != '') echo "<td>&nbsp;</td>\n";
?>
</tr>
</table>
<tr><td>
<hr>
<tr><td align="center">
<form action="user_accounting.php" method="get" name="master">
<table border=0>
<tr><td colspan=6></td>
</tr>
<tr valign="bottom">
<td><small><b>Utilisateur</td><td><small><b>d&eacute;but date</td><td><small><b>fin date</td><td><small><b>nbr./page</td><td><b>class&eacute; le</td>
<tr valign="middle"><td>
<?php
echo <<<EOM
<input type="text" name="login" size="11" value="$login"></td>
<td><input type="text" name="prev_str" size="11" value="$prev_str"></td>
<td><input type="text" name="now_str" size="11" value="$now_str"></td>
<td><select name="pagesize">
<option $selected[5] value="5" >05
<option $selected[10] value="10">10
<option $selected[15] value="15">15
<option $selected[20] value="20">20
<option $selected[40] value="40">40
<option $selected[80] value="80">80
<option $selected[all] value="all">tous
</select>
</td>
<td><select name="order">
<option $selected[asc] value="asc">plus ancien en premier
<option $selected[desc] value="desc">plus r&eacute;cent en premier
</select>
</td>
EOM;
?>
 
<td><input type="submit" class=button value="show"></td></tr>
</table></td></tr></form>
</table>
</tr>
</table>
</TD></TR>
</TABLE>
</td></tr>
</TABLE>
</body>
</html>
/gestion/manager/html/user_admin.html.php
0,0 → 1,432
<?php
 
echo <<<EOM
<title>Informations de l'utilisateur $cn</title>
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
</head>
<body>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><th>Gestion des usagers</th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
height="2"></td></tr>
</TABLE>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
<tr bgcolor="#666666"><td>
<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
<tr><td valign="middle" align="left">
<link rel="stylesheet" href="/css/style.css">
EOM;
if ($logged_now)
print <<<EOM
<script Language="JavaScript">
<!--
var start;
var our_time;
function startcounter()
{
var start_date = new Date();
start = start_date.getTime();
our_time = $lastlog_session_time_jvs;
showcounter();
}
 
function showcounter ()
{
var now_date = new Date();
var diff = now_date.getTime() - start + our_time;
var hours = parseInt(diff / 3600000);
if(isNaN(hours)) hours = 0;
var minutes = parseInt((diff % 3600000) / 60000);
if(isNaN(minutes)) minutes = 0;
var seconds = parseInt(((diff % 3600000) % 60000) / 1000);
if(isNaN(seconds)) seconds = 0;
var timeValue = " " ;
timeValue += ((hours < 10) ? "0" : "") + hours;
timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
document.online.status.value = timeValue;
setTimeout("showcounter()", 1000);
}
//-->
</script>
EOM;
 
print <<<EOM
<center>
<table border=0 width=550 cellpadding=0 cellspacing=0>
<tr valign=top>
<!--<td align=center><img src="images/title2.gif"></td>-->
</tr>
</table>
<table border=0 width=400 cellpadding=0 cellspacing=2>
EOM;
 
include("../html/user_toolbar.html.php");
 
print <<<EOM
</table>
<br>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=250>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th>
<font color="white">Etat des connexions pour $login ($cn)</font>&nbsp;
</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
 
EOM;
if ($logged_now){
print <<<EOM
<form name="online" onSubmit="return(false);">
<tr><td align=center bgcolor="#d0ddb0">
L'utilisateur est <b>en ligne</b> depuis
</td><td>
$lastlog_time
</td></tr>
<tr><td align=center bgcolor="#d0ddb0">
Dur&eacute;e des connexions
</td><td>
<input type="text" name="status" size=10 value="$lastlog_session_time">
</form>
</td></tr>
EOM;
require('../html/user_admin_userinfo.html.php');
 
}else if ($not_known) print <<<EOM
<tr><td align=center bgcolor="#d0ddb0">
Cet utilisateur ne s'est <b>jamais</b> connect&eacute;
</td><td>-
</td></tr>
EOM;
else{
print <<<EOM
<tr><td align=center bgcolor="#d0ddb0">
L'utilisateur <b>n'est pas connect&eacute;</b> actuellement<br>
</td><td>-
</td></tr>
<tr><td align=center bgcolor="#d0ddb0">
Derni&egrave;re connexion
</td><td>
$lastlog_time
</td></tr>
<tr><td align=center bgcolor="#d0ddb0">
Dur&eacute;e de la connexion
</td><td>
$lastlog_session_time
</td></tr>
EOM;
require('../html/user_admin_userinfo.html.php');
}
 
print <<<EOM
<tr><td align=center bgcolor="#d0ddb0">
Sessions autoris&eacute;es
</td><td>
$msg
</td></tr>
<tr><td align=center bgcolor="#d0ddb0">
Description compl&egrave;te de l'utilisateur
</td><td>
$descr
</td></tr>
</table>
</table>
</table>
 
EOM;
 
if (is_file("../lib/$config[general_lib_type]/password_check.php"))
include("../lib/$config[general_lib_type]/password_check.php");
 
echo <<<EOM
<br>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=250>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th>
<font color="white">Analyse</font>&nbsp;
</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
<tr><td align=center bgcolor="#d0ddb0">-</td><td align=center bgcolor="#d0ddb0"><b>mensuel</b></td><td align=center bgcolor="#d0ddb0"><b>hebdomadaire</b></td><td align=center bgcolor="#d0ddb0"><b>journalier</b></td><td align=center bgcolor="#d0ddb0"><b>par session</b></td></tr>
<tr><td align=center bgcolor="#d0ddb0"><b>limite</b></td><td>$monthly_limit</td><td>$weekly_limit</td><td>$daily_limit</td><td>$session_limit</td></tr>
<tr><td align=center bgcolor="#d0ddb0"><b>dur&eacute;e utilis&eacute;e</b></td><td>$monthly_used</td><td>$weekly_used</td><td>$daily_used</td><td>$lastlog_session_time</td></tr>
</table>
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" va
lign=top>
<tr><td align=center bgcolor="#d0ddb0"><b>Jour</b></td><td align=center bgcolor="#d0ddb0"><b>limite journali&egrave;re</b></td><td align=center bgcolor="#d0ddb0"><b>dur&eacute;e utilis&eacute;e</b></td><tr>
<tr><td align=center bgcolor="#d0ddb0">dimanche</td><td>$daily_limit</td><td>$used[0]</td></tr>
<tr><td align=center bgcolor="#d0ddb0">lundi</td><td>$daily_limit</td><td>$used[1]</td></tr>
<tr><td align=center bgcolor="#d0ddb0">mardi</td><td>$daily_limit</td><td>$used[2]</td></tr>
<tr><td align=center bgcolor="#d0ddb0">mercredi</td><td>$daily_limit</td><td>$used[3]</td></tr>
<tr><td align=center bgcolor="#d0ddb0">jeudi</td><td>$daily_limit</td><td>$used[4]</td></tr>
<tr><td align=center bgcolor="#d0ddb0">vendredi</td><td>$daily_limit</td><td>$used[5]</td></tr>
<tr><td align=center bgcolor="#d0ddb0">samedi</td><td>$daily_limit</td><td>$used[6]</td></tr>
</table></table>
</table>
<br>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=200>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th>
<font color="white">&Eacute;tat sur les 7 derniers jours</font>&nbsp;
</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
<tr><td align=center bgcolor="#d0ddb0">Nombre de connexions</td><td>
<b><font color="darkblue">$tot_conns</font></b></td></tr>
<tr><td align=center bgcolor="#d0ddb0">Dur&eacute;e cumul&eacute;e des connexions</td><td>
<b><font color="darkblue">$tot_time</td></tr></td></tr>
<tr><td align=center bgcolor="#d0ddb0">Identifications d&eacute;fectueuses</td><td>
<b><font color="darkblue">$tot_badlogins</td></tr></td></tr>
<tr><td align=center bgcolor="#d0ddb0">Upload</td><td>
$tot_input</td></tr></td></tr>
<tr><td align=center bgcolor="#d0ddb0">Download</td><td>
$tot_output</td></tr></td></tr>
<tr><td align=center bgcolor="#d0ddb0">Dur&eacute; moyenne</td><td>
$avg_time</td></tr></td></tr>
<tr><td align=center bgcolor="#d0ddb0">Upload moyen</td><td>
$avg_input</td></tr></td></tr>
<tr><td align=center bgcolor="#d0ddb0">Download moyen</td><td>
$avg_output</td></tr></td></tr>
</table>
</table>
</table>
<br>
EOM;
 
if ($user_info){
echo <<<EOM
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor="black" width=250>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th>
<font color="white">Informations personnelles</font>
</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
<tr>
<td align=center bgcolor="#d0ddb0">
<b>nom</b>
</td>
<td>
$cn
</td>
</tr>
EOM;
if ($config[general_prefered_lang] != 'en'){
echo <<<EOM
<tr>
<td align=center bgcolor="#d0ddb0">
<b>nom ($config[general_prefered_lang_name])</b>
</td>
<td>
$cn_lang
</td>
</tr>
EOM;
}
echo <<<EOM
<tr>
<td align=center bgcolor="#d0ddb0">
<b>service</b>
</td>
<td>
$ou
</td>
</tr>
EOM;
if ($config[general_prefered_lang] != 'en'){
echo <<<EOM
<tr>
<td align=center bgcolor="#d0ddb0">
<b>service ($config[general_prefered_lang_name])</b>
</td>
<td>
$ou_lang
</td>
</tr>
EOM;
}
echo <<<EOM
<tr>
<td align=center bgcolor="#d0ddb0">
<b>titre</b>
</td>
<td>
$title
</td>
</tr>
EOM;
if ($config[general_prefered_lang] != 'en'){
echo <<<EOM
<tr>
<td align=center bgcolor="#d0ddb0">
<b>title ($config[general_prefered_lang_name])</b>
</td>
<td>
$title_lang
</td>
</tr>
EOM;
}
echo <<<EOM
<tr>
<td align=center bgcolor="#d0ddb0">
<b>adresse</b>
</td>
<td>
$address
</td>
</tr>
EOM;
if ($config[general_prefered_lang] != 'en'){
echo <<<EOM
<tr>
<td align=center bgcolor="#d0ddb0">
<b>adresse ($config[general_prefered_lang_name])</b>
</td>
<td>
$address_lang
</td>
</tr>
EOM;
}
echo <<<EOM
<tr>
<td align=center bgcolor="#d0ddb0">
<b>adresse personnelle</b>
</td>
<td>
$homeaddress
</td>
</tr>
EOM;
if ($config[general_prefered_lang] != 'en'){
echo <<<EOM
<tr>
<td align=center bgcolor="#d0ddb0">
<b>adresse personnelle ($config[general_prefered_lang_name])</b>
</td>
<td>
$homeaddress_lang
</td>
</tr>
EOM;
}
echo <<<EOM
<tr>
<td align=center bgcolor="#d0ddb0">
<b>t&eacute;l&eacute;phone</b>
</td>
<td>
$telephonenumber
</td>
</tr>
<tr>
<td align=center bgcolor="#d0ddb0">
<b>t&eacute;l&eacute;phone personnel</b>
</td>
<td>
$homephone
</td>
</tr>
<tr>
<td align=center bgcolor="#d0ddb0">
<b>mobile</b>
</td>
<td>
$mobile
</td>
</tr>
<tr>
<td align=center bgcolor="#d0ddb0">
<b>fax</b>
</td>
<td>
$fax
</td>
</tr>
<tr>
<td align=center bgcolor="#d0ddb0">
<b>home page</b>
</td>
<td>
<a href="$url" target=userpage onclick=window.open("$url","userpage","width=1000,height=550,toolbar=no,scrollbars=yes,resizable=yes") title="Aller à&agrave; la page d'accueil de l'utilisateur">$url</a>
</td>
</tr>
<tr>
<td align=center bgcolor="#d0ddb0">
<b>e-mail</b>
</td>
<td>
<a href="mailto: $mail" title="Envoyer un email">$mail</a>
</td>
</tr>
<tr>
<td align=center bgcolor="#d0ddb0">
<b>e-mail alias</b>
</td>
<td>
<a href="mailto: $mailalt" title="Envoyer un email">$mailalt</a>
</td>
</tr>
</table>
</table>
</table>
 
EOM;
}
?>
<tr> <td colspan=3 height=1></td></tr>
<tr> <td colspan=3>
</table>
<?php
if ($logged_now)
print <<<EOM
<script Language="JavaScript">
startcounter();
</script>
EOM;
?>
</TD></TR>
</TABLE>
</td></tr>
</TABLE>
 
</body>
</html>
/gestion/manager/html/stats.html.php
0,0 → 1,270
<form action="stats.php" method="get">
<table border=0 width=600 cellpadding=2 cellspacing=0>
<tr>
<td align=left>
<table border=0 cellspacing=0 cellpadding=2>
<tr valign=bottom>
<td><small><b>De </td>
<td><small><b>&agrave; </td>
<td><small><b>usager</td>
<td><small><b>sur le serveur</td>
<td>&nbsp;</td>
</tr>
<tr background="images/greenlines1.gif" valign=middle>
<?php
echo <<<EOM
<td valign=middle><input type="text" name="after" size="12" value="$after" ></td>
<td valign=middle><input type="text" name="before" size="12" value="$before"></td>
<td valign=middle><input type="text" name="login" size="12" value="$login" ></td>
<td valign=middle><select name="server" size=1>
EOM;
foreach($servers as $key => $val)
echo <<<EOM
<option value="$val">$key
EOM;
?>
</select></td>
<td valign=middle><input type="submit" class=button value="Go"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><hr size=1 noshade></td>
</tr>
<tr>
<td valign=top>
<table border=0 width="100%">
<tr> <td align=center valign=top width="45%">
<small>
<font color="darkblue"><b><?php echo $date ?></b></font>
</td>
<td align=center valign=top width="10%">&nbsp;</td>
<td align=center valign=top width="45%"><small>
P&eacute;riode observ&eacute;e :<br>
<?php
echo <<<EOM
<b>$after</b> &agrave; <b>$before</b>
EOM;
?>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align=center><h1><b>Statistiques d'utilisation journali&egrave;re</td>
</tr>
<tr>
<td valign=top>
<table border=0 width="100%">
<tr>
<td colspan=2>
<center>
Statistiques pour
<?php
if ($login == '')
echo <<<EOM
<b><font color="darkblue">tous</font></b> les usagers
EOM;
else
echo <<<EOM
l'usager <b><font color="darkblue">$login</font></b>
EOM;
?>
</td>
</tr>
</table>
</td>
</tr>
 
<tr>
<td>
<table border=0 cellpadding=0 cellspacing=0 width="100%">
<tr> <td colspan=2><hr size=1 noshade>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center">
<table border=0 cellpadding=0 cellspacing=1 width="100%">
<?php
echo <<<EOM
<tr>
<td>Champs affich&eacute;s :</td><td colspan=10 align=center nowrap><select name="column1">
<option $selected1[sessions] value="sessions">Nbre de sessions
<option $selected1[usage] value="usage">Temps d'utilisation total
<option value="upload">------------------
<option $selected1[upload] value="upload">uploads
<option $selected1[download] value="download">downloads
</select> <select name="column2">
<option $selected2[sessions] value="sessions">Nbre de sessions
<option $selected2[usage] value="usage">Temps d'utilisation total
<option value="upload">------------------
<option $selected2[upload] value="upload">uploads
<option $selected2[download] value="download">downloads
</select> <select name="column3">
<option $selected3[sessions] value="sessions">Nbre de sessions
<option $selected3[usage] value="usage">Temps d'utilisation total
<option value="upload">------------------
<option $selected3[upload] value="upload">uploads
<option $selected3[download] value="download">downloads
EOM;
?>
</select>
</td>
</tr>
<tr>
<td colspan=10 background="images/greenlines1.gif" align=center valign=middle>
<table border=0 width="100%">
<tr>
<td width=50% align=left>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td align=right><input type="submit" class=button value="Rafra&icirc;chir"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<tr>
<td colspan=10 height=20><img src="images/pixel.gif"></td>
</tr>
<tr>
<td colspan=10 height=20 align=center>
<table border=0 width=640 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=440></td>
<td bgcolor="black" width=200>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th>
<font color="white">Analyse journali&egrave;re</font>&nbsp;
</th></tr>
</table>
</td></tr>
<tr valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<p>
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
<tr bgcolor="#d0ddb0">
<th>date</th>
<?php
echo <<<EOM
<th colspan=3>$message[$column1]</th>
<th colspan=3>$message[$column2]</th>
<th colspan=3>$message[$column3]</th>
EOM;
?>
</tr>
<?php
for($i = 0; $i <= $num_days; $i++){
$day = $days[$i];
$trcolor = ($i % 2) ? "#f7f7e4" : "#efefe4";
echo <<<EOM
<tr align=center bgcolor="$trcolor">
<td>$day</td>
<td>{$data[$day][1]}</td>
<td>{$perc[$day][1]}</td>
<td align=left height=14>
<table border=0 cellpadding=0>
<tr>
<td bgcolor="{$color[$day][1]}" width={$width[$day][1]}><img border=0 height=14 width={$width[$day][1]} src="images/pixel.gif" alt="the $message[$column1] for $day is {$data[$day][1]}"></td>
</tr>
</table>
</td>
<td>{$data[$day][2]}</td>
<td>{$perc[$day][2]}</td>
<td align=left height=14>
<table border=0 cellpadding=0>
<tr>
<td bgcolor="{$color[$day][2]}" width={$width[$day][2]}><img border=0 height=14 width={$width[$day][2]} src="images/pixel.gif" alt="the $message[$column3] for $day is {$data[$day][2]}"></td>
</tr>
</table>
</td>
<td>{$data[$day][3]}</td>
<td>{$perc[$day][3]}</td>
<td align=left height=14>
<table border=0 cellpadding=0>
<tr>
<td bgcolor="{$color[$day][3]}" width={$width[$day][3]}><img border=0 height=14 width={$width[$day][3]} src="images/pixel.gif" alt="the $message[$column3] for $day is {$data[$day][3]}"></td>
</tr>
</table>
</td>
</tr>
EOM;
}
?>
</table>
</td></tr>
</table>
</td></tr>
</table>
</td></tr>
</table>
<p>
<table border=0 width=640 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=440></td>
<td bgcolor="black" width=200>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor="#907030" align=right valign=top><th>
<font color="white">R&eacute;capitulatif journalier</font>&nbsp;
</th></tr>
</table>
</td></tr>
<tr bgcolor="black" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
<tr><td>
<p>
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ff
ffe0" valign=top>
<tr bgcolor="#d0ddb0">
<th>&nbsp;</th>
<?php
echo <<<EOM
<th>$message[$column1]</th>
<th>$message[$column2]</th>
<th>$message[$column3]</th>
EOM;
?>
</tr>
<?php
echo <<<EOM
<tr align=center bgcolor="#efefe4">
<td>maximum</td>
<td>{$data[max][1]}</td>
<td>{$data[max][2]}</td>
<td>{$data[max][3]}</td>
</tr>
<tr align=center bgcolor="#f7f7e4">
<td>moyenne</td>
<td>{$data[avg][1]}</td>
<td>{$data[avg][2]}</td>
<td>{$data[avg][3]}</td>
</tr>
<tr align=center bgcolor="#efefe4">
<td>r&eacute;capitulatif</td>
<td>{$data[sum][1]}</td>
<td>{$data[sum][2]}</td>
<td>{$data[sum][3]}</td>
</tr>
EOM;
?>
</table>
</table>
</td></tr>
</table>
</td></tr>
</table>
</form>
</center>
</body>
</html>
/gestion/manager/html/group_toolbar.html.php
0,0 → 1,13
<?php
$Login = urlencode($login);
print <<<EOM
<tr valign=top>
<td align=center bgcolor="#FFCC66">
<a href="group_admin.php?login=$Login" title="Gestion des membres du groupe"><font color="black"><b>MEMBRES</b></font></a></td>
<td align=center bgcolor="#FFCC66">
<a href="user_edit.php?login=$Login&user_type=group" title="Editer les propri&eacute;t&eacute;s du groupe"><font color="black"><b>ATTRIBUTS</b></font></a></td>
<td align=center bgcolor="#FFCC66">
<a href="user_delete.php?login=$Login&user_type=group" title="Supprimer le groupe"><font color="black"><b>SUPPRIMER</b></font></a></td>
</tr>
EOM;
?>
/gestion/manager/html/user_toolbar.html.php
0,0 → 1,28
<?php
$Login = urlencode($login);
print <<<EOM
<tr valign=top>
<td align=center bgcolor="#FFCC66">
<a href="user_admin.php?login=$Login" title="Afficher les informations de l'usager"><font color="black"><b>&Eacute;TAT</b></font></a></td>
<td align=center bgcolor="#FFCC66">
<a href="user_edit.php?login=$Login" title="Modifier les param&egrave;tres de l'usager"><font color="black"><b>ATTRIBUTS</b></font></a></td>
<td align=center bgcolor="#FFCC66">
<a href="user_info.php?login=$Login" title="Modifier les informations personnelles de l'usager"><font color="black"><b>INFOS PERSONNELLES</b></font></a></td>
</tr>
<tr valign=top>
<td align=center bgcolor="#FFCC66">
<a href="user_accounting.php?login=$Login" title="Afficher les informations de connexions de l'usager"><font color="black"><b>CONNEXIONS</b></font></a></td>
<!--<td align=center bgcolor="#FFCC66">
<a href="badusers.php?login=$Login" title="Show User Unauthorized Actions"><font color="black"><b>BADUSERS</b></font></a></td>
-->
<td align=center bgcolor="#FFCC66">
<a href="user_delete.php?login=$Login" title="Supprimer l'usager"><font color="black"><b>SUPPRIMER</b></font></a></td>
<!--<td align=center bgcolor="#FFCC66">
<a href="user_test.php?login=$Login" title="Test de l'usager"><font color="black"><b>TEST</b></font></a></td>
-->
<td align=center bgcolor="#FFCC66">
<a href="clear_opensessions.php?login=$Login" title="Effacer les sessions ouvertes de l'usager"><font color="black"><b>SESSIONS OUVERTES</b></font></a></td>
</tr>
</font>
EOM;
?>
/gestion/manager/html/user_admin_userinfo.html.php
0,0 → 1,29
<?php
echo <<<EOM
<tr><td align=center bgcolor="#d0ddb0">
Serveur
</td><td>
<b>$lastlog_server_name</b> ($lastlog_server_ip)
</td></tr>
<tr><td align=center bgcolor="#d0ddb0">
Port du serveur
</td><td>
$lastlog_server_port
</td></tr>
<tr><td align=center bgcolor="#d0ddb0">
@MAC de la station cliente
</td><td>
$lastlog_callerid
</td></tr>
<tr><td align=center bgcolor="#d0ddb0">
Upload
</td><td>
$lastlog_input
</td></tr>
<tr><td align=center bgcolor="#d0ddb0">
Download
</td><td>
$lastlog_output
</td></tr>
EOM;
?>
/gestion/manager/pass/index.php
0,0 → 1,143
<?php
# change user password on Alcasar captive Portal
# Copyright (C) 2003, 2004 Mondru AB.
# Copyright (C) 2008-2009 ANGEL95 & REXY
 
require('/etc/freeradius-web/config.php');
require('../lib/functions.php');
require('../lib/defaults.php');
 
$current_page = $_SERVER['PHP_SELF'];
 
# Choice of language
$Language = 'fr';
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
if($Language == 'es'){
$R_title = "User password change";
$R_form_l1 = "User";
$R_form_l2 = "Old password";
$R_form_l3 = "New password";
$R_form_l4 = "New password (confirmation)";
$R_form_button = "Modify";
$R_form_result1 = "Your password has been successfuly changed";
$R_form_result2 = "Error when trying to change password";
}
if($Language == 'de'){
$R_title = "User password change";
$R_form_l1 = "User";
$R_form_l2 = "Old password";
$R_form_l3 = "New password";
$R_form_l4 = "New password (confirmation)";
$R_form_button = "Modify";
$R_form_result1 = "Your password has been successfuly changed";
$R_form_result2 = "Error when trying to change password";
}
if($Language == 'nl'){
$R_title = "User password change";
$R_form_l1 = "User";
$R_form_l2 = "Old password";
$R_form_l3 = "New password";
$R_form_l4 = "New password (confirmation)";
$R_form_button = "Modify";
$R_form_result1 = "Your password has been successfuly changed";
$R_form_result2 = "Error when trying to change password";
}
if($Language == 'en'){
$R_title = "User password change";
$R_form_l1 = "User";
$R_form_l2 = "Old password";
$R_form_l3 = "New password";
$R_form_l4 = "New password (confirmation)";
$R_form_button = "Modify";
$R_form_result1 = "Your password has been successfuly changed";
$R_form_result2 = "Error when trying to change password";
}
if($Language == 'fr'){
$R_title = "Changement de mot de passe utilisateur";
$R_form_l1 = "Utilisateur";
$R_form_l2 = "Ancien mot de passe";
$R_form_l3 = "nouveau mot de passe";
$R_form_l4 = "nouveau mot de passe (confirmation)";
$R_form_button = "Modifier";
$R_form_result1 = "Votre mot de passe a &eacute;t&eacute; modifi&eacute; avec succ&egrave;s";
$R_form_result2 = "Erreur de changement de mot de passe";
}
echo "
<html>
<head>
<title>$R_title</title>
<meta http-equiv=\"Cache-control\" content=\"no-cache\">
<meta http-equiv=\"Pragma\" content=\"no-cache\">
<link rel=\"stylesheet\" href=\"/css/style.css\" type=\"text/css\">
</head>
<body>
<center>
<table border=0 width=400 cellpadding=0 cellspacing=2>
<tr>
<td>
<form name=\"master\" action=\"$current_page\" method=\"post\">
<input type=hidden name=action value=checkpass>
<br>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=340></td>
<td bgcolor=\"black\" width=200>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor=\"#907030\" align=right valign=top><th>
<font color=\"white\">$R_title</font>&nbsp;
</th></tr>
</table>
</td></tr>
<tr bgcolor=\"black\" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor=\"#ffffd0\" valign=top>
<tr><td>
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor=\"#ffffe0\" valign=top>
<tr><td align=center bgcolor=\"#d0ddb0\">$R_form_l1</td><td><input type=\"text\" name=\"login\" value=\"\"></td></tr>
<tr><td align=center bgcolor=\"#d0ddb0\">$R_form_l2</td><td><input type=\"password\" name=\"passwd\" value=\"\"></td></tr>
<tr><td align=center bgcolor=\"#d0ddb0\">$R_form_l3</td><td><input type=\"password\" name=\"newpasswd\" value=\"\"></td></tr>
<tr><td align=center bgcolor=\"#d0ddb0\">$R_form_l4</td><td><input type=\"password\" name=\"newpasswd2\" value=\"\">&nbsp;<input type=\"submit\" class=button value=\"$R_form_button\"></td></tr>
</table>
</table>
</table>";
 
#if (is_file("../lib/$config[general_lib_type]/password_check.php"))
# include("../lib/$config[general_lib_type]/password_check.php");
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
else{
echo "<b>Could not include SQL library</b><br>\n";
exit();
}
if ($action == 'checkpass'){
$link = @da_sql_pconnect($config);
if ($link){
$res = @da_sql_query($link,$config,
"SELECT attribute,value FROM $config[sql_check_table] WHERE username = '$login'
AND attribute = '$config[sql_password_attribute]';");
if ($res){
$row = @da_sql_fetch_array($res,$config);
if (is_file("../lib/crypt/$config[general_encryption_method].php")){
include("../lib/crypt/$config[general_encryption_method].php");
$enc_passwd = $row[value];
$passwd = da_encrypt($passwd,$enc_passwd);
$newpasswd = da_encrypt($newpasswd,$enc_passwd);
$newpasswd2 = da_encrypt($newpasswd2,$enc_passwd);
if (($passwd == $enc_passwd) and ($newpasswd == $newpasswd2)){
$msg = '<font color=blue><b>'.$R_form_result1.'</b></font>';
$res2 = @da_sql_query($link,$config,
"UPDATE $config[sql_check_table] set value='$newpasswd' WHERE username = '$login'
AND attribute = '$config[sql_password_attribute]';");}
else
$msg = '<font color=red><b>'.$R_form_result2.'</b></font>';
}
else
echo "<b>Could not open encryption library file</b><br>\n";
}
}
echo "<tr><td colspan=3 align=center>$msg</td></tr>\n";
}
?>
</body>
</html>
/gestion/manager/lib/sql/delete_group.php
0,0 → 1,31
<?php
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
else{
echo "<b>Could not include SQL library</b><br>\n";
exit();
}
$link = @da_sql_pconnect($config);
if ($link){
$res = @da_sql_query($link,$config,
"DELETE FROM $config[sql_groupreply_table] WHERE groupname = '$login';");
if ($res){
$res = @da_sql_query($link,$config,
"DELETE FROM $config[sql_groupcheck_table] WHERE groupname = '$login';");
if ($res){
$res = @da_sql_query($link,$config,
"DELETE FROM $config[sql_usergroup_table] WHERE groupname = '$login';");
if ($res)
echo "<b>Le groupe $login a &eacute;t&eacute; correctement supprim&eacute;</b><br>\n";
else
echo "<b>Error deleting group $login from usergroup table: " . da_sql_error($link,$config) . "</b><br>\n";
}
else
echo "<b>Error deleting group $login from group check table: " . da_sql_error($link,$config) . "</b><br>\n";
}
else
echo "<b>Error deleting group $login from group reply table: " . da_sql_error($link,$config) . "</b><br>\n";
}
else
echo "<b>Could not connect to SQL database</b><br>\n";
?>
/gestion/manager/lib/sql/create_group.php
0,0 → 1,89
<?php
require_once('../lib/functions.php');
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
else{
echo "<b>Could not include SQL library</b><br>\n";
exit();
}
if ($config[sql_use_operators] == 'true'){
include("../lib/operators.php");
$text = ',op';
$passwd_op = ",':='";
}
$da_abort=0;
$op_val2 = '';
$link = @da_sql_pconnect($config);
if ($link){
$Members = preg_split("/[\n\s]+/",$members,-1,PREG_SPLIT_NO_EMPTY);
if (!empty($Members)){
foreach ($Members as $member){
$member = da_sql_escape_string($member);
$res = @da_sql_query($link,$config,
"INSERT INTO $config[sql_usergroup_table] (username,groupname)
VALUES ('$member','$login');");
if (!$res || !@da_sql_affected_rows($link,$res,$config)){
echo "<b>Unable to add user $member in group $login: " . da_sql_error($link,$config) . "</b><br>\n";
$da_abort=1;
}
}
}
else
{
$res = @da_sql_query($link,$config,
"INSERT INTO $config[sql_usergroup_table] (username,groupname)
VALUES ('$login','$login');");
if (!$res || !@da_sql_affected_rows($link,$res,$config))
{
echo "<b>Unable to add user $member in group $login: " . da_sql_error($link,$config) . "</b><br>\n";
$da_abort=1;
}
else
{
echo "<b>Un groupe ne pouvant &ecirc;tre vide, l'usager '$login' a &eacute;t&eacute; cr&eacute;&eacute; (usager virtuel)<br>";
}
}
if (!$da_abort)
{
foreach($show_attrs as $key => $attr){
if ($attrmap["$key"] == 'none')
continue;
if ($attrmap["$key"] == ''){
$attrmap["$key"] = $key;
$attr_type["$key"] = 'replyItem';
$rev_attrmap["$key"] = $key;
}
if ($attr_type["$key"] == 'checkItem'){
$table = "$config[sql_groupcheck_table]";
$type = 1;
}
else if ($attr_type["$key"] == 'replyItem'){
$table = "$config[sql_groupreply_table]";
$type = 2;
}
$val = $$attrmap["$key"];
$val = da_sql_escape_string($val);
$op_name = $attrmap["$key"] . '_op';
$op_val = $$op_name;
if ($op_val != ''){
$op_val = da_sql_escape_string($op_val);
if (check_operator($op_val,$type) == -1){
echo "<b>Invalid operator ($op_val) for attribute $key</b><br>\n";
coninue;
}
$op_val2 = ",'$op_val'";
}
if ($val == '' || check_defaults($val,$op_val,$default_vals["$key"]))
continue;
$res = @da_sql_query($link,$config,
"INSERT INTO $table (attribute,value,groupname $text)
VALUES ('$attrmap[$key]','$val','$login' $op_val2);");
if (!$res || !@da_sql_affected_rows($link,$res,$config))
echo "<b>Query failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n";
}
echo "<b>Le groupe $login a &eacute;t&eacute; correctement cr&eacute;&eacute;</b><br>\n";
}
}
else
echo "<b>Could not connect to SQL database</b><br>\n";
?>
/gestion/manager/lib/sql/password_check.php
0,0 → 1,36
<?php
require('password.php');
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
else{
echo "<b>Could not include SQL library</b><br>\n";
exit();
}
 
if ($action == 'checkpass'){
$link = @da_sql_pconnect($config);
if ($link){
$res = @da_sql_query($link,$config,
"SELECT attribute,value FROM $config[sql_check_table] WHERE username = '$login'
AND attribute = '$config[sql_password_attribute]';");
if ($res){
$row = @da_sql_fetch_array($res,$config);
if (is_file("../lib/crypt/$config[general_encryption_method].php")){
include("../lib/crypt/$config[general_encryption_method].php");
$enc_passwd = $row[value];
$passwd = da_encrypt($passwd,$enc_passwd);
if ($passwd == $enc_passwd)
// $msg = '<font color=blue><b>YES It is that</b></font>';
$msg = '<font color=blue><b>Le mot de passe est correct</b></font>';
else
// $msg = '<font color=red><b>NO It is wrong</b></font>';
$msg = '<font color=red><b>Le mot de passe n\'est pas correct</b></font>';
}
else
echo "<b>Could not open encryption library file</b><br>\n";
}
}
echo "<b>$msg</b>\n";
}
?>
</form>
/gestion/manager/lib/sql/delete_user.php
0,0 → 1,37
<?php
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
else{
echo "<b>Could not include SQL library</b><br>\n";
exit();
}
$link = @da_sql_pconnect($config);
if ($link){
$res = @da_sql_query($link,$config,
"DELETE FROM $config[sql_reply_table] WHERE username = '$login';");
if ($res){
$res = @da_sql_query($link,$config,
"DELETE FROM $config[sql_check_table] WHERE username = '$login';");
if ($res){
$res = @da_sql_query($link,$config,
"DELETE FROM $config[sql_usergroup_table] WHERE username = '$login';");
if (!$res)
echo "<b>Error deleting user $login from user group table: " . da_sql_error($link,$config) . "</b><br>\n";
if ($config[sql_use_user_info_table] == 'true'){
$res = @da_sql_query($link,$config,
"DELETE FROM $config[sql_user_info_table] WHERE username = '$login';");
if ($res)
echo "<b>L'usager $login a &eacute;t&eacute; correctement supprim&eacute;</b><br>\n";
else
echo "<b>Error deleting user $login from user info table: " . da_sql_error($link,$config) . "</b><br>\n";
}
}
else
echo "<b>Error deleting user $login from check table: " . da_sql_error($link,$config) . "</b><br>\n";
}
else
echo "<b>Error deleting user $login from reply table: " . da_sql_error($link,$config) . "</b><br>\n";
}
else
echo "<b>Could not connect to SQL database</b><br>\n";
?>
/gestion/manager/lib/sql/find.php
0,0 → 1,57
<?php
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
else{
echo "<b>Could not include SQL library</b><br>\n";
exit();
}
 
unset($found_users);
 
$link = @da_sql_pconnect($config);
if ($link){
$search = da_sql_escape_string($search);
if (!is_numeric($max))
# $max = 10;
# modif by MG fo Alcasar
$max = 40;
if ($max > 500)
$max = 10;
if (($search_IN == 'name' || $search_IN == 'department' || $search_IN == 'username') &&
$config[sql_use_user_info_table] == 'true'){
$res = @da_sql_query($link,$config,
"SELECT " . da_sql_limit($max,0,$config) . " username FROM $config[sql_user_info_table] WHERE
lower($search_IN) LIKE '%$search%' " .
# da_sql_limit($max,1,$config) . " " . da_sql_limit($max,2,$config) . " ;");
# modif by MG for Alcasar
da_sql_limit($max,1,$config) . " " . da_sql_limit($max,1,$config) . " ;");
if ($res){
while(($row = @da_sql_fetch_array($res,$config)))
$found_users[] = $row[username];
}
else
"<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
}
else if ($search_IN == 'radius' && $radius_attr != ''){
require("../lib/sql/attrmap.php");
if ($attrmap["$radius_attr"] == ''){
$attrmap["$radius_attr"] = $radius_attr;
$attr_type["$radius_attr"] = 'replyItem';
}
$table = ($attr_type[$radius_attr] == 'checkItem') ? $config[sql_check_table] : $config[sql_reply_table];
$attr = $attrmap[$radius_attr];
$attr = da_sql_escape_string($attr);
$res = @da_sql_query($link,$config,
"SELECT " . da_sql_limit($max,0,$config) . " username FROM $table WHERE attribute = '$attr'
AND value LIKE '%$search%' " . da_sql_limit($max,1,$config) . " " . da_sql_limit($max,2,$config) . " ;");
if ($res){
while(($row = @da_sql_fetch_array($res,$config)))
$found_users[] = $row[username];
}
else
"<b>Database query failed: " . da_sql_error($link,$config) . "</b><br>\n";
}
}
else
echo "<b>Could not connect to SQL database</b><br>\n";
?>
/gestion/manager/lib/sql/create_user.php
0,0 → 1,120
<?php
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
else{
echo "<b>Could not include SQL library</b><br>\n";
exit();
}
include_once('../lib/functions.php');
if ($config[sql_use_operators] == 'true'){
include("../lib/operators.php");
$text = ',op';
$passwd_op = ",':='";
}
$da_abort=0;
$op_val2 = '';
$link = @da_sql_pconnect($config);
if ($link){
if (is_file("../lib/crypt/$config[general_encryption_method].php")){
include("../lib/crypt/$config[general_encryption_method].php");
$passwd = da_encrypt($passwd);
$passwd = da_sql_escape_string($passwd);
$res = @da_sql_query($link,$config,
"INSERT INTO $config[sql_check_table] (attribute,value,username $text)
VALUES ('$config[sql_password_attribute]','$passwd','$login' $passwd_op);");
if (!$res || !@da_sql_affected_rows($link,$res,$config)){
echo "<b>Unable to add user $login: " . da_sql_error($link,$config) . "</b><br>\n";
$da_abort=1;
}
if ($config[sql_use_user_info_table] == 'true' && !$da_abort){
$res = @da_sql_query($link,$config,
"SELECT username FROM $config[sql_user_info_table] WHERE
username = '$login';");
if ($res){
if (!@da_sql_num_rows($res,$config)){
$Fcn = da_sql_escape_string($Fcn);
$Fmail = da_sql_escape_string($Fmail);
$Fou = da_sql_escape_string($Fou);
$Fhomephone = da_sql_escape_string($Fhomephone);
$Fworkphone = da_sql_escape_string($Fworkphone);
$Fmobile = da_sql_escape_string($Fmobile);
$res = @da_sql_query($link,$config,
"INSERT INTO $config[sql_user_info_table]
(username,name,mail,department,homephone,workphone,mobile) VALUES
('$login','$Fcn','$Fmail','$Fou','$Fhomephone','$Ftelephonenumber','$Fmobile');");
if (!$res || !@da_sql_affected_rows($link,$res,$config))
echo "<b>Could not add user information in user info table: " . da_sql_error($link,$config) . "</b><br>\n";
}
else
echo "<b>Cet usager existe d&eacute;j&agrave; dans la table 'info'</b><br>\n";
}
else
echo "<b>Could not add user information in user info table: " . da_sql_error($link,$config) . "</b><br>\n";
}
if ($Fgroup != ''){
$Fgroup = da_sql_escape_string($Fgroup);
$res = @da_sql_query($link,$config,
"SELECT username FROM $config[sql_usergroup_table]
WHERE username = '$login' AND groupname = '$Fgroup';");
if ($res){
if (!@da_sql_num_rows($res,$config)){
$res = @da_sql_query($link,$config,
"INSERT INTO $config[sql_usergroup_table]
(username,groupname) VALUES ('$login','$Fgroup');");
if (!$res || !@da_sql_affected_rows($link,$res,$config))
echo "<b>Could not add user to group $Fgroup. SQL Error</b><br>\n";
}
else
echo "<b>User already is a member of group $Fgroup</b><br>\n";
}
else
echo "<b>Could not add user to group $Fgroup: " . da_sql_error($link,$config) . "</b><br>\n";
}
if (!$da_abort){
if ($Fgroup != '')
require('../lib/defaults.php');
foreach($show_attrs as $key => $attr){
if ($attrmap["$key"] == 'none')
continue;
if ($attrmap["$key"] == ''){
$attrmap["$key"] = $key;
$attr_type["$key"] = 'replyItem';
$rev_attrmap["$key"] = $key;
}
if ($attr_type["$key"] == 'checkItem'){
$table = "$config[sql_check_table]";
$type = 1;
}
else if ($attr_type["$key"] == 'replyItem'){
$table = "$config[sql_reply_table]";
$type = 2;
}
$val = $$attrmap["$key"];
$val = da_sql_escape_string($val);
$op_name = $attrmap["$key"] . '_op';
$op_val = $$op_name;
if ($op_val != ''){
$op_val = da_sql_escape_string($op_val);
if (check_operator($op_val,$type) == -1){
echo "<b>Invalid operator ($op_val) for attribute $key</b><br>\n";
coninue;
}
$op_val2 = ",'$op_val'";
}
if ($val == '' || check_defaults($val,$op_val,$default_vals["$key"]))
continue;
$res = @da_sql_query($link,$config,
"INSERT INTO $table (attribute,value,username $text)
VALUES ('$attrmap[$key]','$val','$login' $op_val2);");
if (!$res || !@da_sql_affected_rows($link,$res,$config))
echo "<b>Query failed for attribute $key: " . da_sql_error($link,$config) . "</b><br>\n";
}
}
echo "<b>Usager correctement cr&eacute;&eacute;</b><br>\n";
}
else
echo "<b>Could not open encryption library file</b><br>\n";
}
else
echo "<b>Could not connect to SQL database</b><br>\n";
?>
/gestion/manager/lib/sql/drivers/mysql/functions.php
0,0 → 1,136
<?php
function da_sql_limit($limit,$point,$config)
{
switch($point){
case 0:
return '';
case 1:
return '';
//modif by MG for Alcasar
case 2:
return "LIMIT $limit";
case 3:
return "LIMIT $limit";
}
}
 
function da_sql_host_connect($server,$config)
{
if ($config[sql_use_http_credentials] == 'yes'){
global $HTTP_SERVER_VARS;
$SQL_user = $HTTP_SERVER_VARS["PHP_AUTH_USER"];
$SQL_passwd = $HTTP_SERVER_VARS["PHP_AUTH_PW"];
}
else{
$SQL_user = $config[sql_username];
$SQL_passwd = $config[sql_password];
}
 
if ($config[sql_connect_timeout] != 0)
@ini_set('mysql.connect_timeout',$config[sql_connect_timeout]);
if ($config[sql_debug] == 'true')
print "<b>DEBUG(SQL,MYSQL DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd </b><br>\n";
return @mysql_connect("$server:$config[sql_port]",$SQL_user,$SQL_passwd);
}
 
function da_sql_connect($config)
{
if ($config[sql_use_http_credentials] == 'yes'){
global $HTTP_SERVER_VARS;
$SQL_user = $HTTP_SERVER_VARS["PHP_AUTH_USER"];
$SQL_passwd = $HTTP_SERVER_VARS["PHP_AUTH_PW"];
}
else{
$SQL_user = $config[sql_username];
$SQL_passwd = $config[sql_password];
}
 
if ($config[sql_connect_timeout] != 0)
@ini_set('mysql.connect_timeout',$config[sql_connect_timeout]);
if ($config[sql_debug] == 'true')
print "<b>DEBUG(SQL,MYSQL DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd </b><br>\n";
return @mysql_connect("$config[sql_server]:$config[sql_port]",$SQL_user,$SQL_passwd);
}
 
function da_sql_pconnect($config)
{
if ($config[sql_use_http_credentials] == 'yes'){
global $HTTP_SERVER_VARS;
$SQL_user = $HTTP_SERVER_VARS["PHP_AUTH_USER"];
$SQL_passwd = $HTTP_SERVER_VARS["PHP_AUTH_PW"];
}
else{
$SQL_user = $config[sql_username];
$SQL_passwd = $config[sql_password];
}
 
if ($config[sql_connect_timeout] != 0)
@ini_set('mysql.connect_timeout',$config[sql_connect_timeout]);
if ($config[sql_debug] == 'true')
print "<b>DEBUG(SQL,MYSQL DRIVER): Connect: User=$SQL_user,Password=$SQL_passwd </b><br>\n";
return @mysql_pconnect("$config[sql_server]:$config[sql_port]",$SQL_user,$SQL_passwd);
}
 
function da_sql_close($link,$config)
{
return @mysql_close($link);
}
 
function da_sql_escape_string($string)
{
return @mysql_escape_string($string);
}
 
function da_sql_query($link,$config,$query)
{
if ($config[sql_debug] == 'true')
print "<b>DEBUG(SQL,MYSQL DRIVER): Query: <i>$query</i></b><br>\n";
return @mysql_db_query($config[sql_database],$query,$link);
}
 
function da_sql_num_rows($result,$config)
{
if ($config[sql_debug] == 'true')
print "<b>DEBUG(SQL,MYSQL DRIVER): Query Result: Num rows:: " . @mysql_num_rows($result) . "</b><br>\n";
return @mysql_num_rows($result);
}
 
function da_sql_fetch_array($result,$config)
{
$row = array_change_key_case(@mysql_fetch_array($result,
MYSQL_ASSOC),CASE_LOWER);
if ($config[sql_debug] == 'true'){
print "<b>DEBUG(SQL,MYSQL DRIVER): Query Result: <pre>";
print_r($row);
print "</b></pre>\n";
}
return $row;
}
 
function da_sql_affected_rows($link,$result,$config)
{
if ($config[sql_debug] == 'true')
print "<b>DEBUG(SQL,MYSQL DRIVER): Query Result: Affected rows:: " . @mysql_affected_rows($result) . "</b><br>\n";
return @mysql_affected_rows($link);
}
 
function da_sql_list_fields($table,$link,$config)
{
return @mysql_list_fields($config[sql_database],$table);
}
 
function da_sql_num_fields($fields,$config)
{
return @mysql_num_fields($fields);
}
 
function da_sql_field_name($fields,$num,$config)
{
return @mysql_field_name($fields,$num);
}
 
function da_sql_error($link,$config)
{
return @mysql_error($link);
}
?>
/gestion/manager/lib/crypt/crypt.php
0,0 → 1,14
<?php
function da_encrypt()
{
$numargs=func_num_args();
$passwd=func_get_arg(0);
# calcul d'un salt pour forcer le chiffrement en MD5 au lieu de blowfish par defaut dans php versin mdva > 2007.1
$salt='$1$passwd$';
if ($numargs == 2){
$salt=func_get_arg(1);
return crypt($passwd,$salt);
}
return crypt($passwd,$salt);
}
?>
/gestion/manager/lib/functions.php
0,0 → 1,135
<?php
function time2str($time)
{
$time = floor($time);
if (!$time)
return "0 seconds";
$d = $time/86400;
$d = floor($d);
if ($d){
$str .= "$d days, ";
$time = $time % 86400;
}
$h = $time/3600;
$h = floor($h);
if ($h){
$str .= "$h hours, ";
$time = $time % 3600;
}
$m = $time/60;
$m = floor($m);
if ($m){
$str .= "$m minutes, ";
$time = $time % 60;
}
if ($time)
$str .= "$time seconds, ";
$str = ereg_replace(', $','',$str);
 
return $str;
}
 
function time2strclock($time)
{
$time = floor($time);
if (!$time)
return "00:00:00";
 
$str["days"] = $str["hour"] = $str["min"] = $str["sec"] = "00";
 
$d = $time/86400;
$d = floor($d);
if ($d){
if ($d < 10)
$d = "0" . $d;
$str["days"] = "$d";
$time = $time % 86400;
}
$h = $time/3600;
$h = floor($h);
if ($h){
if ($h < 10)
$h = "0" . $h;
$str["hour"] = "$h";
$time = $time % 3600;
}
$m = $time/60;
$m = floor($m);
if ($m){
if ($m < 10)
$m = "0" . $m;
$str["min"] = "$m";
$time = $time % 60;
}
if ($time){
if ($time < 10)
$time = "0" . $time;
}
else
$time = "00";
$str["sec"] = "$time";
if ($str["days"] != "00")
$ret = "$str[days]:$str[hour]:$str[min]:$str[sec]";
else
$ret = "$str[hour]:$str[min]:$str[sec]";
 
return $ret;
}
 
function date2timediv($date,$now)
{
list($day,$time)=explode(' ',$date);
$day = explode('-',$day);
$time = explode(':',$time);
$timest = mktime($time[0],$time[1],$time[2],$day[1],$day[2],$day[0]);
if (!$now)
$now = time();
return ($now - $timest);
}
 
function date2time($date)
{
list($day,$time)=explode(' ',$date);
$day = explode('-',$day);
$time = explode(':',$time);
$timest = mktime($time[0] ?"":0,$time[1],$time[2],$day[1],$day[2],$day[0]);
return $timest;
}
 
function bytes2str($bytes)
{
$bytes=floor($bytes);
if ($bytes > 536870912)
$str = sprintf("%5.2f GBs", $bytes/1073741824);
else if ($bytes > 524288)
$str = sprintf("%5.2f MBs", $bytes/1048576);
else
$str = sprintf("%5.2f KBs", $bytes/1024);
 
return $str;
}
 
function nothing($ret)
{
return $ret;
}
function check_defaults($val,$op,$def)
{
for($i=0;$i<$def[count];$i++){
if ($val == $def[$i] && ($op == '' || $op == $def[operator][$i]))
return 1;
}
 
return 0;
}
 
function check_ip($ipaddr) {
if(ereg("^([0-9]{1,3})\x2E([0-9]{1,3})\x2E([0-9]{1,3})\x2E([0-9]{1,3})$", $ipaddr,$digit)) {
if(($digit[1] <= 255) && ($digit[2] <= 255) && ($digit[3] <= 255) && ($digit[4] <= 255)) {
return(1);
}
}
return(0);
}
 
?>