Subversion Repositories ALCASAR

Rev

Rev 720 | Blame | Last modification | View Log

<?php
/*


*/
/********************************************************************
*                                               FICHIERS REQUIS                                                         *
*********************************************************************/
require_once('includes/defines.inc.php');
require_once(ALCASAR_ADMIN_PATH_INC.'/session.inc.php');

/********************************************************************
*                               APPLIQUATION DES MISES A JOURS                                          *
*********************************************************************/
/*
Cette section met à jour la configuration réseau d'alcasar d'Alcasar
*/
print_r($_REQUEST);
/*
Mise à jour des paramètres WAN
*/


/*
Mise à jour des paramètres LAN
*/



/*
Mise à jour des paramètres DNS
*/

/*
Mise à jour des paramètres DHCP
*/


/*
Mise à jour des ROUTE
*/


/********************************************************************
*                                               CHOIX DE LA LANGUE                                                      *
*********************************************************************/
# 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_network_title        = "Configuration r&eacute;seau";
        $l_ip                   = "@IP/CIDR";
        $l_mask                 = "Masque";
        $l_gateway              = "Passerelle";
        $l_dns                  = "DNS";
        $l_yes                  = "OUI";
        $l_no                   = "NON";
        $l_ip_row_title = "Adresse IP";
        $l_host_row_title       = "Nom d'hôte";
        $l_mac_row_title        = "Adresse MAC";
        $l_description_row_title        = "Description";
        //tabs-wan
        $l_wan                  = "WAN";
        $l_enable               = "actif";
        $l_disable              = "inactif";
        $l_internet_title       = "Internet";
        $l_ip_public    = "@IP publique";
        $l_state                = "Etat Internet";
        $l_eth0_title   = "ETH0 : carte r&eacute;seau connect&eacute; vers Internet";
        //tabs-lan
        $l_lan                  = "LAN";
        $l_eth1_title   = "ETH1 : carte r&eacute;seau connect&eacute; sur le r&eacute;seau de consultation";
        //tabs-dns-local
        $l_local_dns    = "DNS local";
        //tabs-dhcp
        $l_dhcp                 = "DHCP";
        $l_dhcp_server  = "Serveur DHCP";
        $l_dhcp_activation      = "Activation";
        $l_dhcp_bail    = "Bail";
        $l_dhcp_description     = "Si le DHCP est activ&eacute;e, la plage d'adresse IP est coup&eacute;e en deux.<br />
        Les adresses IP de X.X.X.X &agrave; X sont attribu&eacute;es par DHCP, les autres sont r&eacute;serv&eacute;es pour un adressage manuel des stations clientes.<br />";
        $l_dhcp_ip_statique     = "Adresses IP statiques";
        //tabs-route
        $l_route                = "ROUTE";
        $l_destination_row_title        = "Destination";
        $l_mask_row_title                       = "Masque de sous-r&eacute;seau";
        $l_gateway_row_title            = "Passerelle";
        //buttons
        $l_change               = "Modifier";
}
else { // a traduire
        $l_network_title        = "Network configuration";
        $l_ip                   = "@IP/CIDR";
        $l_mask                 = "Mask";
        $l_gateway              = "Gateway";
        $l_dns                  = "DNS";
        $l_yes                  = "YES";
        $l_no                   = "NO";
        $l_ip_row_title = "IP adress";
        $l_host_row_title       = "Host name";
        $l_mac_row_title        = "MAC adresse ";
        $l_description_row_title        = "Description";
        //tabs-wan
        $l_wan                  = "WAN";
        $l_enable               = "enable";
        $l_disable              = "disable";
        $l_internet_title       = "Internet";
        $l_ip_public    = "Public IP ";
        $l_state                = "Internet state";
        $l_eth0_title   = "ETH0 : carte r&eacute;seau connect&eacute; vers Internet";
        //tabs-lan
        $l_lan                  = "LAN";
        $l_eth1_title   = "ETH1 : carte r&eacute;seau connect&eacute; sur le r&eacute;seau de consultation";
        //tabs-dns-local
        $l_local_dns    = "Local DNS";
        //tabs-dhcp
        $l_dhcp                 = "DHCP";
        $l_dhcp_server  = "DHCP server";
        $l_dhcp_activation      = "Activation";
        $l_dhcp_bail    = "Bail";
        $l_dhcp_description     = "Si le DHCP est activ&eacute;e, la plage d'adresse IP est coup&eacute;e en deux.<br />
        Les adresses IP de X.X.X.X &agrave; X sont attribu&eacute;es par DHCP, les autres sont r&eacute;serv&eacute;es pour un adressage manuel des stations clientes.<br />";
        $l_dhcp_ip_statique     = "Adresses IP statiques";
        //tabs-route
        $l_route                = "ROUTE";
        $l_destination_row_title        = "Destination";
        $l_mask_row_title                       = "Mask";
        $l_gateway_row_title            = "Gateway";
        //buttons
        $l_change               = "Modifier";
}

/********************************************************************
*       CONSTANTES AVEC CHEMINS DES FICHIERS DE CONFIGURATION                   *
*********************************************************************/
define ("ALCASAR_CHILLI", "/etc/chilli.conf");
//define ("ALCASAR_CONF_FILE", "/usr/local/etc/alcasar.conf");
define ("ALCASAR_CONF_FILE", "includes/alcasar.conf");  // uniquement pour le développement
//define ("ALCASAR_ETHERS", "/usr/local/etc/alcasar-ethers");
define ("ALCASAR_ETHERS", "includes/alcasar-ethers");   // uniquement pour le développement
//define ("ALCASAR_DNS_NAME", "/usr/local/etc/alcasar-dns-name");
define ("ALCASAR_DNS_NAME", "includes/alcasar-dns-name");       // uniquement pour le développement

/********************************************************************
*                               TEST DES FICHIERS DE CONFIGURATION                                      *
*********************************************************************/

//Test de pr&eacute;sence et des droits en lecture des fichiers de configuration.
/*
if (!file_exists(ALCASAR_CHILLI)){
        exit("Fichier de configuration ".ALCASAR_CHILLI." non pr&eacute;sent");
}
*/
if (!file_exists(ALCASAR_CONF_FILE)){
        exit("Fichier de configuration ".ALCASAR_CONF_FILE." non pr&eacute;sent");
}
if (!file_exists(ALCASAR_ETHERS)){
        exit("Fichier de configuration ".ALCASAR_ETHERS." non pr&eacute;sent");
}
if (!file_exists(ALCASAR_DNS_NAME)){
        exit("Fichier de configuration ".ALCASAR_DNS_NAME." non pr&eacute;sent");
}
if (!is_readable(ALCASAR_CONF_FILE)){
        exit("Vous n'avez pas les droits de lecture sur le fichier ".ALCASAR_CONF_FILE);
}
if (!is_readable(ALCASAR_ETHERS)){
        exit("Vous n'avez pas les droits de lecture sur le fichier ".ALCASAR_ETHERS);
}
if (!is_readable(ALCASAR_DNS_NAME)){
        exit("Vous n'avez pas les droits de lecture sur le fichier ".ALCASAR_DNS_NAME);
}

/********************************************************************
*                               PARSING DES FICHIERS DE CONFIGURATION                           *
*********************************************************************/
/*
alcasar.conf parser
*/
$lines = file(ALCASAR_CONF_FILE);
$alcasar_conf = array();
foreach($lines as $line)
{
    if (preg_match('/^[[:space:]]*#/',$line)) // on ignore les commentaires (ligne d&eacute;butant par #)
                        continue;
        if (strpos($line,"=")!==false){ // on parse toutes les lignes contenant un "="
                $tmp = explode("=",$line);
                $alcasar_conf[trim($tmp[0])] = trim($tmp[1]);
        }
}

function CIDRToNetmask($test){
        // FONCTION A CREER
        return "255.255.255.0";
}

$PUBLIC_IP = explode("/",$alcasar_conf["PUBLIC_IP"]);
$PUBLIC_IP_NETMASK = CIDRToNetmask($PUBLIC_IP[1]);
$PRIVATE_IP = explode("/",$alcasar_conf["PRIVATE_IP"]);
$PRIVATE_IP_NETMASK = CIDRToNetmask($PRIVATE_IP[1]);
/*
chilli parser
*/
/*
$lines = file(ALCASAR_CHILLI);
$chilli = array();
foreach($lines as $line)
{
    if (preg_match('/^[[:space:]]*#/',$line)) // on ignore les commentaires (ligne d&eacute;butant par #)
                        continue;
        if (strpos($line,"=")!==false){ // on parse toutes les lignes contenant un "="
                $tmp = explode("=",$line);
                $chilli[trim($tmp[0])] = trim($tmp[1]);
        }
}
*/
/*
dnsname parser
*/

$lines = file(ALCASAR_DNS_NAME);
$dnsadresse = array();
$dnsadresse['address'] = array();
$dnsadresse['cname'] = array();
$dnsadresse['domain'] = array();
$n = 0;
$m = 0;
$o = 0;
foreach($lines as $line)
{
    if (preg_match('/^[[:space:]]*#/',$line)) // on ignore les commentaires (ligne d&eacute;butant par #)
                        continue;
        if (preg_match("/^(address=\/)/", trim($line))){ // on parse toutes les lignes commencant par "address="
                if (strpos($line,"/")!==false){
                        $tmp = explode("/",$line);
                        if (count($tmp) == 3) {
                                $dnsadresse['address'][$n]['DNSNAME'] = $tmp[1];
                                $dnsadresse['address'][$n]['IPADDR'] = $tmp[2];
                                $n++;
                        }
                }
        }
        if (preg_match("/^(cname=)/", trim($line))){ // on parse toutes les lignes commencant par "cname="
                if (strpos($line,"=")!==false){
                        $tmp = explode("=",$line);
                        if (count($tmp) == 2) {
                                if (strpos($tmp[1],",")!==false){
                                        $tmp = explode(",",$tmp[1]);
                                        if (count($tmp) == 2) {
                                                $dnsadresse['cname'][$m]['ALIAS'] = $tmp[0];
                                                $dnsadresse['cname'][$m]['HOST'] = $tmp[1];
                                                $m++;
                                        }
                                }
                        }
                }
        }
        if (preg_match("/^(domain=\/)/", trim($line))){ // on parse toutes les lignes commencant par "domain="
                if (strpos($line,"/")!==false){
                        $tmp = explode("/",$line);
                        if (count($tmp) == 3) {
                                $dnsadresse['domain'][$o]['DOMAIN'] = $tmp[1];
                                $dnsadresse['domain'][$o]['IPADDR'] = $tmp[2];
                                $o++;
                        }
                }
        }
}
$n = 0;
$m = 0;
$o = 0;
/*
ethers parser
BUG COOVA PRESENT : LE CHAMP DESCRIPTION EST TOUJOURS VIDE (bug à vérifier)

refaire une expression régulaire pour ne matcher que les lignes avec des mac, ou laisser tel quel afin de voir les erreurs dans le fichier de conf?

*/

$lines = file(ALCASAR_ETHERS);
$ethers = array();
$n = 0;
foreach($lines as $line)
{
    if (preg_match('/^[[:space:]]*#/',$line)) // on ignore les commentaires (ligne d&eacute;butant par #)
                        continue;       
        $tmp = preg_split("/\s/",$line,2);
        if (count($tmp) == 2) {
                $ethers[$n]['MAC'] = trim($tmp[0]);
                        
                if (strpos($line,"#")!==false){ //si pr&eacute;sence de commentaire
                        $tmp2 = explode("#",$tmp[1],2);
                        
                        $ethers[$n]['IPADDR']= trim($tmp2[0]);
                        $ethers[$n]['DESCRIPTION']= trim($tmp2[1]);
                } else {                                                        //si absence de commentaire
                        $ethers[$n]['IPADDR']= trim($tmp[1]);
                        $ethers[$n]['DESCRIPTION']= "";
                }
                $n++;
        }
}


// Fonction de test de connectivité internet
function internetTest(){
        $host = "www.google.fr"; # Google Test
        $port = "80";
        //var $num;     //non utilisé
        //var $error;   //non utilisé
        
        if (! $sock = @fsockopen($host, $port, $num, $error, 5)) {
                return false;
        } else {
                fclose($sock);
                return true;
        }
}
/********************************************************************
*                                               AFFICHAGE DE LA PAGE                                            *
*********************************************************************/
?><!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN//2.0">
<html>
<head>
<title>Network page</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- include default CSS -->
<link rel="stylesheet" href="<?php echo ALCASAR_ADMIN_PATH_CSS; ?>/default/default.css" type="text/css">
<!-- include JQUERY UI CSS -->
<link type="text/css"  rel="stylesheet" href="<?php echo ALCASAR_ADMIN_PATH_CSS; ?>/default/ui-lightness/jquery-ui-1.8.10.custom.css">
<!-- include custom page CSS -->
<style type="text/css">
.tablewidth {
        width:550px;
}
</style>
<!-- include JQUERY -->
<script type="text/javascript" src="<?php echo ALCASAR_ADMIN_PATH_JS; ?>/jquery-1.5.min.js"></script>
<!-- include JQUERY UI -->
<script type="text/javascript" src="<?php echo ALCASAR_ADMIN_PATH_JS; ?>/jquery-ui-1.8.10.all.min.js"></script>
<!-- include page javascript -->
<script type="text/javascript">
$(function(){
        $("a").attr("target", "content");
        // Tabs
        $('#tabs').tabs();
        $( "button, input:submit, input:button, input:reset").button();
        
        // NetMask-CIDR for all network interfaces
        $('#WAN-cidr').change(function () {
                $('#WAN-mask').val(CIDRToNetmask($('#WAN-cidr').val()));
        });
        $('#WAN-mask').change(function () {
                $('#WAN-cidr').val(netmaskToCIDR($('#WAN-mask').val()));
        });
        $('#LAN-cidr').change(function () {
                $('#LAN-mask').val(CIDRToNetmask($('#LAN-cidr').val()));
        });
        $('#LAN-mask').change(function () {
                $('#LAN-cidr').val(netmaskToCIDR($('#LAN-mask').val()));
        });

});

function h_fillbitsfromleft(num)
{
        /*
        author : Guido Socher (script from tuxgraphics.org)
        */
    if (num >= 8 ){
        return(255);
    }
    bitpat=0xff00; 
    while (num > 0){
        bitpat=bitpat >> 1;
        num--;
    }
    return(bitpat & 0xff);
}
function h_countbitsfromleft(num)
{
        /*
        author : Guido Socher (script from tuxgraphics.org)
        */
    if (num == 255 ){
        return(8);
    }
    i = 0;
    bitpat=0xff00; 
    while (i < 8){
        if (num == (bitpat & 0xff)){
            return(i);
        }
        bitpat=bitpat >> 1;
        i++;
    }
    return(Number.NaN);
}
function netmaskToCIDR(mask){
        //test netmask
        if (!isNetMask(mask)) return false;
        //calculate CIDR
        var bits = mask.split('.');
        sumofbits=0;
        for(bit in bits){
                tmpvar = parseInt(bits[bit],10);
                if (isNaN(tmpvar)){
                        return false;
                }
                bitsfromleft=h_countbitsfromleft(tmpvar);
                if (isNaN(bitsfromleft)){
                        return false;
                }
                sumofbits+=bitsfromleft;
        }
        //return CIDR
        return sumofbits;
}
function isIpV4(ip){
        var bits = ip.split('.');
        var regEx = /[^0-9]/;
        if (bits.length !=4){
                return false;
        }
        for(bit in bits){
                if ((bits[bit]=='')||(bits[bit].length>3)||(regEx.test(bits[bit]))){
                        return false;
                }
        }
        if (parseInt(bits[0],10)==0){
                return false;
        }
        return true;
}
function isNetMask(mask){
        var bits = mask.split('.');
        var regEx = /[^0-9]/;
        if (bits.length !=4)
        {
                return false;
        }
        for(bit in bits){
                if ((bits[bit]=='')||(bits[bit].length>3)||(regEx.test(bits[bit]))){
                        return false;
                }
        }
        if (parseInt(bits[0],10) != 255){
                if ((parseInt(bits[1],10) != 0)) return false;
                if ((parseInt(bits[2],10) != 0)) return false;
                if ((parseInt(bits[3],10) != 0)) return false;
        }
        if (parseInt(bits[1],10) != 255){
                if ((parseInt(bits[2],10) != 0)) return false;
                if ((parseInt(bits[3],10) != 0)) return false;
        }
        if (parseInt(bits[2],10) != 255){
                if ((parseInt(bits[3],10) != 0)) return false;
        }
        return true;
}

function CIDRToNetmask(cidr){
        //test CIDR
        //format : 0 < cidr < 33
        cidr = parseInt(cidr,10);
        if ((isNaN(cidr))||(cidr > 32)||(cidr < 0)) return false;
        
        //calculate Netmask
        bit1 = "";
        bit2 = "";
        bit3 = "";
        bit4 = "";
        if (cidr<=8){
                bit1 = h_fillbitsfromleft(cidr);
                bit2 = "0";
                bit3 = "0";
                bit4 = "0";
        } else if (cidr<=16){
                bit1 = "255";
                bit2 = h_fillbitsfromleft(cidr-8);
                bit3 = "0";
                bit4 = "0";
        } else if (cidr<=24){
                bit1 = "255";
                bit2 = "255";
                bit3 = h_fillbitsfromleft(cidr-16);
                bit4 = "0";
        } else if (cidr<=32){
                bit1 = "255";
                bit2 = "255";
                bit3 = "255";
                bit4 = h_fillbitsfromleft(cidr-24);
        } else {
                return false;
        }
        //return Netmask
        return bit1+"."+bit2+"."+bit3+"."+bit4
}
</script>
</head>
<body>
        <div id="tabs">
                <ul>
                        <li><a href="#tabs-wan"><?php echo $l_wan; ?></a></li>
                        <li><a href="#tabs-lan"><?php echo $l_lan; ?></a></li>
                        <li><a href="#tabs-dns-local"><?php echo $l_local_dns; ?></a></li>
                        <li><a href="#tabs-dhcp"><?php echo $l_dhcp; ?> et réseravation IP</a></li>
                        <!--
                        <li><a href="#tabs-route"><?php echo $l_route; ?></a></li>
                        <li><a href="#tabs-filter">Filtrage MAC</a></li>
                        -->
                </ul>
                <!--  -->
                <div id="tabs-wan">
                        <form method="post" name="form_wan" action="<?php echo $_SERVER['PHP_SELF']; ?>">
                                <table class="ui-widget ui-widget-content tablewidth">
                                <thead>
                                <tr class="ui-widget-header"><th colspan="2"><?php echo $l_internet_title; ?></th></tr>
                                </head>
                                <tbody>
                                <tr><td><?php echo $l_state; ?> :</td>
                                <td><?php
                                if (InternetTest()){
                                        echo " <img src='../images/state_ok.gif'> $l_enable";
                                        $IP_PUB = exec ("wget http://checkip.dyndns.org/ -O - -o /dev/null | cut -d: -f 2 | cut -d\< -f 1");}
                                else    {
                                        echo " <img src='../images/state_error.gif'> $l_disable";
                                        $IP_PUB = "-.-.-.-";
                                }
                                ?>
                                </td></tr>
                                <tr><td><?php echo $l_ip_public; ?> :</td><td><?php //echo $IP_PUB; ?></td></tr>
                                <tr><td colspan="2"><br /></td></tr>
                                <tr class="ui-widget-header"><th colspan="2"><?php echo $l_eth0_title; ?></th></tr>
                                <tr><td><?php echo $l_ip; ?> :</td>
                                <td>
                                <input type="text" name="WAN-ip" id="WAN-ip" value="<?php echo $PUBLIC_IP[0]; ?>" class="text"> /<input type="text" name="WAN-cidr" id="WAN-cidr" value="<?php echo $PUBLIC_IP[1]; ?>" class="text" size="2" maxlength="2">
                                </td>
                                </tr>
                                <tr><td><?php echo $l_mask; ?> :</td><td>
                                <input type="text" name="WAN-mask" id="WAN-mask" value="<?php echo $PUBLIC_IP_NETMASK ; ?>" class="text">
                                </td></tr>
                                <tr><td><?php echo $l_gateway; ?> :</td><td>
                                <input type="text" name="WAN-gateway" id="WAN-gateway" value="<?php echo $alcasar_conf["GW"]; ?>" class="text">
                                </td></tr>
                                <tr><td><?php echo $l_dns; ?> 1 :</td><td>
                                <input type="text" name="WAN-dns1" id="WAN-dns1" value="<?php echo $alcasar_conf["DNS1"]; ?>" class="text">
                                </td></tr>
                                <tr><td><?php echo $l_dns; ?> 2 :</td><td>
                                <input type="text" name="WAN-dns2" id="WAN-dns2" value="<?php echo $alcasar_conf["DNS2"]; ?>" class="text">
                                </td></tr>
                                <tr><td colspan ="2"><br /></td></tr>
                                <tr><td><input type="submit" value="<?php echo $l_change; ?>" class="text"></td><td><br /></td></tr>
                                </tbody>
                                </table>
                                </form>
                </div>
                <div id="tabs-lan">
                        <form method="post" name="form_lan" action="<?php echo $_SERVER['PHP_SELF']; ?>">
                                <table class="ui-widget ui-widget-content tablewidth">
                                <thead>
                                <tr class="ui-widget-header"><th colspan="2"><?php echo $l_eth1_title; ?></th></tr>
                                </thead>
                                <tbody>
                                <tr><td><?php echo $l_ip; ?> :</td><td><input type="text" name="eth0-ip" id="eth0-ip" value="<?php echo $PRIVATE_IP[0]; ?>" class="text"> /<input type="text" name="LAN-cidr" id="LAN-cidr" value="<?php echo $PRIVATE_IP[1]; ?>" class="text" size="2" maxlength="2"></td></tr>
                                <tr><td><?php echo $l_mask; ?> :</td><td><input type="text" name="eth0-ip" id="eth0-ip" value="<?php echo $PRIVATE_IP_NETMASK; ?>" class="text"></td></tr>
                                <tr><td colspan ="2"><br /></td></tr>
                                <tr><td><input type="submit" value="Modifier" class="text"></td><td><br /></td></tr>
                                </tbody>
                                </table>
                        </form>
                </div>
                <div id="tabs-dns-local">
                <font color='red' size="8">Une liste par type d'entrée DNS (exemple actuel), ou un seul tableau global avec tri et colonne indiquant le type?</font>
                <br />
                <h2>Liste des hôtes DNS</h2>
                        <table border="0" id="dns-local" class="ui-widget ui-widget-content tablewidth">
                                <thead>
                                <tr class="ui-widget-header"><th><?php echo $l_ip_row_title; ?></th><th></th><th><?php echo $l_host_row_title; ?></th><th class="col_action" scope="col" colspan="2"></th></tr>
                                </thead>
                                <tbody>
                                <?php
                                foreach ($dnsadresse['address'] as $dns_adress){
                                ?>
                                <tr>
                                        <td><?php echo $dns_adress['IPADDR']; ?></td>
                                        <td> </td>
                                        <td><?php echo $dns_adress['DNSNAME']; ?></td>
                                        <td class="col_action" colspan="2"><image src="<?php echo ALCASAR_ADMIN_PATH_IMG; ?>/delete.png"></td>
                                </tr>
                                <?php
                                }
                                ?>
                                <tr>
                                        <td>
                                        <input type="text" readonly="readonly" value="192" maxlength="3" size="3" class="readonly" name="dhcp_static_ipaddr_p0" id="dhcp_static_ipaddr_p0">.
                                        <input type="text" readonly="readonly" value="168" maxlength="3" size="3" class="readonly" name="dhcp_static_ipaddr_p1" id="dhcp_static_ipaddr_p1">.
                                        <input type="text" readonly="readonly" value="182" maxlength="3" size="3" class="readonly" name="dhcp_static_ipaddr_p2" id="dhcp_static_ipaddr_p2">.
                                        <input type="text" value="" maxlength="3" size="3" class="text" name="dhcp_static_ipaddr_p3" id="dhcp_static_ipaddr_p3">
                                        </td>
                                        <td> </td>
                                        <td>
                                        <input type="text" value="" maxlength="100" size="50" class="text" name="dhcp_static_macaddr_p0" id="dhcp_static_macaddr_p0">
                                        </td>
                                        <td class="col_action"><image src="<?php echo ALCASAR_ADMIN_PATH_IMG; ?>/add.png"></td>
                                        <td class="col_action"><image src="<?php echo ALCASAR_ADMIN_PATH_IMG; ?>/chart_organisation.png"></td>
                                </tr>
                                </tbody>
                        </table>
                        <h2>Liste des alias DNS</h2>
                        <table border="0" id="dns-local" class="ui-widget ui-widget-content tablewidth">
                                <thead>
                                <tr class="ui-widget-header"><th><?php echo $l_host_row_title; ?></th><th></th><th>Alias</th><th class="col_action" scope="col" colspan="2"></th></tr>
                                </thead>
                                <tbody>
                                <?php
                                foreach ($dnsadresse['cname'] as $dns_adress){
                                ?>
                                <tr>
                                        <td><?php echo $dns_adress['HOST']; ?></td>
                                        <td> </td>
                                        <td><?php echo $dns_adress['ALIAS']; ?></td>
                                        <td class="col_action" colspan="2"><image src="<?php echo ALCASAR_ADMIN_PATH_IMG; ?>/delete.png"></td>
                                </tr>
                                <?php
                                }
                                ?>
                                <tr>
                                        <td>
                                        <input type="text" value="" maxlength="100" size="30" class="text" name="alias_host_name" id="alias_host_name">
                                        </td>
                                        <td> </td>
                                        <td>
                                        <input type="text" value="" maxlength="100" size="30" class="text" name="alias_alias_name" id="alias_alias_name">
                                        </td>
                                        <td class="col_action"><image src="<?php echo ALCASAR_ADMIN_PATH_IMG; ?>/add.png"></td>
                                        <td class="col_action"><image src="<?php echo ALCASAR_ADMIN_PATH_IMG; ?>/chart_organisation.png"></td>
                                </tr>
                                </tbody>
                        </table>
                        
                        <h2>Liste des domaines locaux</h2>
                        <table border="0" id="dns-local" class="ui-widget ui-widget-content tablewidth">
                                <thead>
                                <tr class="ui-widget-header"><th>Adresse IP serveur DNS</th><th></th><th>Domaine</th><th class="col_action" scope="col" colspan="2"></th></tr>
                                </thead>
                                <tbody>
                                <?php
                                foreach ($dnsadresse['domain'] as $dns_adress){
                                ?>
                                <tr>
                                        <td><?php echo $dns_adress['IPADDR']; ?></td>
                                        <td> </td>
                                        <td><?php echo $dns_adress['DOMAIN']; ?></td>
                                        <td class="col_action" colspan="2"><image src="<?php echo ALCASAR_ADMIN_PATH_IMG; ?>/delete.png"></td>
                                </tr>
                                <?php
                                }
                                ?>
                                <tr>
                                        <td>
                                        <input type="text" readonly="readonly" value="192" maxlength="3" size="3" class="readonly" name="dhcp_static_ipaddr_p0" id="dhcp_static_ipaddr_p0">.
                                        <input type="text" readonly="readonly" value="168" maxlength="3" size="3" class="readonly" name="dhcp_static_ipaddr_p1" id="dhcp_static_ipaddr_p1">.
                                        <input type="text" readonly="readonly" value="182" maxlength="3" size="3" class="readonly" name="dhcp_static_ipaddr_p2" id="dhcp_static_ipaddr_p2">.
                                        <input type="text" value="" maxlength="3" size="3" class="text" name="dhcp_static_ipaddr_p3" id="dhcp_static_ipaddr_p3">
                                        </td>
                                        <td> </td>
                                        <td>
                                        <input type="text" value="" maxlength="100" size="50" class="text" name="dhcp_static_macaddr_p0" id="dhcp_static_macaddr_p0">
                                        </td>
                                        <td class="col_action"><image src="<?php echo ALCASAR_ADMIN_PATH_IMG; ?>/add.png"></td>
                                        <td class="col_action"><image src="<?php echo ALCASAR_ADMIN_PATH_IMG; ?>/chart_organisation.png"></td>
                                </tr>
                                </tbody>
                        </table>
                </div>
                <div id="tabs-dhcp">
                        <div id="dhcp">
                                <div id="div_dhcp_conf">
                                        <h3 class="ui-widget-header"><?php echo $l_dhcp_server; ?></h3>
                                        <form name="form_dhcp" action="<?php echo $_SERVER['PHP_SELF']; ?>" id="dhcp_conf_form">
                                        
                                        <table class="ui-widget ui-widget-content tablewidth">
                                        <tr><td><?php echo $l_dhcp_activation; ?> :</td>
                                        <td>
                                                <select name="" class="text">
                                                <option><?php echo $l_yes; ?></option>
                                                <option><?php echo $l_no; ?></option>
                                                </select>
                                        </td>
                                        </tr>
                                        <tr>
                                        <td>DHCP start :</td>
                                        <td>
                                                <input type="text" readonly="readonly" value="192" maxlength="3" size="3" class="readonly" name="dhcp_static_ipaddr_p0" id="dhcp_static_ipaddr_p0">.
                                                <input type="text" readonly="readonly" value="168" maxlength="3" size="3" class="readonly" name="dhcp_static_ipaddr_p1" id="dhcp_static_ipaddr_p1">.
                                                <input type="text" readonly="readonly" value="182" maxlength="3" size="3" class="readonly" name="dhcp_static_ipaddr_p2" id="dhcp_static_ipaddr_p2">.
                                                <input type="text" value="" maxlength="3" size="3" class="text" name="dhcp_static_ipaddr_p3" id="dhcp_static_ipaddr_p3">
                                        </td>
                                        </tr>
                                        <tr><td>DHCP stop :</td><td>
                                                <input type="text" readonly="readonly" value="192" maxlength="3" size="3" class="readonly" name="dhcp_static_ipaddr_p0" id="dhcp_static_ipaddr_p0">.
                                                <input type="text" readonly="readonly" value="168" maxlength="3" size="3" class="readonly" name="dhcp_static_ipaddr_p1" id="dhcp_static_ipaddr_p1">.
                                                <input type="text" readonly="readonly" value="182" maxlength="3" size="3" class="readonly" name="dhcp_static_ipaddr_p2" id="dhcp_static_ipaddr_p2">.
                                                <input type="text" value="" maxlength="3" size="3" class="text" name="dhcp_static_ipaddr_p3" id="dhcp_static_ipaddr_p3">
                                        </td>
                                        </tr>
                                        <tr><td>MTU :</td><td><input type="text" value="1500 (conf)" maxlength="8" size="8" class="text" name="" id=""></td></tr>
                                        <tr><td><?php echo $l_dhcp_bail; ?> :</td><td><input type="text" value="600 (conf)" maxlength="8" size="8" class="text" name="" id=""></td></tr>
                                        <tr><td>Grâce :</td><td><input type="text" value="60 (conf)" maxlength="8" size="8" class="text" name="" id=""></td></tr>
                                        <tr><td colspan ="2"><br /></td></tr>
                                        <tr><td><input type="submit" value="Modifier" class="text"></td><td></td></tr>
                                        </table>
                                        <br />
                                        <?php echo $l_dhcp_description; ?>
                                        </form>
                                </div>
                                <br /><br />

                        
                                <div id="div_dhcp_statique">
                                <h3><?php echo $l_dhcp_ip_statique; ?></h3>
                                <table border="0" id="dhcp_static" class="ui-widget ui-widget-content">
                                        <thead>
                                        <tr class="ui-widget-header"><th><?php echo $l_ip_row_title; ?></th><th></th><th><?php echo $l_mac_row_title; ?></th><th></th><th><?php echo $l_description_row_title; ?></th><th class="col_action" scope="col" colspan="2"></th></tr>
                                        </thead>
                                        <tbody>
                                        <?php
                                        foreach ($ethers as $ip_static){
                                        ?>
                                        <tr>
                                                <td><?php echo $ip_static['IPADDR']; ?></td>
                                                <td> </td>
                                                <td><?php echo $ip_static['MAC']; ?></td>
                                                <td> </td>
                                                <td><?php echo $ip_static['DESCRIPTION']; ?></td>
                                                <td class="col_action" colspan="2"><image src="<?php echo ALCASAR_ADMIN_PATH_IMG; ?>/delete.png"></td>
                                        </tr>
                                        <?php
                                        }
                                        ?>
                                        <tr>
                                                <td>
                                                <input type="text" readonly="readonly" value="192" maxlength="3" size="3" class="readonly" name="dhcp_static_ipaddr_p0" id="dhcp_static_ipaddr_p0">.
                                                <input type="text" readonly="readonly" value="192" maxlength="3" size="3" class="readonly" name="dhcp_static_ipaddr_p1" id="dhcp_static_ipaddr_p1">.
                                                <input type="text" readonly="readonly" value="192" maxlength="3" size="3" class="readonly" name="dhcp_static_ipaddr_p2" id="dhcp_static_ipaddr_p2">.
                                                <input type="text" value="" maxlength="3" size="3" class="text" name="dhcp_static_ipaddr_p3" id="dhcp_static_ipaddr_p3">
                                                </td>
                                                <td> </td>
                                                <td>
                                                <input type="text" value="" maxlength="2" size="2" class="text" name="dhcp_static_macaddr_p0" id="dhcp_static_macaddr_p0">:
                                                <input type="text" value="" maxlength="2" size="2" class="text" name="dhcp_static_macaddr_p1" id="dhcp_static_macaddr_p1">:
                                                <input type="text" value="" maxlength="2" size="2" class="text" name="dhcp_static_macaddr_p2" id="dhcp_static_macaddr_p2">:
                                                <input type="text" value="" maxlength="2" size="2" class="text" name="dhcp_static_macaddr_p3" id="dhcp_static_macaddr_p3">:
                                                <input type="text" value="" maxlength="2" size="2" class="text" name="dhcp_static_macaddr_p4" id="dhcp_static_macaddr_p4">:
                                                <input type="text" value="" maxlength="2" size="2" class="text" name="dhcp_static_macaddr_p5" id="dhcp_static_macaddr_p0">
                                                </td>
                                                <td> </td>
                                                <td><input type="text" value="" maxlength="20" size="20" class="text" name="dhcp_static_description" id="dhcp_static_description"></td>
                                                <td class="col_action"><image src="<?php echo ALCASAR_ADMIN_PATH_IMG; ?>/add.png"></td>
                                                <td class="col_action"><image src="<?php echo ALCASAR_ADMIN_PATH_IMG; ?>/chart_organisation.png"></td>
                                        </tr>
                                        </tbody>
                                </table>
                                </div>
                        </div>
                </div>
                <!--
                <div id="tabs-route">
                        Alcasar est la passerelle par défaut des postes du réseau de consulation.<br />
                        Si un réseau est accessible par une autre passerelle présente sur le réseau de consultation vous pouvez le préciser içi.<br />
                        <br />
                        <table border="0" id="route" class="ui-widget ui-widget-content">
                                <thead>
                                <tr class="ui-widget-header"><th><?php echo $l_destination_row_title; ?></th><th></th><th><?php echo $l_mask_row_title; ?></th><th><?php echo $l_gateway_row_title; ?></th><th class="col_action" scope="col" colspan="2"></th></tr>
                                </thead>
                                <tbody>
                                <?php
                                $route_list = array();// a faire
                                //foreach ($route_list as $route){
                                ?>
                                <tr>
                                        <td><?php //echo $route['DESTINATION']; ?>DESTINATION</td>
                                        <td> </td>
                                        <td><?php //echo $route['NETMASK']; ?>NETMASK</td>
                                        <td><?php //echo $route['GATEWAY']; ?>GATEWAY</td>
                                        <td class="col_action" colspan="2"><image src="<?php echo ALCASAR_ADMIN_PATH_IMG; ?>/delete.png"></td>
                                </tr>
                                <?php
                                //}
                                ?>
                                <tr>
                                        <td>
                                        <input type="text" value="" maxlength="3" size="3" class="text" name="dhcp_static_ipaddr_p0" id="dhcp_static_ipaddr_p0">.
                                        <input type="text" value="" maxlength="3" size="3" class="text" name="dhcp_static_ipaddr_p1" id="dhcp_static_ipaddr_p1">.
                                        <input type="text" value="" maxlength="3" size="3" class="text" name="dhcp_static_ipaddr_p2" id="dhcp_static_ipaddr_p2">.
                                        <input type="text" value="" maxlength="3" size="3" class="text" name="dhcp_static_ipaddr_p3" id="dhcp_static_ipaddr_p3">
                                        </td>
                                        <td> </td>
                                        <td>
                                        <input type="text" value="255" maxlength="3" size="3" class="text" name="dhcp_static_ipaddr_p0" id="dhcp_static_ipaddr_p0">.
                                        <input type="text" value="255" maxlength="3" size="3" class="text" name="dhcp_static_ipaddr_p1" id="dhcp_static_ipaddr_p1">.
                                        <input type="text" value="255" maxlength="3" size="3" class="text" name="dhcp_static_ipaddr_p2" id="dhcp_static_ipaddr_p2">.
                                        <input type="text" value="0" maxlength="3" size="3" class="text" name="dhcp_static_ipaddr_p3" id="dhcp_static_ipaddr_p3">
                                        </td>
                                        <td>
                                        <input type="text" readonly="readonly" value="192" maxlength="3" size="3" class="readonly" name="dhcp_static_ipaddr_p0" id="dhcp_static_ipaddr_p0">.
                                        <input type="text" readonly="readonly" value="168" maxlength="3" size="3" class="readonly" name="dhcp_static_ipaddr_p1" id="dhcp_static_ipaddr_p1">.
                                        <input type="text" readonly="readonly" value="182" maxlength="3" size="3" class="readonly" name="dhcp_static_ipaddr_p2" id="dhcp_static_ipaddr_p2">.
                                        <input type="text" value="" maxlength="3" size="3" class="text" name="dhcp_static_ipaddr_p3" id="dhcp_static_ipaddr_p3">
                                        </td>
                                        <td class="col_action"><image src="<?php echo ALCASAR_ADMIN_PATH_IMG; ?>/add.png"></td>
                                        <td class="col_action"></td>
                                </tr>
                                </tbody>
                        </table>
                </div>
                <div id="tabs-filter">
                        <h1>Filtrage MAC</h1>
                        <form>
                        <table><tr><td>Activation du filtrage</td><td><input type="radio">activé <input type="radio">désactivé</td></tr></table>
                        </form>
                        <h1>Adresses MAC autorisées</h1>
                        <form>
                        <table border="0" id="dhcp_static" class="ui-widget ui-widget-content">
                                        <thead>
                                        <tr class="ui-widget-header"><th>#</th><th><?php echo $l_mac_row_title; ?></th><th></th><th class="col_action" scope="col" colspan="2"></th></tr>
                                        </thead>
                                        <tbody>
                                        <?php
                                        //foreach ($ethers as $ip_static){
                                        ?>
                                        <tr>
                                                <td>1</td>
                                                <td>08:00:55:DF:EE:00</td>
                                                <td>station de toto</td>
                                                <td class="col_action" colspan="2"><image src="<?php echo ALCASAR_ADMIN_PATH_IMG; ?>/delete.png"></td>
                                        </tr>
                                        <?php
                                        //}
                                        ?>
                                        <tr>
                                                <td> </td>
                                                <td>
                                                <input type="text" value="" maxlength="2" size="2" class="text" name="dhcp_static_macaddr_p0" id="dhcp_static_macaddr_p0">:
                                                <input type="text" value="" maxlength="2" size="2" class="text" name="dhcp_static_macaddr_p1" id="dhcp_static_macaddr_p1">:
                                                <input type="text" value="" maxlength="2" size="2" class="text" name="dhcp_static_macaddr_p2" id="dhcp_static_macaddr_p2">:
                                                <input type="text" value="" maxlength="2" size="2" class="text" name="dhcp_static_macaddr_p3" id="dhcp_static_macaddr_p3">:
                                                <input type="text" value="" maxlength="2" size="2" class="text" name="dhcp_static_macaddr_p4" id="dhcp_static_macaddr_p4">:
                                                <input type="text" value="" maxlength="2" size="2" class="text" name="dhcp_static_macaddr_p5" id="dhcp_static_macaddr_p0">
                                                </td>
                                                <td><input type="text" value="" maxlength="20" size="20" class="text" name="dhcp_static_description" id="dhcp_static_description"></td>
                                                <td class="col_action"><image src="<?php echo ALCASAR_ADMIN_PATH_IMG; ?>/add.png"></td>
                                                <td class="col_action"><image src="<?php echo ALCASAR_ADMIN_PATH_IMG; ?>/chart_organisation.png"></td>
                                        </tr>
                                        </tbody>
                                </table>
                        </form>
                </div>
                -->
        </div>
</body>
</html>

Generated by GNU Enscript 1.6.6.