7,7 → 7,7 |
define ("CONF_FILE", "/usr/local/etc/alcasar.conf"); |
define ("ETHERS_FILE", "/usr/local/etc/alcasar-ethers"); |
define ("DNS_LOCAL_FILE", "/usr/local/etc/alcasar-dns-name"); |
$conf_files=array(CONF_FILE,ETHERS_FILE); |
$conf_files=array(CONF_FILE,ETHERS_FILE,DNS_LOCAL_FILE); |
$reg_ip = '/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/'; |
$reg_ip_cidr = '/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$/'; |
$network_modification=0; |
53,7 → 53,6 |
$l_import = "Importer"; |
$l_current_certificate = "Certificat actuel"; |
$l_validated = "Validé par :"; |
|
} else { |
$l_network_title = "Network configuration"; |
$l_extif_legend = " (Internet connected interface)"; |
85,7 → 84,6 |
$l_import = "Import"; |
$l_current_certificate = "Current certificate"; |
$l_validated = "Validated by :"; |
|
} |
if (isset($_POST['choix'])){$choix=$_POST['choix'];} else {$choix="";} |
switch ($choix) |
103,16 → 101,18 |
if ($tab) # the file isn't empty |
{ |
$insert="True"; |
$new_mac_addr=trim($_POST['add_mac'],"\x00..\x20"); |
$new_ip_addr=trim($_POST['add_ip'],"\x00..\x20"); |
foreach ($tab as $line) # verify that MAC or IP address doesn't exist |
{ |
$field=explode(" ", $line); |
$mac_addr=trim($field[0]);$ip_addr=trim($field[1]); |
if (strcasecmp(trim($_POST['add_mac']),trim($mac_addr)) == 0) |
if (strcasecmp($new_mac_addr, $mac_addr) == 0) |
{ |
$insert="False"; |
break; |
} |
if (strcasecmp(trim($_POST['add_ip']), trim($ip_addr)) == 0) |
if (strcasecmp($new_ip_addr, $ip_addr) == 0) |
{ |
$insert="False"; |
break; |
120,7 → 120,7 |
} |
if ($insert == "True") |
{ |
$line = trim($_POST['add_mac']) . " " . trim($_POST['add_ip']) . "\n"; |
$line = $new_mac_addr . " " . $new_ip_addr . " #" . trim($_POST['info'],"\x00..\x20") . "\n"; |
$pointeur=fopen(ETHERS_FILE,"a"); |
fwrite ($pointeur, $line); |
fclose ($pointeur); |
415,7 → 415,7 |
echo "<tr><th>$l_host_name<th>$l_ip_address"; |
?> |
<td></td></tr> |
<tr><td>exemple : my_nas</td><td>exemple : 192.168.182.10</td><td></td></tr> |
<tr><td>Ex. : my_nas</td><td>Ex. : 192.168.182.10</td><td></td></tr> |
<tr><td><input type='text' name='add_host' size='17'></td> |
<td><input type='text' name='add_ip' size='10'><input type='hidden' name='choix' value='new_host'></td> |
<td><? echo "<input type=submit class=button value=\"$l_add_to_list\">"?></td> |