Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 2716 → Rev 2717

/web/acc/admin/network.php
56,11 → 56,7
$l_DHCP_on = "actif";
$l_DHCP_off = "inactif";
$l_DHCP_off_explain = "/!\\ Avant d'arrêter le serveur DHCP, vous devez renseigner les paramètres d'un serveur externe (cf. documentation).";
$l_static_dhcp_title = "Réservation d'adresses IP statiques";
$l_dhcp_relay = "Relais DHCP";
$l_dhcp_relay_local_ip = "Adresse IP locale";
$l_dhcp_relay_ip = "Adresse IP DHCP";
$l_dhcp_relay_port = "Port DHCP";
$l_static_dhcp_title = "Réservation d'adresses IP statiques (DHCP)";
$l_mac_address = "Adresse MAC";
$l_ip_address = "Adresse IP";
$l_host_name = "Nom d'hôte";
67,9 → 63,7
$l_del = "Supprimer de la liste";
$l_add_to_list = "Ajouter";
$l_apply = "Appliquer les changements";
$l_dns_title = "Service DNS";
$l_local_dns = "Résolution local de nom";
$l_dns_internal = "Serveur DNS interne";
$l_local_dns = "Résolution local de nom (DNS)";
$l_import_cert = "Import de certificat";
$l_private_key = "Clé privée (.key) :";
$l_certificate = "Certificat (.crt) :";
116,11 → 110,7
$l_DHCP_on = "enabled";
$l_DHCP_off = "disabled";
$l_DHCP_off_explain = "/!\\ Before disabling the DHCP server, you must write the extern DHCP parameters in the config file (see Documentation)";
$l_static_dhcp_title = "Static IP addresses reservation";
$l_dhcp_relay = "DHCP relay";
$l_dhcp_relay_local_ip = "Locale IP address";
$l_dhcp_relay_ip = "DHCP IP address";
$l_dhcp_relay_port = "DHCP port";
$l_static_dhcp_title = "Static IP addresses reservation (DHCP)";
$l_mac_address = "MAC address";
$l_ip_address = "IP address";
$l_port = "Port";
128,9 → 118,7
$l_del = "Delete from list";
$l_add_to_list = "Add";
$l_apply = "Apply changes";
$l_dns_title = "DNS service";
$l_local_dns = "Local name resolution";
$l_dns_internal = "DNS internal";
$l_local_dns = "Local name resolution (DNS";
$l_import_cert = "Certificate import";
$l_private_key = "Private key (.key) :";
$l_certificate = "Certificate (.crt) :";
231,14 → 219,6
header('Location: '.$_SERVER['PHP_SELF']);
exit();
 
case 'dhcp_relay': // DHCP relay
// TODO : check DHCP relay before apply?
file_put_contents(CONF_FILE, str_replace('EXT_DHCP_IP='.$conf['EXT_DHCP_IP'], 'EXT_DHCP_IP='.trim($_POST['dhcp_relay_ext_ip']), file_get_contents(CONF_FILE)));
file_put_contents(CONF_FILE, str_replace('RELAY_DHCP_IP='.$conf['RELAY_DHCP_IP'], 'RELAY_DHCP_IP='.trim($_POST['dhcp_relay_ip']), file_get_contents(CONF_FILE)));
file_put_contents(CONF_FILE, str_replace('RELAY_DHCP_PORT='.$conf['RELAY_DHCP_PORT'], 'RELAY_DHCP_PORT='.trim($_POST['dhcp_relay_port']), file_get_contents(CONF_FILE)));
header('Location: '.$_SERVER['PHP_SELF']);
exit();
 
case 'new_host':
$add_host = trim($_POST['add_host']);
$add_ip = trim($_POST['add_ip']);
275,18 → 255,6
header('Location: '.$_SERVER['PHP_SELF']);
exit();
 
case 'dns_internal': // Internal DNS
// TODO : check @IP / domain before apply? (can break DNS server and shut down the Internet!)
file_put_contents(CONF_FILE, str_replace('INT_DNS_IP='.$conf['INT_DNS_IP'], 'INT_DNS_IP='.trim($_POST['dns_internal_ip']), file_get_contents(CONF_FILE)));
file_put_contents(CONF_FILE, str_replace('INT_DNS_DOMAIN='.$conf['INT_DNS_DOMAIN'], 'INT_DNS_DOMAIN='.trim($_POST['dns_internal_domain']), file_get_contents(CONF_FILE)));
if ($_POST['dns_internal_active'] === 'on') {
exec('sudo /usr/local/bin/alcasar-dns-local.sh --on');
} else {
exec('sudo /usr/local/bin/alcasar-dns-local.sh --off');
}
header('Location: '.$_SERVER['PHP_SELF']);
exit();
 
case 'default_cert': // Restore default certificate
exec('sudo alcasar-importcert.sh -d');
break;
702,24 → 670,10
<br>
 
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><th><?= $l_dhcp_title?></th></tr>
<tr><th><?= $l_static_dhcp_title?></th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
</table>
<table width="100%" cellspacing="0" cellpadding="5" border="1">
<tr><td colspan="2" valign="middle" align="left">
<center><h3><?= $l_dhcp_state ?> : <?= ${'l_DHCP_'.$conf['DHCP']} ?></h3></center>
<form action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST">
<select name="choix">
<option value="DHCP_Off"<?= ((!strcmp($conf['DHCP'], 'off')) ? ' selected' : '') ?>><?= $l_DHCP_off ?></option>
<option value="DHCP_On"<?= ((!strcmp($conf['DHCP'], 'on')) ? ' selected' : '') ?>><?= $l_DHCP_on ?></option>
</select>
<input type="submit" value="<?= $l_apply ?>">
<br><?= $l_DHCP_off_explain ?>
</form>
</td></tr>
 
<?php if ($conf['DHCP'] === 'on'): ?>
<tr><td colspan="2" align="center"><?= $l_static_dhcp_title ?></td></tr>
<tr><td width="50%" align="center" valign="middle">
<form action="network.php" method="POST">
<table cellspacing="2" cellpadding="3" border="1">
775,37 → 729,14
</tr></table>
</form>
</td></tr>
<?php else: ?>
<tr><td colspan="2" align="center"><?= $l_dhcp_relay ?></td></tr>
<tr>
<td colspan="2" align="center">
<form name="new_host" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST">
<table cellspacing="2" cellpadding="3" border="1">
<tr>
<th><label for="dhcp_relay_ip"><?= $l_dhcp_relay_local_ip ?></label></th><td><input type="text" name="dhcp_relay_ip" id="dhcp_relay_ip" value="<?= $conf['RELAY_DHCP_IP'] ?>" size="32"></td>
</tr>
<tr>
<th><label for="dhcp_relay_ext_ip"><?= $l_dhcp_relay_ip ?></label></th><td><input type="text" name="dhcp_relay_ext_ip" id="dhcp_relay_ext_ip" value="<?= $conf['EXT_DHCP_IP'] ?>" size="32"></td>
</tr>
<tr>
<th><label for="dhcp_relay_port"><?= $l_dhcp_relay_port ?></label></th><td><input type="text" name="dhcp_relay_port" id="dhcp_relay_port" value="<?= $conf['RELAY_DHCP_PORT'] ?>" size="32"></td>
</tr>
</table>
<input type="hidden" name="choix" value="dhcp_relay">
<input type="submit" value="<?= $l_apply ?>">
</form>
</td>
</tr>
<?php endif; ?>
</table>
<br>
 
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><th><?= $l_dns_title ?></th></tr>
<tr><th><?= $l_local_dns ?></th></tr>
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
</table>
<table width="100%" cellspacing="0" cellpadding="5" border="1">
<tr><td colspan="2" align="center"><?= $l_local_dns ?></td></tr>
<tr>
<td width="50%" align="center">
<form action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST">
862,32 → 793,6
</form>
</td>
</tr>
<tr><td colspan="2" align="center"><?= $l_dns_internal ?></td></tr>
<tr>
<td colspan="2" align="center">
<form name="new_host" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST">
<table cellspacing="2" cellpadding="3" border="1">
<tr>
<th><?= $l_enabled ?></th>
<td>
<select name="dns_internal_active">
<option value="on"<?= (($conf['INT_DNS_ACTIVE'] === 'on') ? ' selected' : '') ?>><?= $l_yes ?></option>
<option value="off"<?= (($conf['INT_DNS_ACTIVE'] === 'off') ? ' selected' : '') ?>><?= $l_no ?></option>
</select>
</td>
</tr>
<tr>
<th><?= $l_ip_address ?></th><td><input type="text" name="dns_internal_ip" value="<?= $conf['INT_DNS_IP'] ?>" size="32"></td>
</tr>
<tr>
<th><?= $l_host_name ?></th><td><input type="text" name="dns_internal_domain" value="<?= $conf['INT_DNS_DOMAIN'] ?>" size="32"></td>
</tr>
</table>
<input type="hidden" name="choix" value="dns_internal">
<input type="submit" value="<?= $l_apply ?>">
</form>
</td>
</tr>
</table>
<br>