Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1577 → Rev 1578

/web/acc/admin/network.php
4,10 → 4,10
/********************
* TEST CONF FILES *
*********************/
define ("ALCASAR_CHILLI", "/etc/chilli.conf");
//define ("ALCASAR_CHILLI", "/etc/chilli.conf");
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
define ("ETHERS_FILE", "/usr/local/etc/alcasar-ethers");
$conf_files=array(ALCASAR_CHILLI,CONF_FILE,ETHERS_FILE);
$conf_files=array(CONF_FILE,ETHERS_FILE);
foreach ($conf_files as $file){
if (!file_exists($file)){
exit("Requested file ".$file." isn't present");}
104,7 → 104,7
$pointeur=fopen(ETHERS_FILE,"a");
fwrite ($pointeur, $line);
fclose ($pointeur);
exec ("sudo service chilli restart");
exec ("/usr/bin/systemctl reload chilli");
}
}
break;
129,7 → 129,7
if (! $remove_line) {fwrite($pointeur,$line);}
}
fclose($pointeur);
# exec ("sudo service chilli restart");
exec ("sudo /usr/bin/systemctl reload chilli");
}
break;
}
150,21 → 150,22
}
/********************************************************
* Lecture du fichier ALCASAR_CHILLI *
* (not need any more) *
*********************************************************/
$ouvre=fopen(ALCASAR_CHILLI,"r");
if ($ouvre){
while (!feof ($ouvre))
{
$tampon = fgets($ouvre, 4096);
if (strpos($tampon,"=")!==false){
$tmp = explode("=",$tampon);
$chilli[$tmp[0]] = $tmp[1];
}
}
}else{
exit("Erreur d'ouverture du fichier ".ALCASAR_CHILLI);
}
fclose($ouvre);
//$ouvre=fopen(ALCASAR_CHILLI,"r");
//if ($ouvre){
// while (!feof ($ouvre))
// {
// $tampon = fgets($ouvre, 4096);
// if (strpos($tampon,"=")!==false){
// $tmp = explode("=",$tampon);
// $chilli[$tmp[0]] = $tmp[1];
// }
// }
//}else{
// exit("Erreur d'ouverture du fichier ".ALCASAR_CHILLI);
//}
//fclose($ouvre);
 
/***********************************
* Read ALCASAR_CONF_FILE *
195,6 → 196,19
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php echo $l_network_title; ?></title>
<link rel="stylesheet" href="/css/style.css" type="text/css">
<script type="text/javascript">
function MAC_Control(formulaire){
/*MAC control (upper case and '-' separator*/
var regex1 = /^([0-9a-fA-F]{2}(-|:)){5}[0-9a-fA-F]{2}$/; //vérification adresse mac
if (regex1.test(document.forms[formulaire].add_mac.value)){
document.forms[formulaire].add_mac.value=document.forms[formulaire].add_mac.value.toUpperCase().replace(/:/g, '-');
return true;
} else {
alert("Invalid MAC address");//non internationnalisé
return false;
}
}
</script>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">