From: <abe...@us...> - 2017-01-05 16:49:53
|
Revision: 8080 http://sourceforge.net/p/astlinux/code/8080 Author: abelbeck Date: 2017-01-05 16:49:50 +0000 (Thu, 05 Jan 2017) Log Message: ----------- web interface, Firewall sub-tab, add 'Log Denied attempts by a blocked host' inbound/outbound selectively Modified Paths: -------------- branches/1.0/package/webinterface/altweb/admin/firewall.php Modified: branches/1.0/package/webinterface/altweb/admin/firewall.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/firewall.php 2017-01-05 14:38:12 UTC (rev 8079) +++ branches/1.0/package/webinterface/altweb/admin/firewall.php 2017-01-05 16:49:50 UTC (rev 8080) @@ -1,6 +1,6 @@ <?php -// Copyright (C) 2008-2016 Lonnie Abelbeck +// Copyright (C) 2008-2017 Lonnie Abelbeck // This is free software, licensed under the GNU General Public License // version 3 as published by the Free Software Foundation; you can // redistribute it and/or modify it under the terms of the GNU @@ -23,6 +23,7 @@ // 06-12-2016, Added "Pass LAN->LAN" action // 07-10-2016, Added Deny LAN to DMZ for specified LAN Interfaces // 09-14-2016, Added BLOCK_NETSET_DIR support +// 01-05-2017, Added BLOCKED_HOST_LOG direction support // // System location of /mnt/kd/rc.conf.d directory $FIREWALLCONFDIR = '/mnt/kd/rc.conf.d'; @@ -144,6 +145,13 @@ '1' => 'Deny DMZ->EXT' ); +$log_blocked_label = array ( + '0' => 'Disabled', + '1' => 'Inbound & Outbound', + '2' => 'Inbound only', + '3' => 'Outbound only' +); + // Get arno firewall version //$MY_VERSION = trim(shell_exec('grep -m1 \'^MY_VERSION=\' /usr/sbin/arno-iptables-firewall | sed -e \'s/MY_VERSION=//\' -e \'s/"//g\'')); //$arno_vers = (strncmp($MY_VERSION, '1.8.', 4) == 0) ? 18 : 19; @@ -384,7 +392,7 @@ $value = 'BLOCK_NETSET_DIR="/mnt/kd/blocklists"'; fwrite($fp, $value."\n"); } - $value = 'BLOCKED_HOST_LOG='.(isset($_POST['log_blocked']) ? '1' : '0'); + $value = 'BLOCKED_HOST_LOG="'.$_POST['log_blocked'].'"'; fwrite($fp, $value."\n"); fwrite($fp, "### gui.firewall.conf - end ###\n"); @@ -1120,11 +1128,19 @@ putHtml('<tr class="dtrow1"><td width="75" style="text-align: right;">'); $sel = (getVARdef($vars, 'BLOCK_NETSET_DIR') === '/mnt/kd/blocklists') ? ' checked="checked"' : ''; putHtml('<input type="checkbox" value="block_netset_dir" name="block_netset_dir"'.$sel.' /></td><td>Block Host/CIDR using *.netset file(s) in the directory /mnt/kd/blocklists</td></tr>'); - putHtml('<tr class="dtrow1"><td style="text-align: right;">'); - $sel = (getVARdef($vars, 'BLOCKED_HOST_LOG') == 1) ? ' checked="checked"' : ''; - putHtml('<input type="checkbox" value="log_blocked" name="log_blocked"'.$sel.' /></td><td>Log Denied attempts by a blocked host</td></tr>'); + + putHtml('<tr class="dtrow1"><td width="75" style="text-align: right;"> </td><td>'); + putHtml('Log Denied attempts by a blocked host:'); + $log_blocked = getVARdef($vars, 'BLOCKED_HOST_LOG'); + putHtml('<select name="log_blocked">'); + foreach ($log_blocked_label as $key => $value) { + $sel = ($log_blocked == $key) ? ' selected="selected"' : ''; + putHtml('<option value="'.$key.'"'.$sel.'>'.$value.'</option>'); + } + putHtml('</select>'); + putHtml('</td></tr>'); + putHtml('</table>'); - putHtml('</form>'); putHtml('</center></td></tr></table>'); putHtml('</center>'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |