Project

General

Profile

Download (17.4 KB) Statistics
| Branch: | Tag: | Revision:
1 5b237745 Scott Ullrich
<?php 
2 b46bfcf5 Bill Marquette
/* $Id$ */
3 5b237745 Scott Ullrich
/*
4
	services_snmp.php
5
	part of m0n0wall (http://m0n0.ch/wall)
6
	
7
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
8
	All rights reserved.
9 29aef6c4 Jim Thompson
10
	part of pfSense
11 ce77a9c4 Phil Davis
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
12 29aef6c4 Jim Thompson
	All rights reserved.
13 5b237745 Scott Ullrich
	
14
	Redistribution and use in source and binary forms, with or without
15
	modification, are permitted provided that the following conditions are met:
16
	
17
	1. Redistributions of source code must retain the above copyright notice,
18
	   this list of conditions and the following disclaimer.
19
	
20
	2. Redistributions in binary form must reproduce the above copyright
21
	   notice, this list of conditions and the following disclaimer in the
22
	   documentation and/or other materials provided with the distribution.
23
	
24
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
25
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
26
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
28
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33
	POSSIBILITY OF SUCH DAMAGE.
34
*/
35 1d333258 Scott Ullrich
/*
36
	pfSense_MODULE:	snmp
37
*/
38 5b237745 Scott Ullrich
39 6b07c15a Matthew Grooms
##|+PRIV
40
##|*IDENT=page-services-snmp
41
##|*NAME=Services: SNMP page
42
##|*DESCR=Allow access to the 'Services: SNMP' page.
43
##|*MATCH=services_snmp.php*
44
##|-PRIV
45
46 5b237745 Scott Ullrich
require("guiconfig.inc");
47 4e865673 Carlos Eduardo Ramos
require_once("functions.inc");
48 5b237745 Scott Ullrich
49
if (!is_array($config['snmpd'])) {
50
	$config['snmpd'] = array();
51
	$config['snmpd']['rocommunity'] = "public";
52 3805bfdd John Fleming
	$config['snmpd']['pollport'] = "161";
53 5b237745 Scott Ullrich
}
54
55 3805bfdd John Fleming
if (!is_array($config['snmpd']['modules'])) {
56
	$config['snmpd']['modules'] = array();
57
	$config['snmpd']['modules']['mibii'] = true;
58
	$config['snmpd']['modules']['netgraph'] = true;
59
	$config['snmpd']['modules']['pf'] = true;
60 95fb49e8 Seth Mos
	$config['snmpd']['modules']['hostres'] = true;
61
	$config['snmpd']['modules']['bridge'] = true;
62 671914b2 jim-p
	$config['snmpd']['modules']['ucd'] = true;
63
	$config['snmpd']['modules']['regex'] = true;
64 3805bfdd John Fleming
}
65 4f4d63d8 John Fleming
$pconfig['enable'] = isset($config['snmpd']['enable']);
66 3805bfdd John Fleming
$pconfig['pollport'] = $config['snmpd']['pollport'];
67 5b237745 Scott Ullrich
$pconfig['syslocation'] = $config['snmpd']['syslocation'];
68
$pconfig['syscontact'] = $config['snmpd']['syscontact'];
69
$pconfig['rocommunity'] = $config['snmpd']['rocommunity'];
70 4f4d63d8 John Fleming
/* disabled until some docs show up on what this does.
71
$pconfig['rwenable'] = isset($config['snmpd']['rwenable']);
72
$pconfig['rwcommunity'] = $config['snmpd']['rwcommunity'];
73
*/
74
$pconfig['trapenable'] = isset($config['snmpd']['trapenable']);
75
$pconfig['trapserver'] = $config['snmpd']['trapserver'];
76
$pconfig['trapserverport'] = $config['snmpd']['trapserverport'];
77 8c3c9dc2 John Fleming
$pconfig['trapstring'] = $config['snmpd']['trapstring'];
78 5b237745 Scott Ullrich
79 3805bfdd John Fleming
$pconfig['mibii'] = isset($config['snmpd']['modules']['mibii']);
80
$pconfig['netgraph'] = isset($config['snmpd']['modules']['netgraph']);
81
$pconfig['pf'] = isset($config['snmpd']['modules']['pf']);
82 95fb49e8 Seth Mos
$pconfig['hostres'] = isset($config['snmpd']['modules']['hostres']);
83
$pconfig['bridge'] = isset($config['snmpd']['modules']['bridge']);
84 671914b2 jim-p
$pconfig['ucd'] = isset($config['snmpd']['modules']['ucd']);
85
$pconfig['regex'] = isset($config['snmpd']['modules']['regex']);
86 3d594a3f jim-p
$pconfig['bindip'] = $config['snmpd']['bindip'];
87 3805bfdd John Fleming
88 5b237745 Scott Ullrich
if ($_POST) {
89
90
	unset($input_errors);
91
	$pconfig = $_POST;
92
93
	/* input validation */
94
	if ($_POST['enable']) {
95 00686fee pierrepomes
		if (strstr($_POST['syslocation'],"#")) $input_errors[] = gettext("Invalid character '#' in system location");
96
 		if (strstr($_POST['syscontact'],"#")) $input_errors[] = gettext("Invalid character '#' in system contact");
97
		if (strstr($_POST['rocommunity'],"#")) $input_errors[] = gettext("Invalid character '#' in read community string");
98
99 5b237745 Scott Ullrich
		$reqdfields = explode(" ", "rocommunity");
100 3d9bee96 Rafael Lucas
		$reqdfieldsn = array(gettext("Community"));
101 1e9b4611 Renato Botelho
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
102 3805bfdd John Fleming
103
		$reqdfields = explode(" ", "pollport");
104 3d9bee96 Rafael Lucas
		$reqdfieldsn = array(gettext("Polling Port"));
105 1e9b4611 Renato Botelho
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
106 a42bf8cd Scott Ullrich
		
107 72b5583c Scott Ullrich
	
108 5b237745 Scott Ullrich
	}
109
110 4f4d63d8 John Fleming
	if ($_POST['trapenable']) {
111 00686fee pierrepomes
		if (strstr($_POST['trapstring'],"#")) $input_errors[] = gettext("Invalid character '#' in SNMP trap string");
112
113 4f4d63d8 John Fleming
		$reqdfields = explode(" ", "trapserver");
114 3d9bee96 Rafael Lucas
		$reqdfieldsn = array(gettext("Trap server"));
115 1e9b4611 Renato Botelho
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
116 3805bfdd John Fleming
117 4f4d63d8 John Fleming
		$reqdfields = explode(" ", "trapserverport");
118 3d9bee96 Rafael Lucas
		$reqdfieldsn = array(gettext("Trap server port"));
119 1e9b4611 Renato Botelho
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
120 3805bfdd John Fleming
121 8c3c9dc2 John Fleming
		$reqdfields = explode(" ", "trapstring");
122 3d9bee96 Rafael Lucas
		$reqdfieldsn = array(gettext("Trap string"));
123 1e9b4611 Renato Botelho
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
124 4f4d63d8 John Fleming
	}
125
126 8c3c9dc2 John Fleming
127 4f4d63d8 John Fleming
/* disabled until some docs show up on what this does.
128
	if ($_POST['rwenable']) {
129
               $reqdfields = explode(" ", "rwcommunity");
130
               $reqdfieldsn = explode(",", "Write community string");
131 1e9b4611 Renato Botelho
               do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
132 4f4d63d8 John Fleming
	}
133
*/
134
135
	
136
137 5b237745 Scott Ullrich
	if (!$input_errors) {
138 4f4d63d8 John Fleming
		$config['snmpd']['enable'] = $_POST['enable'] ? true : false;
139 3805bfdd John Fleming
		$config['snmpd']['pollport'] = $_POST['pollport'];
140 3184f4e7 Scott Ullrich
		$config['snmpd']['syslocation'] = $_POST['syslocation'];	
141 5b237745 Scott Ullrich
		$config['snmpd']['syscontact'] = $_POST['syscontact'];
142
		$config['snmpd']['rocommunity'] = $_POST['rocommunity'];
143 4f4d63d8 John Fleming
		/* disabled until some docs show up on what this does.
144
		$config['snmpd']['rwenable'] = $_POST['rwenable'] ? true : false;
145
		$config['snmpd']['rwcommunity'] = $_POST['rwcommunity'];
146
		*/
147
		$config['snmpd']['trapenable'] = $_POST['trapenable'] ? true : false;
148
		$config['snmpd']['trapserver'] = $_POST['trapserver'];
149
		$config['snmpd']['trapserverport'] = $_POST['trapserverport'];
150 8c3c9dc2 John Fleming
		$config['snmpd']['trapstring'] = $_POST['trapstring'];
151 4f4d63d8 John Fleming
		
152 3805bfdd John Fleming
		$config['snmpd']['modules']['mibii'] = $_POST['mibii'] ? true : false;
153
		$config['snmpd']['modules']['netgraph'] = $_POST['netgraph'] ? true : false;
154
		$config['snmpd']['modules']['pf'] = $_POST['pf'] ? true : false;
155 95fb49e8 Seth Mos
		$config['snmpd']['modules']['hostres'] = $_POST['hostres'] ? true : false;
156
		$config['snmpd']['modules']['bridge'] = $_POST['bridge'] ? true : false;
157 671914b2 jim-p
		$config['snmpd']['modules']['ucd'] = $_POST['ucd'] ? true : false;
158
		$config['snmpd']['modules']['regex'] = $_POST['regex'] ? true : false;
159 c82b2c3f jim-p
		$config['snmpd']['bindip'] = $_POST['bindip'];
160 5b237745 Scott Ullrich
			
161
		write_config();
162
		
163
		$retval = 0;
164 920b3bb0 Scott Ullrich
		$retval = services_snmpd_configure();
165 5b237745 Scott Ullrich
		$savemsg = get_std_save_message($retval);
166
	}
167
}
168 4df96eff Scott Ullrich
169 a50337c3 Colin Fleming
$closehead = false;
170 3d9bee96 Rafael Lucas
$pgtitle = array(gettext("Services"),gettext("SNMP"));
171 d71fc5d3 jim-p
$shortcut_section = "snmp";
172 4df96eff Scott Ullrich
include("head.inc");
173
174 5b237745 Scott Ullrich
?>
175 91f026b0 ayvis
<script type="text/javascript">
176 a50337c3 Colin Fleming
//<![CDATA[
177 7bc5c543 jim-p
function check_deps() {
178 ea1cea05 Vinicius Coque
	if (jQuery('#hostres').prop('checked') == true) {
179
		jQuery('#mibii').prop('checked',true);
180 7bc5c543 jim-p
	}
181
}
182
183 4f4d63d8 John Fleming
function enable_change(whichone) {
184
185
	if( whichone.name == "trapenable" )
186
        {
187
	    if( whichone.checked == true )
188
	    {
189
	        document.iform.trapserver.disabled = false;
190
	        document.iform.trapserverport.disabled = false;
191 8c3c9dc2 John Fleming
	        document.iform.trapstring.disabled = false;
192 4f4d63d8 John Fleming
	    }
193
	    else
194
	    {
195
                document.iform.trapserver.disabled = true;
196
                document.iform.trapserverport.disabled = true;
197 8c3c9dc2 John Fleming
                document.iform.trapstring.disabled = true;
198 4f4d63d8 John Fleming
	    }
199
	}
200
201
	/* disabled until some docs show up on what this does.
202
	if( whichone.name == "rwenable"  )
203
	{
204
	    if( whichone.checked == true )
205
	    {
206
		document.iform.rwcommunity.disabled = false;
207
	    }
208
	    else
209
	    {
210
		document.iform.rwcommunity.disabled = true;
211
	    }
212
	}
213
	*/
214
215
	if( document.iform.enable.checked == true )
216
	{
217 3805bfdd John Fleming
	    document.iform.pollport.disabled = false;
218 4f4d63d8 John Fleming
	    document.iform.syslocation.disabled = false;
219
	    document.iform.syscontact.disabled = false;
220
	    document.iform.rocommunity.disabled = false;
221
	    document.iform.trapenable.disabled = false;
222
	    /* disabled until some docs show up on what this does.
223
	    document.iform.rwenable.disabled = false;
224
	    if( document.iform.rwenable.checked == true )
225
	    {
226
	        document.iform.rwcommunity.disabled = false;
227
	    }
228
	    else
229
	    {
230
		document.iform.rwcommunity.disabled = true;
231
	    }
232
	    */
233
	    if( document.iform.trapenable.checked == true )
234
	    {
235
                document.iform.trapserver.disabled = false;
236
                document.iform.trapserverport.disabled = false;
237 8c3c9dc2 John Fleming
                document.iform.trapstring.disabled = false;
238 4f4d63d8 John Fleming
	    }
239
	    else
240
	    {
241
                document.iform.trapserver.disabled = true;
242 a21b1cad John Fleming
                document.iform.trapserverport.disabled = true;
243 8c3c9dc2 John Fleming
                document.iform.trapstring.disabled = true;
244 4f4d63d8 John Fleming
	    }
245 3805bfdd John Fleming
	    document.iform.mibii.disabled = false;
246
	    document.iform.netgraph.disabled = false;
247
	    document.iform.pf.disabled = false;
248 95fb49e8 Seth Mos
	    document.iform.hostres.disabled = false;
249 671914b2 jim-p
	    document.iform.ucd.disabled = false;
250
	    document.iform.regex.disabled = false;
251 0bbf8900 Ermal
	    //document.iform.bridge.disabled = false;
252 4f4d63d8 John Fleming
	}
253
	else
254
	{
255 3805bfdd John Fleming
            document.iform.pollport.disabled = true;
256 4f4d63d8 John Fleming
            document.iform.syslocation.disabled = true;
257
            document.iform.syscontact.disabled = true;
258
            document.iform.rocommunity.disabled = true;
259
	    /* 
260
            document.iform.rwenable.disabled = true;
261
	    document.iform.rwcommunity.disabled = true;
262
	    */
263
            document.iform.trapenable.disabled = true;
264
            document.iform.trapserver.disabled = true;
265
            document.iform.trapserverport.disabled = true;
266 8c3c9dc2 John Fleming
            document.iform.trapstring.disabled = true;
267 3805bfdd John Fleming
268
            document.iform.mibii.disabled = true;
269
            document.iform.netgraph.disabled = true;
270
            document.iform.pf.disabled = true;
271 95fb49e8 Seth Mos
            document.iform.hostres.disabled = true;
272 671914b2 jim-p
            document.iform.ucd.disabled = true;
273
            document.iform.regex.disabled = true;
274 0bbf8900 Ermal
            //document.iform.bridge.disabled = true;
275 4f4d63d8 John Fleming
	}
276 5b237745 Scott Ullrich
}
277 a50337c3 Colin Fleming
//]]>
278 5b237745 Scott Ullrich
</script>
279 a50337c3 Colin Fleming
</head>
280 5b237745 Scott Ullrich
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
281
<?php include("fbegin.inc"); ?>
282
<?php if ($input_errors) print_input_errors($input_errors); ?>
283
<?php if ($savemsg) print_info_box($savemsg); ?>
284
            <form action="services_snmp.php" method="post" name="iform" id="iform">
285 a50337c3 Colin Fleming
              <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="snmp">
286 4f4d63d8 John Fleming
287 5b237745 Scott Ullrich
                <tr> 
288 4f4d63d8 John Fleming
  		  <td colspan="2" valign="top" class="optsect_t">
289 a50337c3 Colin Fleming
  			<table border="0" cellspacing="0" cellpadding="0" width="100%" summary="enable">
290 3d9bee96 Rafael Lucas
  			<tr><td class="optsect_s"><strong><?=gettext("SNMP Daemon");?></strong></td>
291 a50337c3 Colin Fleming
					<td align="right" class="optsect_s"><input name="enable" id="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> onclick="enable_change(this)" /> <strong><?=gettext("Enable");?></strong></td></tr>
292 4f4d63d8 John Fleming
  			</table></td>
293 5b237745 Scott Ullrich
                </tr>
294 3805bfdd John Fleming
295
                <tr>
296 3d9bee96 Rafael Lucas
                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Polling Port ");?></td>
297 3805bfdd John Fleming
                  <td width="78%" class="vtable">
298 a50337c3 Colin Fleming
                    <input name="pollport" type="text" class="formfld unknown" id="pollport" size="40" value="<?=htmlspecialchars($pconfig['pollport']) ? htmlspecialchars($pconfig['pollport']) : htmlspecialchars(161);?>" />
299 8cd558b6 ayvis
                    <br /><?=gettext("Enter the port to accept polling events on (default 161)");?><br />
300 3805bfdd John Fleming
		  </td>
301
                </tr>
302
303 5b237745 Scott Ullrich
                <tr> 
304 3d9bee96 Rafael Lucas
                  <td width="22%" valign="top" class="vncell"><?=gettext("System location");?></td>
305 5b237745 Scott Ullrich
                  <td width="78%" class="vtable"> 
306 a50337c3 Colin Fleming
                    <input name="syslocation" type="text" class="formfld unknown" id="syslocation" size="40" value="<?=htmlspecialchars($pconfig['syslocation']);?>" />
307 5b237745 Scott Ullrich
                  </td>
308
                </tr>
309 3805bfdd John Fleming
310 5b237745 Scott Ullrich
                <tr> 
311 3d9bee96 Rafael Lucas
                  <td width="22%" valign="top" class="vncell"><?=gettext("System contact");?></td>
312 5b237745 Scott Ullrich
                  <td width="78%" class="vtable"> 
313 a50337c3 Colin Fleming
                    <input name="syscontact" type="text" class="formfld unknown" id="syscontact" size="40" value="<?=htmlspecialchars($pconfig['syscontact']);?>" />
314 5b237745 Scott Ullrich
                  </td>
315
                </tr>
316 3805bfdd John Fleming
317 5b237745 Scott Ullrich
                <tr> 
318 3d9bee96 Rafael Lucas
                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Read Community String");?></td>
319 5b237745 Scott Ullrich
                  <td width="78%" class="vtable"> 
320 a50337c3 Colin Fleming
                    <input name="rocommunity" type="text" class="formfld unknown" id="rocommunity" size="40" value="<?=htmlspecialchars($pconfig['rocommunity']);?>" />
321 8cd558b6 ayvis
		    <br /><?=gettext("The community string is like a password, restricting access to querying SNMP to hosts knowing the community string. Use a strong value here to protect from unauthorized information disclosure.");?><br />
322 3805bfdd John Fleming
		  </td>
323 5b237745 Scott Ullrich
                </tr>
324 3184f4e7 Scott Ullrich
		<tr><td>&nbsp;</td></tr>
325
326
                <tr> 
327
  		  <td colspan="2" valign="top" class="optsect_t">
328 a50337c3 Colin Fleming
  			<table border="0" cellspacing="0" cellpadding="0" width="100%" summary="enable">
329 3d9bee96 Rafael Lucas
  			<tr><td class="optsect_s"><strong><?=gettext("SNMP Traps");?></strong></td>
330 a50337c3 Colin Fleming
			<td align="right" class="optsect_s"><input name="trapenable" id="trapenable" type="checkbox" value="yes" <?php if ($pconfig['trapenable']) echo "checked=\"checked\""; ?> onclick="enable_change(this)" /> <strong><?=gettext("Enable");?></strong></td></tr>
331 3184f4e7 Scott Ullrich
  			</table></td>
332
                </tr>
333 4f4d63d8 John Fleming
                <tr>
334 3d9bee96 Rafael Lucas
                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Trap server");?></td>
335 4f4d63d8 John Fleming
                  <td width="78%" class="vtable">
336 a50337c3 Colin Fleming
                    <input name="trapserver" type="text" class="formfld unknown" id="trapserver" size="40" value="<?=htmlspecialchars($pconfig['trapserver']);?>" />
337 8cd558b6 ayvis
                    <br /><?=gettext("Enter trap server name");?><br />
338 3805bfdd John Fleming
		  </td>
339 4f4d63d8 John Fleming
                </tr>
340
                <tr>
341 3d9bee96 Rafael Lucas
                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Trap server port ");?></td>
342 4f4d63d8 John Fleming
                  <td width="78%" class="vtable">
343 a50337c3 Colin Fleming
                    <input name="trapserverport" type="text" class="formfld unknown" id="trapserverport" size="40" value="<?=htmlspecialchars($pconfig['trapserverport']) ? htmlspecialchars($pconfig['trapserverport']) : htmlspecialchars(162);?>" />
344 8cd558b6 ayvis
                    <br /><?=gettext("Enter the port to send the traps to (default 162)");?><br />
345 3805bfdd John Fleming
		  </td>
346 4f4d63d8 John Fleming
                </tr>
347 3805bfdd John Fleming
348 8c3c9dc2 John Fleming
                <tr>
349 3d9bee96 Rafael Lucas
                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Enter the SNMP trap string");?></td>
350 8c3c9dc2 John Fleming
                  <td width="78%" class="vtable">
351 a50337c3 Colin Fleming
                    <input name="trapstring" type="text" class="formfld unknown" id="trapstring" size="40" value="<?=htmlspecialchars($pconfig['trapstring']);?>" />
352 8cd558b6 ayvis
                    <br /><?=gettext("Trap string");?><br />
353 3805bfdd John Fleming
		  </td>
354 8c3c9dc2 John Fleming
                </tr>
355
356 ba73e2a3 Scott Ullrich
		<tr><td>&nbsp;</td></tr>
357
358
                <tr> 
359
  		  <td colspan="2" valign="top" class="optsect_t">
360 a50337c3 Colin Fleming
  			<table border="0" cellspacing="0" cellpadding="0" width="100%" summary="modules">
361 3d9bee96 Rafael Lucas
  			<tr><td class="optsect_s"><strong><?=gettext("Modules");?></strong></td>
362 ba73e2a3 Scott Ullrich
			<td align="right" class="optsect_s">&nbsp;</td></tr>
363
  			</table></td>
364
                </tr>
365
366 3805bfdd John Fleming
		<tr>
367 3d9bee96 Rafael Lucas
		  <td width="22%" valign="top" class="vncellreq"><?=gettext("SNMP Modules");?></td>
368 3805bfdd John Fleming
		  <td width="78%" class="vtable">
369 a50337c3 Colin Fleming
		    <input name="mibii" type="checkbox" id="mibii" value="yes" onclick="check_deps()" <?php if ($pconfig['mibii']) echo "checked=\"checked\""; ?> /><?=gettext("MibII"); ?>
370 95fb49e8 Seth Mos
		    <br />
371 a50337c3 Colin Fleming
		    <input name="netgraph" type="checkbox" id="netgraph" value="yes" <?php if ($pconfig['netgraph']) echo "checked=\"checked\""; ?> /><?=gettext("Netgraph"); ?>
372 95fb49e8 Seth Mos
		    <br />
373 a50337c3 Colin Fleming
		    <input name="pf" type="checkbox" id="pf" value="yes" <?php if ($pconfig['pf']) echo "checked=\"checked\""; ?> /><?=gettext("PF"); ?>
374 95fb49e8 Seth Mos
		    <br />
375 a50337c3 Colin Fleming
		    <input name="hostres" type="checkbox" id="hostres" value="yes" onclick="check_deps()" <?php if ($pconfig['hostres']) echo "checked=\"checked\""; ?> /><?=gettext("Host Resources (Requires MibII)");?>
376 671914b2 jim-p
		    <br />
377 a50337c3 Colin Fleming
		    <input name="ucd" type="checkbox" id="ucd" value="yes" <?php if ($pconfig['ucd']) echo "checked=\"checked\""; ?> /><?=gettext("UCD"); ?>
378 671914b2 jim-p
		    <br />
379 a50337c3 Colin Fleming
		    <input name="regex" type="checkbox" id="regex" value="yes" <?php if ($pconfig['regex']) echo "checked=\"checked\""; ?> /><?=gettext("Regex"); ?>
380 671914b2 jim-p
		    <br />
381 3805bfdd John Fleming
		  </td>
382
		</tr>
383 c82b2c3f jim-p
384
		<tr><td>&nbsp;</td></tr>
385
386
		<tr>
387
			<td colspan="2" valign="top" class="optsect_t">
388 a50337c3 Colin Fleming
			<table border="0" cellspacing="0" cellpadding="0" width="100%" summary="interface">
389 c82b2c3f jim-p
				<tr><td class="optsect_s"><strong><?=gettext("Interface Binding");?></strong></td>
390
				<td align="right" class="optsect_s">&nbsp;</td></tr>
391
			</table></td>
392
		</tr>
393
		<tr>
394
			<td width="22%" valign="top" class="vncellreq"><?=gettext("Bind Interface"); ?></td>
395
			<td width="78%" class="vtable">
396
				<select name="bindip" class="formselect">
397
					<option value="">All</option>
398
				<?php  $listenips = get_possible_listen_ips();
399 89f171b0 Ermal LUÇI
					foreach ($listenips as $lip => $ldescr):
400 c82b2c3f jim-p
						$selected = "";
401 89f171b0 Ermal LUÇI
						if ($lip == $pconfig['bindip'])
402 a50337c3 Colin Fleming
							$selected = "selected=\"selected\"";
403 c82b2c3f jim-p
				?>
404 3853b436 Phil Davis
					<option value="<?=$lip;?>" <?=$selected;?>>
405
						<?=htmlspecialchars($ldescr);?>
406 c82b2c3f jim-p
					</option>
407 89f171b0 Ermal LUÇI
				<?php endforeach;
408
				    unset($listenips);
409
				?>
410 a50337c3 Colin Fleming
				</select>
411
			</td>
412 c82b2c3f jim-p
		</tr>
413 612bb4f3 Scott Ullrich
		 <tr> 
414
		   <td width="22%" valign="top">&nbsp;</td>
415
		   <td width="78%"> 
416 a50337c3 Colin Fleming
		     <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="enable_change(true)" />
417 612bb4f3 Scott Ullrich
		   </td>
418
		 </tr>
419
		</table>
420 5b237745 Scott Ullrich
</form>
421 91f026b0 ayvis
<script type="text/javascript">
422 a50337c3 Colin Fleming
//<![CDATA[
423 4f4d63d8 John Fleming
enable_change(this);
424 a50337c3 Colin Fleming
//]]>
425 5b237745 Scott Ullrich
</script>
426
<?php include("fend.inc"); ?>
427
</body>
428
</html>