Project

General

Profile

Download (24.1 KB) Statistics
| Branch: | Tag: | Revision:
1 4d875b4f Scott Ullrich
<?php
2 b46bfcf5 Bill Marquette
/* $Id$ */
3 5b237745 Scott Ullrich
/*
4
	diag_logs_settings.php
5 13d193c2 Scott Ullrich
	Copyright (C) 2004-2009 Scott Ullrich
6 dd447bde Jim Thompson
        Copyright (C) 2013-2014 Electric Sheep Fencing, LP
7 4d875b4f Scott Ullrich
	All rights reserved.
8
9 f4462954 Phil Davis
	originally part of m0n0wall (http://m0n0.ch/wall)
10 5b237745 Scott Ullrich
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
11
	All rights reserved.
12 4d875b4f Scott Ullrich
13 5b237745 Scott Ullrich
	Redistribution and use in source and binary forms, with or without
14
	modification, are permitted provided that the following conditions are met:
15 4d875b4f Scott Ullrich
16 5b237745 Scott Ullrich
	1. Redistributions of source code must retain the above copyright notice,
17
	   this list of conditions and the following disclaimer.
18 4d875b4f Scott Ullrich
19 5b237745 Scott Ullrich
	2. Redistributions in binary form must reproduce the above copyright
20
	   notice, this list of conditions and the following disclaimer in the
21
	   documentation and/or other materials provided with the distribution.
22 4d875b4f Scott Ullrich
23 5b237745 Scott Ullrich
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
24
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
25
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
27
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
	POSSIBILITY OF SUCH DAMAGE.
33
*/
34
35 e34a7abb jim-p
/*
36 13d193c2 Scott Ullrich
	pfSense_MODULE:	system
37
*/
38
39 6b07c15a Matthew Grooms
##|+PRIV
40
##|*IDENT=page-diagnostics-logs-settings
41
##|*NAME=Diagnostics: Logs: Settings page
42
##|*DESCR=Allow access to the 'Diagnostics: Logs: Settings' page.
43
##|*MATCH=diag_logs_settings.php*
44
##|-PRIV
45
46 5b237745 Scott Ullrich
require("guiconfig.inc");
47 7a927e67 Scott Ullrich
require_once("functions.inc");
48
require_once("filter.inc");
49
require_once("shaper.inc");
50 5b237745 Scott Ullrich
51
$pconfig['reverse'] = isset($config['syslog']['reverse']);
52
$pconfig['nentries'] = $config['syslog']['nentries'];
53
$pconfig['remoteserver'] = $config['syslog']['remoteserver'];
54 98301932 Scott Ullrich
$pconfig['remoteserver2'] = $config['syslog']['remoteserver2'];
55 be5d59d7 Scott Ullrich
$pconfig['remoteserver3'] = $config['syslog']['remoteserver3'];
56 cbe12b8d jim-p
$pconfig['sourceip'] = $config['syslog']['sourceip'];
57
$pconfig['ipproto'] = $config['syslog']['ipproto'];
58 5b237745 Scott Ullrich
$pconfig['filter'] = isset($config['syslog']['filter']);
59
$pconfig['dhcp'] = isset($config['syslog']['dhcp']);
60 3f2b92d2 Scott Ullrich
$pconfig['portalauth'] = isset($config['syslog']['portalauth']);
61 5b237745 Scott Ullrich
$pconfig['vpn'] = isset($config['syslog']['vpn']);
62 236524c2 jim-p
$pconfig['apinger'] = isset($config['syslog']['apinger']);
63
$pconfig['relayd'] = isset($config['syslog']['relayd']);
64
$pconfig['hostapd'] = isset($config['syslog']['hostapd']);
65 4ef2d703 Chris Buechler
$pconfig['logall'] = isset($config['syslog']['logall']);
66 5b237745 Scott Ullrich
$pconfig['system'] = isset($config['syslog']['system']);
67
$pconfig['enable'] = isset($config['syslog']['enable']);
68
$pconfig['logdefaultblock'] = !isset($config['syslog']['nologdefaultblock']);
69 aa7ec418 Ermal
$pconfig['logdefaultpass'] = isset($config['syslog']['nologdefaultpass']);
70 1cf24f0a jim-p
$pconfig['logbogons'] = !isset($config['syslog']['nologbogons']);
71
$pconfig['logprivatenets'] = !isset($config['syslog']['nologprivatenets']);
72
$pconfig['loglighttpd'] = !isset($config['syslog']['nologlighttpd']);
73 5b237745 Scott Ullrich
$pconfig['rawfilter'] = isset($config['syslog']['rawfilter']);
74 52b27268 PiBa-NL
$pconfig['filterdescriptions'] = $config['syslog']['filterdescriptions'];
75 af659dda Scott Ullrich
$pconfig['disablelocallogging'] = isset($config['syslog']['disablelocallogging']);
76 c7a3356e jim-p
$pconfig['logfilesize'] = $config['syslog']['logfilesize'];
77 5b237745 Scott Ullrich
78
if (!$pconfig['nentries'])
79
	$pconfig['nentries'] = 50;
80
81 d3a2337a jim-p
function is_valid_syslog_server($target) {
82
	return (is_ipaddr($target)
83
		|| is_ipaddrwithport($target)
84
		|| is_hostname($target)
85
		|| is_hostnamewithport($target));
86
}
87
88 c7a3356e jim-p
if ($_POST['resetlogs'] == gettext("Reset Log Files")) {
89
	clear_all_log_files();
90 f4462954 Phil Davis
	$savemsg .= gettext("The log files have been reset.");
91 c7a3356e jim-p
} elseif ($_POST) {
92 5b237745 Scott Ullrich
93
	unset($input_errors);
94
	$pconfig = $_POST;
95
96
	/* input validation */
97 d3a2337a jim-p
	if ($_POST['enable'] && !is_valid_syslog_server($_POST['remoteserver'])) {
98 15c58806 Phil Davis
		$input_errors[] = gettext("A valid IP address/hostname or IP/hostname:port must be specified for remote syslog server #1.");
99 5b237745 Scott Ullrich
	}
100 d3a2337a jim-p
	if ($_POST['enable'] && $_POST['remoteserver2'] && !is_valid_syslog_server($_POST['remoteserver2'])) {
101 15c58806 Phil Davis
		$input_errors[] = gettext("A valid IP address/hostname or IP/hostname:port must be specified for remote syslog server #2.");
102 be5d59d7 Scott Ullrich
	}
103 d3a2337a jim-p
	if ($_POST['enable'] && $_POST['remoteserver3'] && !is_valid_syslog_server($_POST['remoteserver3'])) {
104 15c58806 Phil Davis
		$input_errors[] = gettext("A valid IP address/hostname or IP/hostname:port must be specified for remote syslog server #3.");
105 be5d59d7 Scott Ullrich
	}
106
107 102de157 Scott Ullrich
	if (($_POST['nentries'] < 5) || ($_POST['nentries'] > 2000)) {
108 f8ec8de4 Renato Botelho
		$input_errors[] = gettext("Number of log entries to show must be between 5 and 2000.");
109 5b237745 Scott Ullrich
	}
110
111 c7a3356e jim-p
	if (isset($_POST['logfilesize']) && (strlen($_POST['logfilesize']) > 0)) {
112
		if (!is_numeric($_POST['logfilesize']) || ($_POST['logfilesize'] < 5120)) {
113
			$input_errors[] = gettext("Log file size must be a positive integer greater than 5120.");
114
		}
115
	}
116 5b237745 Scott Ullrich
	if (!$input_errors) {
117
		$config['syslog']['reverse'] = $_POST['reverse'] ? true : false;
118
		$config['syslog']['nentries'] = (int)$_POST['nentries'];
119 f4462954 Phil Davis
		$pconfig['nentries'] = $config['syslog']['nentries'];
120
		if (isset($_POST['logfilesize']) && (strlen($_POST['logfilesize']) > 0)) {
121
			$config['syslog']['logfilesize'] = (int)$_POST['logfilesize'];
122
			$pconfig['logfilesize'] = $config['syslog']['logfilesize'];
123
		} else {
124
			unset($config['syslog']['logfilesize']);
125
		}
126 5b237745 Scott Ullrich
		$config['syslog']['remoteserver'] = $_POST['remoteserver'];
127 be5d59d7 Scott Ullrich
		$config['syslog']['remoteserver2'] = $_POST['remoteserver2'];
128
		$config['syslog']['remoteserver3'] = $_POST['remoteserver3'];
129 cbe12b8d jim-p
		$config['syslog']['sourceip'] = $_POST['sourceip'];
130
		$config['syslog']['ipproto'] = $_POST['ipproto'];
131 5b237745 Scott Ullrich
		$config['syslog']['filter'] = $_POST['filter'] ? true : false;
132
		$config['syslog']['dhcp'] = $_POST['dhcp'] ? true : false;
133 3f2b92d2 Scott Ullrich
		$config['syslog']['portalauth'] = $_POST['portalauth'] ? true : false;
134 5b237745 Scott Ullrich
		$config['syslog']['vpn'] = $_POST['vpn'] ? true : false;
135 236524c2 jim-p
		$config['syslog']['apinger'] = $_POST['apinger'] ? true : false;
136
		$config['syslog']['relayd'] = $_POST['relayd'] ? true : false;
137
		$config['syslog']['hostapd'] = $_POST['hostapd'] ? true : false;
138 e34a7abb jim-p
		$config['syslog']['logall'] = $_POST['logall'] ? true : false;
139 5b237745 Scott Ullrich
		$config['syslog']['system'] = $_POST['system'] ? true : false;
140 e1c0c35a Scott Ullrich
		$config['syslog']['disablelocallogging'] = $_POST['disablelocallogging'] ? true : false;
141 5b237745 Scott Ullrich
		$config['syslog']['enable'] = $_POST['enable'] ? true : false;
142
		$oldnologdefaultblock = isset($config['syslog']['nologdefaultblock']);
143 1fd46d44 Ermal
		$oldnologdefaultpass = isset($config['syslog']['nologdefaultpass']);
144 1cf24f0a jim-p
		$oldnologbogons = isset($config['syslog']['nologbogons']);
145
		$oldnologprivatenets = isset($config['syslog']['nologprivatenets']);
146
		$oldnologlighttpd = isset($config['syslog']['nologlighttpd']);
147 5b237745 Scott Ullrich
		$config['syslog']['nologdefaultblock'] = $_POST['logdefaultblock'] ? false : true;
148 aa7ec418 Ermal
		$config['syslog']['nologdefaultpass'] = $_POST['logdefaultpass'] ? true : false;
149 1cf24f0a jim-p
		$config['syslog']['nologbogons'] = $_POST['logbogons'] ? false : true;
150
		$config['syslog']['nologprivatenets'] = $_POST['logprivatenets'] ? false : true;
151
		$config['syslog']['nologlighttpd'] = $_POST['loglighttpd'] ? false : true;
152 5b237745 Scott Ullrich
		$config['syslog']['rawfilter'] = $_POST['rawfilter'] ? true : false;
153 52b27268 PiBa-NL
		if (is_numeric($_POST['filterdescriptions']) && $_POST['filterdescriptions'] > 0)
154
			$config['syslog']['filterdescriptions'] = $_POST['filterdescriptions'];
155
		else
156
			unset($config['syslog']['filterdescriptions']);
157 be5d59d7 Scott Ullrich
		if($config['syslog']['enable'] == false) {
158 f3a5f0c5 Scott Ullrich
			unset($config['syslog']['remoteserver']);
159 be5d59d7 Scott Ullrich
			unset($config['syslog']['remoteserver2']);
160
			unset($config['syslog']['remoteserver3']);
161
		}
162 c195be3f Scott Ullrich
163 5b237745 Scott Ullrich
		write_config();
164 c195be3f Scott Ullrich
165 5b237745 Scott Ullrich
		$retval = 0;
166 fd31e9ee Scott Ullrich
		$retval = system_syslogd_start();
167 1cf24f0a jim-p
		if (($oldnologdefaultblock !== isset($config['syslog']['nologdefaultblock']))
168 1fd46d44 Ermal
			|| ($oldnologdefaultpass !== isset($config['syslog']['nologdefaultpass']))
169 1cf24f0a jim-p
			|| ($oldnologbogons !== isset($config['syslog']['nologbogons']))
170
			|| ($oldnologprivatenets !== isset($config['syslog']['nologprivatenets'])))
171 fd31e9ee Scott Ullrich
			$retval |= filter_configure();
172 c195be3f Scott Ullrich
173 4d875b4f Scott Ullrich
		$savemsg = get_std_save_message($retval);
174 1cf24f0a jim-p
175
		if ($oldnologlighttpd !== isset($config['syslog']['nologlighttpd'])) {
176
			ob_flush();
177
			flush();
178
			log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
179
			send_event("service restart webgui");
180
			$savemsg .= "<br />" . gettext("WebGUI process is restarting.");
181
		}
182
183
		filter_pflog_start(true);
184 5b237745 Scott Ullrich
	}
185
}
186
187 f8ec8de4 Renato Botelho
$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Settings"));
188 00491625 Colin Fleming
$closehead = false;
189 b63695db Scott Ullrich
include("head.inc");
190
191 5b237745 Scott Ullrich
?>
192 b63695db Scott Ullrich
193
194 00491625 Colin Fleming
<script type="text/javascript">
195
//<![CDATA[
196 5b237745 Scott Ullrich
function enable_change(enable_over) {
197
	if (document.iform.enable.checked || enable_over) {
198
		document.iform.remoteserver.disabled = 0;
199 be5d59d7 Scott Ullrich
		document.iform.remoteserver2.disabled = 0;
200
		document.iform.remoteserver3.disabled = 0;
201 5b237745 Scott Ullrich
		document.iform.filter.disabled = 0;
202
		document.iform.dhcp.disabled = 0;
203 3f2b92d2 Scott Ullrich
		document.iform.portalauth.disabled = 0;
204 5b237745 Scott Ullrich
		document.iform.vpn.disabled = 0;
205 236524c2 jim-p
		document.iform.apinger.disabled = 0;
206
		document.iform.relayd.disabled = 0;
207
		document.iform.hostapd.disabled = 0;
208 5b237745 Scott Ullrich
		document.iform.system.disabled = 0;
209 5e08497c Chris Buechler
		document.iform.logall.disabled = 0;
210 f3d91215 Darren Embry
		check_everything();
211 5b237745 Scott Ullrich
	} else {
212
		document.iform.remoteserver.disabled = 1;
213 be5d59d7 Scott Ullrich
		document.iform.remoteserver2.disabled = 1;
214
		document.iform.remoteserver3.disabled = 1;
215 5b237745 Scott Ullrich
		document.iform.filter.disabled = 1;
216
		document.iform.dhcp.disabled = 1;
217 3f2b92d2 Scott Ullrich
		document.iform.portalauth.disabled = 1;
218 5b237745 Scott Ullrich
		document.iform.vpn.disabled = 1;
219 236524c2 jim-p
		document.iform.apinger.disabled = 1;
220
		document.iform.relayd.disabled = 1;
221
		document.iform.hostapd.disabled = 1;
222 5b237745 Scott Ullrich
		document.iform.system.disabled = 1;
223 5e08497c Chris Buechler
		document.iform.logall.disabled = 1;
224 5b237745 Scott Ullrich
	}
225
}
226 236524c2 jim-p
function check_everything() {
227
	if (document.iform.logall.checked) {
228
		document.iform.filter.disabled = 1;
229 c8610dc9 Darren Embry
		document.iform.filter.checked = false;
230 236524c2 jim-p
		document.iform.dhcp.disabled = 1;
231 c8610dc9 Darren Embry
		document.iform.dhcp.checked = false;
232 236524c2 jim-p
		document.iform.portalauth.disabled = 1;
233 c8610dc9 Darren Embry
		document.iform.portalauth.checked = false;
234 236524c2 jim-p
		document.iform.vpn.disabled = 1;
235 c8610dc9 Darren Embry
		document.iform.vpn.checked = false;
236 236524c2 jim-p
		document.iform.apinger.disabled = 1;
237 c8610dc9 Darren Embry
		document.iform.apinger.checked = false;
238 236524c2 jim-p
		document.iform.relayd.disabled = 1;
239 c8610dc9 Darren Embry
		document.iform.relayd.checked = false;
240 236524c2 jim-p
		document.iform.hostapd.disabled = 1;
241 c8610dc9 Darren Embry
		document.iform.hostapd.checked = false;
242 236524c2 jim-p
		document.iform.system.disabled = 1;
243 c8610dc9 Darren Embry
		document.iform.system.checked = false;
244 236524c2 jim-p
	} else {
245
		document.iform.filter.disabled = 0;
246
		document.iform.dhcp.disabled = 0;
247
		document.iform.portalauth.disabled = 0;
248
		document.iform.vpn.disabled = 0;
249
		document.iform.apinger.disabled = 0;
250
		document.iform.relayd.disabled = 0;
251
		document.iform.hostapd.disabled = 0;
252
		document.iform.system.disabled = 0;
253
	}
254
}
255 00491625 Colin Fleming
//]]>
256 5b237745 Scott Ullrich
</script>
257 00491625 Colin Fleming
</head>
258 5b237745 Scott Ullrich
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
259
<?php include("fbegin.inc"); ?>
260
<form action="diag_logs_settings.php" method="post" name="iform" id="iform">
261
<?php if ($input_errors) print_input_errors($input_errors); ?>
262
<?php if ($savemsg) print_info_box($savemsg); ?>
263 00491625 Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="logs settings">
264 e34a7abb jim-p
<tr><td>
265 b63695db Scott Ullrich
<?php
266
	$tab_array = array();
267 f8ec8de4 Renato Botelho
	$tab_array[] = array(gettext("System"), false, "diag_logs.php");
268
	$tab_array[] = array(gettext("Firewall"), false, "diag_logs_filter.php");
269
	$tab_array[] = array(gettext("DHCP"), false, "diag_logs_dhcp.php");
270
	$tab_array[] = array(gettext("Portal Auth"), false, "diag_logs_auth.php");
271
	$tab_array[] = array(gettext("IPsec"), false, "diag_logs_ipsec.php");
272
	$tab_array[] = array(gettext("PPP"), false, "diag_logs_ppp.php");
273
	$tab_array[] = array(gettext("VPN"), false, "diag_logs_vpn.php");
274
	$tab_array[] = array(gettext("Load Balancer"), false, "diag_logs_relayd.php");
275
	$tab_array[] = array(gettext("OpenVPN"), false, "diag_logs_openvpn.php");
276 ae2c143a jim-p
	$tab_array[] = array(gettext("NTP"), false, "diag_logs_ntpd.php");
277 f8ec8de4 Renato Botelho
	$tab_array[] = array(gettext("Settings"), true, "diag_logs_settings.php");
278 b63695db Scott Ullrich
	display_top_tabs($tab_array);
279
?>
280 e34a7abb jim-p
</td></tr>
281
<tr>
282
	<td>
283 0f10aee4 Bill Marquette
	<div id="mainarea">
284 00491625 Colin Fleming
	<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
285 e34a7abb jim-p
		<tr>
286
			<td colspan="2" valign="top" class="listtopic"><?=gettext("General Logging Options");?></td>
287
		</tr>
288
		<tr>
289
			<td width="22%" valign="top" class="vtable">Forward/Reverse Display</td>
290 00491625 Colin Fleming
			<td width="78%" class="vtable"> <input name="reverse" type="checkbox" id="reverse" value="yes" <?php if ($pconfig['reverse']) echo "checked=\"checked\""; ?> />
291 f8ec8de4 Renato Botelho
			<strong><?=gettext("Show log entries in reverse order (newest entries on top)");?></strong></td>
292 e34a7abb jim-p
		</tr>
293
		<tr>
294
			<td width="22%" valign="top" class="vtable">GUI Log Entries to Display</td>
295
			<td width="78%" class="vtable">
296 8cd558b6 ayvis
			<input name="nentries" id="nentries" type="text" class="formfld unknown" size="4" value="<?=htmlspecialchars($pconfig['nentries']);?>" /><br />
297 e34a7abb jim-p
			<?=gettext("Hint: This is only the number of log entries displayed in the GUI. It does not affect how many entries are contained in the actual log files.") ?></td>
298
		</tr>
299 c7a3356e jim-p
		<tr>
300 62e92cb3 Phil Davis
			<td width="22%" valign="top" class="vtable">Log File Size (Bytes)</td>
301 c7a3356e jim-p
			<td width="78%" class="vtable">
302 8cd558b6 ayvis
			<input name="logfilesize" id="logfilesize" type="text" class="formfld unknown" size="8" value="<?=htmlspecialchars($pconfig['logfilesize']);?>" /><br />
303 15c58806 Phil Davis
			<?=gettext("Logs are held in constant-size circular log files. This field controls how large each log file is, and thus how many entries may exist inside the log. By default this is approximately 500KB per log file, and there are nearly 20 such log files.") ?>
304 8cd558b6 ayvis
			<br /><br />
305 f0cf1a64 jim-p
			<?=gettext("NOTE: Log sizes are changed the next time a log file is cleared or deleted. To immediately increase the size of the log files, you must first save the options to set the size, then clear all logs using the \"Reset Log Files\" option farther down this page. "); ?>
306 c7a3356e jim-p
			<?=gettext("Be aware that increasing this value increases every log file size, so disk usage will increase significantly."); ?>
307
			<?=gettext("Disk space currently used by log files: ") ?><?= exec("/usr/bin/du -sh /var/log | /usr/bin/awk '{print $1;}'"); ?>.
308
			<?=gettext("Remaining disk space for log files: ") ?><?= exec("/bin/df -h /var/log | /usr/bin/awk '{print $4;}'"); ?>.
309
			</td>
310
		</tr>
311 e34a7abb jim-p
		<tr>
312
			<td valign="top" class="vtable">Log Firewall Default Blocks</td>
313 1cf24f0a jim-p
			<td class="vtable">
314 00491625 Colin Fleming
				<input name="logdefaultblock" type="checkbox" id="logdefaultblock" value="yes" <?php if ($pconfig['logdefaultblock']) echo "checked=\"checked\""; ?> />
315 1fd46d44 Ermal
				<strong><?=gettext("Log packets matched from the default block rules put in the ruleset");?></strong><br />
316 1cf24f0a jim-p
				<?=gettext("Hint: packets that are blocked by the implicit default block rule will not be logged if you uncheck this option. Per-rule logging options are still respected.");?>
317 8cd558b6 ayvis
				<br />
318 1fd46d44 Ermal
				<input name="logdefaultpass" type="checkbox" id="logdefaultpass" value="yes" <?php if ($pconfig['logdefaultpass']) echo "checked=\"checked\""; ?> />
319
				<strong><?=gettext("Log packets matched from the default pass rules put in the ruleset");?></strong><br />
320 aa7ec418 Ermal
				<?=gettext("Hint: packets that are allowed by the implicit default pass rule will be logged if you check this option. Per-rule logging options are still respected.");?>
321 1fd46d44 Ermal
				<br />
322 00491625 Colin Fleming
				<input name="logbogons" type="checkbox" id="logbogons" value="yes" <?php if ($pconfig['logbogons']) echo "checked=\"checked\""; ?> />
323 8cd558b6 ayvis
				<strong><?=gettext("Log packets blocked by 'Block Bogon Networks' rules");?></strong><br />
324
				<br />
325 00491625 Colin Fleming
				<input name="logprivatenets" type="checkbox" id="logprivatenets" value="yes" <?php if ($pconfig['logprivatenets']) echo "checked=\"checked\""; ?> />
326 8cd558b6 ayvis
				<strong><?=gettext("Log packets blocked by 'Block Private Networks' rules");?></strong><br />
327 1cf24f0a jim-p
			</td>
328
		</tr>
329
		<tr>
330
			<td valign="top" class="vtable">Web Server Log</td>
331 00491625 Colin Fleming
			<td class="vtable"> <input name="loglighttpd" type="checkbox" id="loglighttpd" value="yes" <?php if ($pconfig['loglighttpd']) echo "checked=\"checked\""; ?> />
332 8cd558b6 ayvis
			<strong><?=gettext("Log errors from the web server process.");?></strong><br />
333 1cf24f0a jim-p
			<?=gettext("Hint: If this is checked, errors from the lighttpd web server process for the GUI or Captive Portal will appear in the main system log.");?></td>
334 e34a7abb jim-p
		</tr>
335
		<tr>
336
			<td valign="top" class="vtable">Raw Logs</td>
337 00491625 Colin Fleming
			<td class="vtable"> <input name="rawfilter" type="checkbox" id="rawfilter" value="yes" <?php if ($pconfig['rawfilter']) echo "checked=\"checked\""; ?> />
338 8cd558b6 ayvis
			<strong><?=gettext("Show raw filter logs");?></strong><br />
339 e34a7abb jim-p
			<?=gettext("Hint: If this is checked, filter logs are shown as generated by the packet filter, without any formatting. This will reveal more detailed information, but it is more difficult to read.");?></td>
340
		</tr>
341 52b27268 PiBa-NL
		<tr>
342
			<td valign="top" class="vtable">Filter descriptions</td>
343
			<td class="vtable">
344
				<select name="filterdescriptions" id="filterdescriptions" >
345 00491625 Colin Fleming
				  <option value="0"<?=!isset($pconfig['filterdescriptions'])?" selected=\"selected\"":""?>>Dont load descriptions</option>
346
				  <option value="1"<?=($pconfig['filterdescriptions'])==="1"?" selected=\"selected\"":""?>>Display as column</option>
347
				  <option value="2"<?=($pconfig['filterdescriptions'])==="2"?" selected=\"selected\"":""?>>Display as second row</option>
348 52b27268 PiBa-NL
				</select>
349
				<strong><?=gettext("Show the applied rule description below or in the firewall log rows.");?></strong>
350 8cd558b6 ayvis
				<br />
351 00491625 Colin Fleming
				<?=gettext("Displaying rule descriptions for all lines in the log might affect performance with large rule sets.");?>
352 52b27268 PiBa-NL
			</td>
353
		</tr>
354 e34a7abb jim-p
		<tr>
355
			<td width="22%" valign="top" class="vtable">Local Logging</td>
356 00491625 Colin Fleming
			<td width="78%" class="vtable"> <input name="disablelocallogging" type="checkbox" id="disablelocallogging" value="yes" <?php if ($pconfig['disablelocallogging']) echo "checked=\"checked\""; ?> onclick="enable_change(false)" />
357 e34a7abb jim-p
			<?php if ($g['platform'] == "pfSense"): ?>
358
			<strong><?=gettext("Disable writing log files to the local disk");?></strong></td>
359
			<?php else: ?>
360
			<strong><?=gettext("Disable writing log files to the local RAM disk");?></strong></td>
361
			<?php endif; ?>
362
		</tr>
363 c7a3356e jim-p
		<tr>
364
			<td width="22%" valign="top">Reset Logs</td>
365
			<td width="78%">
366
				<input name="resetlogs" type="submit" class="formbtn" value="<?=gettext("Reset Log Files"); ?>"  onclick="return confirm('<?=gettext('Do you really want to reset the log files? This will erase all local log data.');?>')" />
367 8cd558b6 ayvis
				<br /><br />
368 f4462954 Phil Davis
				<?= gettext("Note: Clears all local log files and reinitializes them as empty logs. This also restarts the DHCP daemon. Use the Save button first if you have made any setting changes."); ?>
369 c7a3356e jim-p
			</td>
370
		</tr>
371 e34a7abb jim-p
		<tr>
372
			<td colspan="2" valign="top">&nbsp;</td>
373
		</tr>
374
		<tr>
375
			<td colspan="2" valign="top" class="listtopic"><?=gettext("Remote Logging Options");?></td>
376
		</tr>
377 cbe12b8d jim-p
		<tr>
378
			<td width="22%" valign="top" class="vncell"><?=gettext("Source Address"); ?></td>
379
			<td width="78%" class="vtable">
380
				<select name="sourceip" class="formselect">
381
					<option value="">Default (any)</option>
382
				<?php $sourceips = get_possible_traffic_source_addresses(false);
383
					foreach ($sourceips as $sip):
384
						$selected = "";
385
						if (!link_interface_to_bridge($sip['value']) && ($sip['value'] == $pconfig['sourceip']))
386
							$selected = 'selected="selected"';
387
				?>
388
					<option value="<?=$sip['value'];?>" <?=$selected;?>>
389
						<?=htmlspecialchars($sip['name']);?>
390
					</option>
391
					<?php endforeach; ?>
392
				</select>
393 8cd558b6 ayvis
				<br />
394 cbe12b8d jim-p
				<?= gettext("This option will allow the logging daemon to bind to a single IP address, rather than all IP addresses."); ?>
395
				<?= gettext("If you pick a single IP, remote syslog severs must all be of that IP type. If you wish to mix IPv4 and IPv6 remote syslog servers, you must bind to all interfaces."); ?>
396 8cd558b6 ayvis
				<br /><br />
397 cbe12b8d jim-p
				<?= gettext("NOTE: If an IP address cannot be located on the chosen interface, the daemon will bind to all addresses."); ?>
398
			</td>
399
		</tr>
400
		<tr>
401
			<td width="22%" valign="top" class="vncell"><?=gettext("IP Protocol"); ?></td>
402
			<td width="78%" class="vtable">
403
				<select name="ipproto" class="formselect">
404
					<option value="ipv4" <?php if ($ipproto == "ipv4") echo 'selected="selected"' ?>>IPv4</option>
405
					<option value="ipv6" <?php if ($ipproto == "ipv6") echo 'selected="selected"' ?>>IPv6</option>
406
				</select>
407 8cd558b6 ayvis
				<br />
408 cbe12b8d jim-p
				<?= gettext("This option is only used when a non-default address is chosen as the source above. This option only expresses a preference; If an IP address of the selected type is not found on the chosen interface, the other type will be tried."); ?>
409
			</td>
410
		</tr>
411 e34a7abb jim-p
		<tr>
412
			<td width="22%" valign="top" class="vncell"><?=gettext("Enable Remote Logging");?></td>
413 00491625 Colin Fleming
			<td width="78%" class="vtable"> <input name="enable" type="checkbox" id="enable" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> onclick="enable_change(false)" />
414 e34a7abb jim-p
				<strong><?=gettext("Send log messages to remote syslog server");?></strong></td>
415
		</tr>
416
		<tr>
417
			<td width="22%" valign="top" class="vncell"><?=gettext("Remote Syslog Servers");?></td>
418
			<td width="78%" class="vtable">
419 00491625 Colin Fleming
				<table summary="remtote syslog servers">
420 e34a7abb jim-p
					<tr>
421
						<td><?=gettext("Server") . " 1";?></td>
422 00491625 Colin Fleming
						<td><input name="remoteserver" id="remoteserver" type="text" class="formfld host" size="20" value="<?=htmlspecialchars($pconfig['remoteserver']);?>" /></td>
423 e34a7abb jim-p
					</tr>
424
					<tr>
425
						<td><?=gettext("Server") . " 2";?></td>
426 00491625 Colin Fleming
						<td><input name="remoteserver2" id="remoteserver2" type="text" class="formfld host" size="20" value="<?=htmlspecialchars($pconfig['remoteserver2']);?>" /></td>
427 e34a7abb jim-p
					</tr>
428
					<tr>
429
						<td><?=gettext("Server") . " 3";?></td>
430 00491625 Colin Fleming
						<td><input name="remoteserver3" id="remoteserver3" type="text" class="formfld host" size="20" value="<?=htmlspecialchars($pconfig['remoteserver3']);?>" /></td>
431 e34a7abb jim-p
					</tr>
432
					<tr>
433
						<td>&nbsp;</td>
434
						<td><?=gettext("IP addresses of remote syslog servers, or an IP:port.");?></td>
435 2a74f9d7 Colin Fleming
					</tr>
436 e34a7abb jim-p
				</table>
437
			</td>
438
		</tr>
439
		<tr>
440
			<td width="22%" valign="top" class="vncell"><?=gettext("Remote Syslog Contents");?></td>
441
			<td width="78%" class="vtable">
442 00491625 Colin Fleming
				<input name="logall" id="logall" type="checkbox" value="yes" <?php if ($pconfig['logall']) echo "checked=\"checked\""; ?> onclick="check_everything();" />
443 8cd558b6 ayvis
				<?=gettext("Everything");?><br /><br />
444 00491625 Colin Fleming
				<input name="system" id="system" type="checkbox" value="yes" onclick="enable_change(false)" <?php if ($pconfig['system']) echo "checked=\"checked\""; ?> />
445 8cd558b6 ayvis
				<?=gettext("System events");?><br />
446 00491625 Colin Fleming
				<input name="filter" id="filter" type="checkbox" value="yes" <?php if ($pconfig['filter']) echo "checked=\"checked\""; ?> />
447 8cd558b6 ayvis
				<?=gettext("Firewall events");?><br />
448 00491625 Colin Fleming
				<input name="dhcp" id="dhcp" type="checkbox" value="yes" <?php if ($pconfig['dhcp']) echo "checked=\"checked\""; ?> />
449 8cd558b6 ayvis
				<?=gettext("DHCP service events");?><br />
450 00491625 Colin Fleming
				<input name="portalauth" id="portalauth" type="checkbox" value="yes" <?php if ($pconfig['portalauth']) echo "checked=\"checked\""; ?> />
451 8cd558b6 ayvis
				<?=gettext("Portal Auth events");?><br />
452 00491625 Colin Fleming
				<input name="vpn" id="vpn" type="checkbox" value="yes" <?php if ($pconfig['vpn']) echo "checked=\"checked\""; ?> />
453 8cd558b6 ayvis
				<?=gettext("VPN (PPTP, IPsec, OpenVPN) events");?><br />
454 00491625 Colin Fleming
				<input name="apinger" id="apinger" type="checkbox" value="yes" <?php if ($pconfig['apinger']) echo "checked=\"checked\""; ?> />
455 8cd558b6 ayvis
				<?=gettext("Gateway Monitor events");?><br />
456 00491625 Colin Fleming
				<input name="relayd" id="relayd" type="checkbox" value="yes" <?php if ($pconfig['relayd']) echo "checked=\"checked\""; ?> />
457 8cd558b6 ayvis
				<?=gettext("Server Load Balancer events");?><br />
458 00491625 Colin Fleming
				<input name="hostapd" id="hostapd" type="checkbox" value="yes" <?php if ($pconfig['hostapd']) echo "checked=\"checked\""; ?> />
459 8cd558b6 ayvis
				<?=gettext("Wireless events");?><br />
460 e34a7abb jim-p
			</td>
461
		</tr>
462
		<tr>
463
			<td width="22%" valign="top">&nbsp;</td>
464 00491625 Colin Fleming
			<td width="78%"> <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="enable_change(true)" />
465 e34a7abb jim-p
			</td>
466
		</tr>
467
		<tr>
468
			<td width="22%" height="53" valign="top">&nbsp;</td>
469 8cd558b6 ayvis
			<td width="78%"><strong><span class="red"><?=gettext("Note:")?></span></strong><br />
470 e34a7abb jim-p
			<?=gettext("syslog sends UDP datagrams to port 514 on the specified " .
471
			"remote syslog server, unless another port is specified. Be sure to set syslogd on the " .
472
			"remote server to accept syslog messages from");?> <?=$g['product_name']?>.
473
			</td>
474
		</tr>
475
	</table>
476 0f10aee4 Bill Marquette
	</div>
477 e34a7abb jim-p
</td></tr>
478 5b237745 Scott Ullrich
</table>
479
</form>
480 00491625 Colin Fleming
<script type="text/javascript">
481
//<![CDATA[
482 5b237745 Scott Ullrich
enable_change(false);
483 00491625 Colin Fleming
//]]>
484 5b237745 Scott Ullrich
</script>
485
<?php include("fend.inc"); ?>
486
</body>
487 4bdf145c Ermal
</html>