Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 653 → Rev 654

/web/acc/admin/network.php
77,8 → 77,6
*********************************************************************/
 
define ("ALCASAR_CHILLI", "/etc/chilli.conf");
define ("ALCASAR_ETH0", "/etc/sysconfig/network-scripts/ifcfg-eth0");
define ("ALCASAR_ETH1", "/etc/sysconfig/network-scripts/ifcfg-eth1");
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
/********************************************************************
* TEST DES FICHIERS DE CONFIGURATION *
88,18 → 86,15
if (!file_exists(ALCASAR_CHILLI)){
exit("Fichier de configuration ".ALCASAR_CHILLI." non présent");
}
if (!file_exists(ALCASAR_ETH0)){
exit("Fichier de configuration ".ALCASAR_ETH0." non présent");
if (!file_exists(CONF_FILE)){
exit("Fichier de configuration ".CONF_FILE." non présent");
}
if (!file_exists(ALCASAR_ETH1)){
exit("Fichier de configuration ".ALCASAR_ETH1." non présent");
if (!is_readable(ALCASAR_CHILLI)){
exit("Vous n'avez pas les droits de lecture sur le fichier ".ALCASAR_CHILLI);
}
if (!is_readable(ALCASAR_ETH0)){
exit("Vous n'avez pas les droits de lecture sur le fichier ".ALCASAR_ETH0);
if (!is_readable(CONF_FILE)){
exit("Vous n'avez pas les droits de lecture sur le fichier ".CONF_FILE);
}
if (!is_readable(ALCASAR_ETH1)){
exit("Vous n'avez pas les droits de lecture sur le fichier ".ALCASAR_ETH1);
}
 
//fonction pour faire une action (start,stop,restart) sur un service
function serviceExec($service, $action){
200,9 → 195,9
fclose($ouvre);
 
/********************************************************************
* Lecture du fichier ALCASAR_ETH0 *
* Lecture du fichier CONF_FILE *
*********************************************************************/
$ouvre=fopen(ALCASAR_ETH0,"r");
$ouvre=fopen(CONF_FILE,"r");
if ($ouvre){
while (!feof ($ouvre))
{
209,28 → 204,10
$tampon = fgets($ouvre, 4096);
if (strpos($tampon,"=")!==false){
$tmp = explode("=",$tampon);
$eth0[$tmp[0]] = $tmp[1];
$conf[$tmp[0]] = $tmp[1];
}
}
}else{
exit("Erreur d'ouverture du fichier ".ALCASAR_ETH0);
}
fclose($ouvre);
 
/********************************************************************
* Lecture du fichier ALCASAR_ETH1 *
*********************************************************************/
$ouvre=fopen(ALCASAR_ETH1,"r");
if ($ouvre){
while (!feof ($ouvre))
{
$tampon = fgets($ouvre, 4096);
if (strpos($tampon,"=")!==false){
$tmp = explode("=",$tampon);
$eth1[$tmp[0]] = $tmp[1];
}
}
}else{
exit("Erreur d'ouverture du fichier ".ALCASAR_ETH1);
}
fclose($ouvre);
267,8 → 244,8
?></legend>
<table>
<tr><td><?php echo $l_ip_public." : </td><td>".$IP_PUB;?></td></tr>
<tr><td><?php echo $l_ip_dns1." : </td><td>".$eth0["DNS1"];?></td></tr>
<tr><td><?php echo $l_ip_dns2." : </td><td>".$eth0["DNS2"];?></td></tr>
<tr><td><?php echo $l_ip_dns1." : </td><td>".$conf["DNS1"];?></td></tr>
<tr><td><?php echo $l_ip_dns2." : </td><td>".$conf["DNS2"];?></td></tr>
</table>
</fieldset>
</td><td>
275,9 → 252,8
<fieldset>
<legend><?php echo $l_eth0_legend; ?></legend>
<table>
<tr><td><?php echo $l_ip_adr." : </td><td>".$eth0["IPADDR"];?></td></tr>
<tr><td><?php echo $l_ip_mask." : </td><td>".$eth0["NETMASK"];?></td></tr>
<tr><td><?php echo $l_ip_router." : </td><td>".$eth0["GATEWAY"];?></td></tr>
<tr><td><?php echo $l_ip_adr." : </td><td>".$conf["PUBLIC_IP"];?></td></tr>
<tr><td><?php echo $l_ip_router." : </td><td>".$conf["GW"];?></td></tr>
</table>
</fieldset>
</td><td>
284,8 → 260,7
<fieldset>
<legend><?php echo $l_eth1_legend; ?></legend>
<table>
<tr><td><?php echo $l_ip_adr." : </td><td>".$eth1["IPADDR"];?></td></tr>
<tr><td><?php echo $l_ip_mask." : </td><td>".$eth1["NETMASK"];?></td></tr>
<tr><td><?php echo $l_ip_adr." : </td><td>".$conf["PRIVATE_IP"];?></td></tr>
</table>
</fieldset>
</td></tr>