Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 3128 → Rev 3129

/web/acc/welcome.php
8,7 → 8,7
$host = "localhost";
$DB_USER = "radius";
$DB_RADIUS = "radius";
$radiuspwd = "";
$radiuspwd = "pJHKcy9Jv1HrCMHM";
// Connexion au serveur
$mysqli = new mysqli($host, $DB_USER, $radiuspwd, $DB_RADIUS);
if ($texte == 'user') {$query = "SELECT UserName FROM userinfo";}
21,9 → 21,9
return $strResult;
}
// router test
function routerTest($host) {
$out = exec("(sudo arping -c1 -f $host|grep 'Received 0 response'|wc -l)");
return ($out == "0") ? true : false;
function routerTest($host,$nic) {
$out = exec("(sudo arping -I$nic -c1 $host|grep response|cut -d' ' -f2)");
return ($out == "1") ? true : false;
}
 
// Internet test
160,7 → 160,7
 
// Router status
$mask = strrchr($conf['PUBLIC_IP'],"/");
if(routerTest($conf['GW']) && ($conf['GW'].$mask != $conf['PUBLIC_IP'])){
if(routerTest($conf['GW'],$conf['EXTIF']) && ($conf['GW'].$mask != $conf['PUBLIC_IP'])){
$router_status = $l_router." "." <img src='/images/state_ok.gif'> ";
} else{
$router_status = $l_router." "." <img src='/images/state_error.gif'> ";