Subversion Repositories ALCASAR

Rev

Rev 1959 | Rev 2013 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1959 Rev 1960
Line 180... Line 180...
180
				exec ("sudo /usr/bin/systemctl restart dnsmasq-whitelist");
180
				exec ("sudo /usr/bin/systemctl restart dnsmasq-whitelist");
181
				}
181
				}
182
			}
182
			}
183
		}
183
		}
184
	break;
184
	break;
185
case 'del_mac' :
185
case 'del_host' :
186
	foreach ($_POST as $key => $value)
186
	foreach ($_POST as $key => $value)
187
		{
187
		{
188
		if ($value == 'on')
188
		if ($value == 'on')
189
			{
189
			{
190
			$ether_file=ETHERS_FILE;
190
			$dns_local_file=DNS_LOCAL_FILE;
191
			exec("/bin/sed -i \"/^$key/d\" $ether_file"); 
191
			exec("/bin/sed -i \"/$key/d\" $dns_local_file"); 
192
			exec ("sudo /usr/bin/systemctl reload chilli");
192
			exec ("sudo /usr/bin/systemctl restart dnsmasq");
-
 
193
			exec ("sudo /usr/bin/systemctl restart dnsmasq-blacklist");
-
 
194
			exec ("sudo /usr/bin/systemctl restart dnsmasq-whitelist");
193
			}
195
			}
194
		}
196
		}
195
	break;
197
	break;
196
}
198
}
197
 
199
 
Line 385... Line 387...
385
// Read the "dns_local" file
387
// Read the "dns_local" file
386
$line_exist=False;
388
$line_exist=False;
387
$tab=file(DNS_LOCAL_FILE);
389
$tab=file(DNS_LOCAL_FILE);
388
if ($tab)  # not empty
390
if ($tab)  # not empty
389
	{
391
	{
390
	$line_exist=True;
-
 
391
	foreach ($tab as $line)
392
	foreach ($tab as $line)
392
		{
393
		{
393
			if (preg_match ('/^address/', $line))
394
			if (preg_match ('/^address/', $line))
394
			{
395
			{
-
 
396
				$line_exist=True;
395
				$field=explode("/", $line);
397
				$field=explode("/", $line);
396
				$ip_addr=$field[1];
398
				$host_name=$field[1];
397
				$host_name=$field[2];
399
				$ip_addr=$field[2];
398
				echo "<tr><td>$ip_addr";
400
				echo "<tr><td>$host_name";
399
				echo "<td>$host_name";
401
				echo "<td>$ip_addr";
400
				echo "<td><input type='checkbox' name='$host_name'>";
402
				echo "<td><input type='checkbox' name='$host_name'>";
401
				echo "</tr>";
403
				echo "</tr>";
402
			}
404
			}
403
		}
405
		}
404
	}
406
	}