summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-05-27 22:39:40 +0545
committerPhil Davis <phil.davis@inf.org>2015-05-27 22:39:40 +0545
commit56463a6c0c2b83ec8dd70d7055b6fdc9b9313200 (patch)
treed59089839aa96ec9edb4fd4bea749d0d0373981a /usr/local/www
parent36314cbac0de6013b1be41b9ea4241cd1066a727 (diff)
downloadpfsense-56463a6c0c2b83ec8dd70d7055b6fdc9b9313200.zip
pfsense-56463a6c0c2b83ec8dd70d7055b6fdc9b9313200.tar.gz
Code style services r s w
Diffstat (limited to 'usr/local/www')
-rw-r--r--usr/local/www/services_router_advertisements.php397
-rw-r--r--usr/local/www/services_snmp.php449
-rw-r--r--usr/local/www/services_wol.php234
-rw-r--r--usr/local/www/services_wol_edit.php139
4 files changed, 639 insertions, 580 deletions
diff --git a/usr/local/www/services_router_advertisements.php b/usr/local/www/services_router_advertisements.php
index 6fa92e7..d3e178d 100644
--- a/usr/local/www/services_router_advertisements.php
+++ b/usr/local/www/services_router_advertisements.php
@@ -47,7 +47,7 @@
require("guiconfig.inc");
-if(!$g['services_dhcp_server_enable']) {
+if (!$g['services_dhcp_server_enable']) {
header("Location: /");
exit;
}
@@ -55,25 +55,27 @@ if(!$g['services_dhcp_server_enable']) {
/* Fix failover DHCP problem
* http://article.gmane.org/gmane.comp.security.firewalls.pfsense.support/18749
*/
-ini_set("memory_limit","64M");
+ini_set("memory_limit", "64M");
$if = $_GET['if'];
-if ($_POST['if'])
+if ($_POST['if']) {
$if = $_POST['if'];
+}
/* if OLSRD is enabled, allow WAN to house DHCP. */
-if($config['installedpackages']['olsrd']) {
- foreach($config['installedpackages']['olsrd']['config'] as $olsrd) {
- if($olsrd['enable']) {
+if ($config['installedpackages']['olsrd']) {
+ foreach ($config['installedpackages']['olsrd']['config'] as $olsrd) {
+ if ($olsrd['enable']) {
$is_olsr_enabled = true;
break;
}
}
}
-if (!$_GET['if'])
+if (!$_GET['if']) {
$savemsg = "<p><b>" . gettext("The DHCPv6 Server can only be enabled on interfaces configured with static IP addresses") . ".</b></p>" .
- "<p><b>" . gettext("Only interfaces configured with a static IP will be shown") . ".</b></p>";
+ "<p><b>" . gettext("Only interfaces configured with a static IP will be shown") . ".</b></p>";
+}
$iflist = get_configured_interface_with_descr();
@@ -82,8 +84,9 @@ if (!$if || !isset($iflist[$if])) {
foreach ($iflist as $ifent => $ifname) {
$oc = $config['interfaces'][$ifent];
if ((is_array($config['dhcpdv6'][$ifent]) && !isset($config['dhcpdv6'][$ifent]['enable']) && !(is_ipaddrv6($oc['ipaddrv6']) && (!is_linklocal($oc['ipaddrv6'])))) ||
- (!is_array($config['dhcpdv6'][$ifent]) && !(is_ipaddrv6($oc['ipaddrv6']) && (!is_linklocal($oc['ipaddrv6'])))))
+ (!is_array($config['dhcpdv6'][$ifent]) && !(is_ipaddrv6($oc['ipaddrv6']) && (!is_linklocal($oc['ipaddrv6']))))) {
continue;
+ }
$if = $ifent;
break;
}
@@ -93,32 +96,34 @@ if (is_array($config['dhcpdv6'][$if])) {
/* RA specific */
$pconfig['ramode'] = $config['dhcpdv6'][$if]['ramode'];
$pconfig['rapriority'] = $config['dhcpdv6'][$if]['rapriority'];
- if($pconfig['rapriority'] == "")
+ if ($pconfig['rapriority'] == "") {
$pconfig['rapriority'] = "medium";
+ }
$pconfig['rainterface'] = $config['dhcpdv6'][$if]['rainterface'];
$pconfig['radomainsearchlist'] = $config['dhcpdv6'][$if]['radomainsearchlist'];
- list($pconfig['radns1'],$pconfig['radns2'],$pconfig['radns3'],$pconfig['radns4']) = $config['dhcpdv6'][$if]['radnsserver'];
+ list($pconfig['radns1'], $pconfig['radns2'], $pconfig['radns3'], $pconfig['radns4']) = $config['dhcpdv6'][$if]['radnsserver'];
$pconfig['rasamednsasdhcp6'] = isset($config['dhcpdv6'][$if]['rasamednsasdhcp6']);
$pconfig['subnets'] = $config['dhcpdv6'][$if]['subnets']['item'];
}
-if (!is_array($pconfig['subnets']))
+if (!is_array($pconfig['subnets'])) {
$pconfig['subnets'] = array();
+}
$advertise_modes = array("disabled" => "Disabled",
- "router" => "Router Only",
- "unmanaged" => "Unmanaged",
- "managed" => "Managed",
- "assist" => "Assisted");
+ "router" => "Router Only",
+ "unmanaged" => "Unmanaged",
+ "managed" => "Managed",
+ "assist" => "Assisted");
$priority_modes = array("low" => "Low",
- "medium" => "Normal",
- "high" => "High");
+ "medium" => "Normal",
+ "high" => "High");
$carplist = get_configured_carp_interface_list();
$subnets_help = gettext("Subnets are specified in CIDR format. " .
- "Select the CIDR mask that pertains to each entry. " .
- "/128 specifies a single IPv6 host; /64 specifies a normal IPv6 network; etc. " .
- "If no subnets are specified here, the Router Advertisement (RA) Daemon will advertise to the subnet to which the router's interface is assigned.");
+ "Select the CIDR mask that pertains to each entry. " .
+ "/128 specifies a single IPv6 host; /64 specifies a normal IPv6 network; etc. " .
+ "If no subnets are specified here, the Router Advertisement (RA) Daemon will advertise to the subnet to which the router's interface is assigned.");
if ($_POST) {
unset($input_errors);
@@ -130,26 +135,30 @@ if ($_POST) {
$pconfig['subnets'] = array();
for ($x = 0; $x < 5000; $x += 1) {
$address = trim($_POST['subnet_address' . $x]);
- if ($address === "")
+ if ($address === "") {
continue;
+ }
$bits = trim($_POST['subnet_bits' . $x]);
- if ($bits === "")
+ if ($bits === "") {
$bits = "128";
+ }
if (is_alias($address)) {
$pconfig['subnets'][] = $address;
} else {
$pconfig['subnets'][] = $address . "/" . $bits;
- if (!is_ipaddrv6($address))
+ if (!is_ipaddrv6($address)) {
$input_errors[] = sprintf(gettext("An invalid subnet or alias was specified. [%s/%s]"), $address, $bits);
+ }
}
}
- if (($_POST['radns1'] && !is_ipaddrv6($_POST['radns1'])) || ($_POST['radns2'] && !is_ipaddrv6($_POST['radns2'])) || ($_POST['radns3'] && !is_ipaddrv6($_POST['radns3'])) || ($_POST['radns4'] && !is_ipaddrv6($_POST['radns4'])))
+ if (($_POST['radns1'] && !is_ipaddrv6($_POST['radns1'])) || ($_POST['radns2'] && !is_ipaddrv6($_POST['radns2'])) || ($_POST['radns3'] && !is_ipaddrv6($_POST['radns3'])) || ($_POST['radns4'] && !is_ipaddrv6($_POST['radns4']))) {
$input_errors[] = gettext("A valid IPv6 address must be specified for each of the DNS servers.");
+ }
if ($_POST['radomainsearchlist']) {
- $domain_array=preg_split("/[ ;]+/",$_POST['radomainsearchlist']);
+ $domain_array=preg_split("/[ ;]+/", $_POST['radomainsearchlist']);
foreach ($domain_array as $curdomain) {
if (!is_domain($curdomain)) {
$input_errors[] = gettext("A valid domain search list must be specified.");
@@ -159,8 +168,9 @@ if ($_POST) {
}
if (!$input_errors) {
- if (!is_array($config['dhcpdv6'][$if]))
+ if (!is_array($config['dhcpdv6'][$if])) {
$config['dhcpdv6'][$if] = array();
+ }
$config['dhcpdv6'][$if]['ramode'] = $_POST['ramode'];
$config['dhcpdv6'][$if]['rapriority'] = $_POST['rapriority'];
@@ -168,14 +178,18 @@ if ($_POST) {
$config['dhcpdv6'][$if]['radomainsearchlist'] = $_POST['radomainsearchlist'];
unset($config['dhcpdv6'][$if]['radnsserver']);
- if ($_POST['radns1'])
+ if ($_POST['radns1']) {
$config['dhcpdv6'][$if]['radnsserver'][] = $_POST['radns1'];
- if ($_POST['radns2'])
+ }
+ if ($_POST['radns2']) {
$config['dhcpdv6'][$if]['radnsserver'][] = $_POST['radns2'];
- if ($_POST['radns3'])
+ }
+ if ($_POST['radns3']) {
$config['dhcpdv6'][$if]['radnsserver'][] = $_POST['radns3'];
- if ($_POST['radns4'])
+ }
+ if ($_POST['radns4']) {
$config['dhcpdv6'][$if]['radnsserver'][] = $_POST['radns4'];
+ }
$config['dhcpdv6'][$if]['rasamednsasdhcp6'] = ($_POST['rasamednsasdhcp6']) ? true : false;
@@ -191,7 +205,7 @@ if ($_POST) {
}
}
-$pgtitle = array(gettext("Services"),gettext("Router advertisements"));
+$pgtitle = array(gettext("Services"), gettext("Router advertisements"));
include("head.inc");
@@ -228,7 +242,8 @@ include("head.inc");
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="router advert">
-<tr><td>
+ <tr>
+ <td>
<?php
/* active tabs */
$tab_array = array();
@@ -237,12 +252,14 @@ include("head.inc");
foreach ($iflist as $ifent => $ifname) {
$oc = $config['interfaces'][$ifent];
if ((is_array($config['dhcpdv6'][$ifent]) && !isset($config['dhcpdv6'][$ifent]['enable']) && !(is_ipaddrv6($oc['ipaddrv6']) && (!is_linklocal($oc['ipaddrv6'])))) ||
- (!is_array($config['dhcpdv6'][$ifent]) && !(is_ipaddrv6($oc['ipaddrv6']) && (!is_linklocal($oc['ipaddrv6'])))))
+ (!is_array($config['dhcpdv6'][$ifent]) && !(is_ipaddrv6($oc['ipaddrv6']) && (!is_linklocal($oc['ipaddrv6']))))) {
continue;
- if ($ifent == $if)
+ }
+ if ($ifent == $if) {
$active = true;
- else
+ } else {
$active = false;
+ }
$tab_array[] = array($ifname, $active, "services_dhcpv6.php?if={$ifent}");
$tabscounter++;
}
@@ -255,162 +272,172 @@ include("head.inc");
}
display_top_tabs($tab_array);
?>
-</td></tr>
-<tr><td class="tabnavtbl">
+ </td>
+ </tr>
+ <tr>
+ <td class="tabnavtbl">
<?php
-$tab_array = array();
-$tab_array[] = array(gettext("DHCPv6 Server"), false, "services_dhcpv6.php?if={$if}");
-$tab_array[] = array(gettext("Router Advertisements"), true, "services_router_advertisements.php?if={$if}");
-display_top_tabs($tab_array);
+ $tab_array = array();
+ $tab_array[] = array(gettext("DHCPv6 Server"), false, "services_dhcpv6.php?if={$if}");
+ $tab_array[] = array(gettext("Router Advertisements"), true, "services_router_advertisements.php?if={$if}");
+ display_top_tabs($tab_array);
?>
-</td></tr>
-<tr>
-<td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Router Advertisements");?></td>
- <td width="78%" class="vtable">
- <select name="ramode" id="ramode">
- <?php foreach($advertise_modes as $name => $value) { ?>
- <option value="<?=$name ?>" <?php if ($pconfig['ramode'] == $name) echo "selected=\"selected\""; ?> > <?=$value ?></option>
- <?php } ?>
- </select><br />
- <strong><?php printf(gettext("Select the Operating Mode for the Router Advertisement (RA) Daemon."))?></strong>
- <?php printf(gettext("Use \"Router Only\" to only advertise this router, \"Unmanaged\" for Router Advertising with Stateless Autoconfig, \"Managed\" for assignment through (a) DHCPv6 Server, \"Assisted\" for DHCPv6 Server assignment combined with Stateless Autoconfig"));?>
- <?php printf(gettext("It is not required to activate this DHCPv6 server when set to \"Managed\", this can be another host on the network")); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Router Priority");?></td>
- <td width="78%" class="vtable">
- <select name="rapriority" id="rapriority">
- <?php foreach($priority_modes as $name => $value) { ?>
- <option value="<?=$name ?>" <?php if ($pconfig['rapriority'] == $name) echo "selected=\"selected\""; ?> > <?=$value ?></option>
- <?php } ?>
- </select><br />
- <strong><?php printf(gettext("Select the Priority for the Router Advertisement (RA) Daemon."))?></strong>
- </td>
- </tr>
- <?php
- $carplistif = array();
- if(count($carplist) > 0) {
- foreach($carplist as $ifname => $vip) {
- if((preg_match("/^{$if}_/", $ifname)) && (is_ipaddrv6($vip)))
- $carplistif[$ifname] = $vip;
- }
- }
- if(count($carplistif) > 0) {
- ?>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("RA Interface");?></td>
- <td width="78%" class="vtable">
- <select name="rainterface" id="rainterface">
- <?php foreach($carplistif as $ifname => $vip) { ?>
- <option value="interface" <?php if ($pconfig['rainterface'] == "interface") echo "selected=\"selected\""; ?> > <?=strtoupper($if); ?></option>
- <option value="<?=$ifname ?>" <?php if ($pconfig['rainterface'] == $ifname) echo "selected=\"selected\""; ?> > <?="$ifname - $vip"; ?></option>
- <?php } ?>
- </select><br />
- <strong><?php printf(gettext("Select the Interface for the Router Advertisement (RA) Daemon."))?></strong>
- </td>
- </tr>
- <?php } ?>
-
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("RA Subnet(s)");?></td>
- <td width="78%" class="vtable">
- <div><?= htmlentities($subnets_help) ?></div>
- <table id="maintable" summary="subnets">
- <tbody>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Router Advertisements");?></td>
+ <td width="78%" class="vtable">
+ <select name="ramode" id="ramode">
+ <?php foreach ($advertise_modes as $name => $value) { ?>
+ <option value="<?=$name ?>" <?php if ($pconfig['ramode'] == $name) echo "selected=\"selected\""; ?> > <?=$value ?></option>
+ <?php } ?>
+ </select>
+ <br />
+ <strong><?php printf(gettext("Select the Operating Mode for the Router Advertisement (RA) Daemon."))?></strong>
+ <?php printf(gettext("Use \"Router Only\" to only advertise this router, \"Unmanaged\" for Router Advertising with Stateless Autoconfig, \"Managed\" for assignment through (a) DHCPv6 Server, \"Assisted\" for DHCPv6 Server assignment combined with Stateless Autoconfig"));?>
+ <?php printf(gettext("It is not required to activate this DHCPv6 server when set to \"Managed\", this can be another host on the network")); ?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Router Priority");?></td>
+ <td width="78%" class="vtable">
+ <select name="rapriority" id="rapriority">
+ <?php foreach ($priority_modes as $name => $value) { ?>
+ <option value="<?=$name ?>" <?php if ($pconfig['rapriority'] == $name) echo "selected=\"selected\""; ?> > <?=$value ?></option>
+ <?php } ?>
+ </select>
+ <br />
+ <strong><?php printf(gettext("Select the Priority for the Router Advertisement (RA) Daemon."))?></strong>
+ </td>
+ </tr>
<?php
- $counter = 0;
- foreach ($pconfig['subnets'] as $subnet) {
- $address_name = "subnet_address" . $counter;
- $bits_name = "subnet_bits" . $counter;
- list($address, $subnet) = explode("/", $subnet);
+ $carplistif = array();
+ if (count($carplist) > 0) {
+ foreach ($carplist as $ifname => $vip) {
+ if ((preg_match("/^{$if}_/", $ifname)) && (is_ipaddrv6($vip))) {
+ $carplistif[$ifname] = $vip;
+ }
+ }
+ }
+ if (count($carplistif) > 0) {
?>
- <tr>
- <td>
- <input autocomplete="off" name="<?= $address_name ?>" type="text" class="formfldalias" id="<?= $address_name ?>" size="30" value="<?= htmlentities($address) ?>" />
- </td>
- <td>
- <select name="<?= $bits_name ?>" class="formselect" id="<?= $bits_name ?>">
- <option value="">
- <?php for ($i = 128; $i >= 0; $i -= 1) { ?>
- <option value="<?= $i ?>" <?= ("$subnet" === "$i") ? "selected='selected'" : "" ?>><?= $i ?></option>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("RA Interface");?></td>
+ <td width="78%" class="vtable">
+ <select name="rainterface" id="rainterface">
+ <?php foreach ($carplistif as $ifname => $vip) { ?>
+ <option value="interface" <?php if ($pconfig['rainterface'] == "interface") echo "selected=\"selected\""; ?> > <?=strtoupper($if); ?></option>
+ <option value="<?=$ifname ?>" <?php if ($pconfig['rainterface'] == $ifname) echo "selected=\"selected\""; ?> > <?="$ifname - $vip"; ?></option>
<?php } ?>
- </select>
- </td>
- <td>
- <a onclick="removeRow(this); return false;" href="#"><img border="0" src="/themes/<?echo $g['theme'];?>/images/icons/icon_x.gif" alt="" title="<?=gettext("remove this entry"); ?>" /></a>
- </td>
- </tr>
+ </select>
+ <br />
+ <strong><?php printf(gettext("Select the Interface for the Router Advertisement (RA) Daemon."))?></strong>
+ </td>
+ </tr>
+<?php
+ }
+?>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("RA Subnet(s)");?></td>
+ <td width="78%" class="vtable">
+ <div><?= htmlentities($subnets_help) ?></div>
+ <table id="maintable" summary="subnets">
+ <tbody>
<?php
- $counter += 1;
- }
+ $counter = 0;
+ foreach ($pconfig['subnets'] as $subnet) {
+ $address_name = "subnet_address" . $counter;
+ $bits_name = "subnet_bits" . $counter;
+ list($address, $subnet) = explode("/", $subnet);
+?>
+ <tr>
+ <td>
+ <input autocomplete="off" name="<?= $address_name ?>" type="text" class="formfldalias" id="<?= $address_name ?>" size="30" value="<?= htmlentities($address) ?>" />
+ </td>
+ <td>
+ <select name="<?= $bits_name ?>" class="formselect" id="<?= $bits_name ?>">
+ <option value="">
+ <?php for ($i = 128; $i >= 0; $i -= 1) { ?>
+ <option value="<?= $i ?>" <?= ("$subnet" === "$i") ? "selected='selected'" : "" ?>><?= $i ?></option>
+ <?php } ?>
+ </select>
+ </td>
+ <td>
+ <a onclick="removeRow(this); return false;" href="#"><img border="0" src="/themes/<?echo $g['theme'];?>/images/icons/icon_x.gif" alt="" title="<?=gettext("remove this entry"); ?>" /></a>
+ </td>
+ </tr>
+<?php
+ $counter += 1;
+ }
?>
- <tr style="display:none"><td></td></tr>
- </tbody>
- </table>
- <script type="text/javascript">
- //<![CDATA[
- field_counter_js = 2;
- totalrows = <?= $counter ?>;
- //]]>
- </script>
- <div id="addrowbutton">
- <a onclick="javascript:addRowTo('maintable'); add_alias_control(); return false;" href="#"><!--
- --><img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" alt="" title="<?=gettext("add another entry"); ?>" /></a>
- </div>
- </td>
- </tr>
-
- <tr>
- <td colspan="2" class="list" height="12">&nbsp;</td>
- </tr>
-
- <tr>
- <td colspan="2" valign="top" class="listtopic">DNS</td>
- </tr>
-
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("DNS servers");?></td>
- <td width="78%" class="vtable">
- <input name="radns1" type="text" class="formfld unknown" id="radns1" size="28" value="<?=htmlspecialchars($pconfig['radns1']);?>" /><br />
- <input name="radns2" type="text" class="formfld unknown" id="radns2" size="28" value="<?=htmlspecialchars($pconfig['radns2']);?>" /><br />
- <input name="radns3" type="text" class="formfld unknown" id="radns3" size="28" value="<?=htmlspecialchars($pconfig['radns3']);?>" /><br />
- <input name="radns4" type="text" class="formfld unknown" id="radns4" size="28" value="<?=htmlspecialchars($pconfig['radns4']);?>" /><br />
- <?=gettext("NOTE: leave blank to use the system default DNS servers - this interface's IP if DNS forwarder is enabled, otherwise the servers configured on the General page.");?>
- </td>
- </tr>
-
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Domain search list");?></td>
- <td width="78%" class="vtable">
- <input name="radomainsearchlist" type="text" class="formfld unknown" id="radomainsearchlist" size="28" value="<?=htmlspecialchars($pconfig['radomainsearchlist']);?>" /><br />
- <?=gettext("The RA server can optionally provide a domain search list. Use the semicolon character as separator");?>
- </td>
- </tr>
-
- <tr>
- <td width="22%" valign="top" class="vncell">&nbsp;</td>
- <td width="78%" class="vtable">
- <input id="rasamednsasdhcp6" name="rasamednsasdhcp6" type="checkbox" value="yes" <?php if ($pconfig['rasamednsasdhcp6']) { echo "checked='checked'"; } ?> />
- <strong><?= gettext("Use same settings as DHCPv6 server"); ?></strong>
- </td>
- </tr>
-
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="if" type="hidden" value="<?=$if;?>" />
- <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
- </td>
- </tr>
- </table>
- </div>
-</td>
-</tr>
+ <tr style="display:none">
+ <td></td>
+ </tr>
+ </tbody>
+ </table>
+ <script type="text/javascript">
+ //<![CDATA[
+ field_counter_js = 2;
+ totalrows = <?= $counter ?>;
+ //]]>
+ </script>
+ <div id="addrowbutton">
+ <a onclick="javascript:addRowTo('maintable'); add_alias_control(); return false;" href="#"><!--
+ --><img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" alt="" title="<?=gettext("add another entry"); ?>" /></a>
+ </div>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2" class="list" height="12">&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td colspan="2" valign="top" class="listtopic">DNS</td>
+ </tr>
+
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("DNS servers");?></td>
+ <td width="78%" class="vtable">
+ <input name="radns1" type="text" class="formfld unknown" id="radns1" size="28" value="<?=htmlspecialchars($pconfig['radns1']);?>" /><br />
+ <input name="radns2" type="text" class="formfld unknown" id="radns2" size="28" value="<?=htmlspecialchars($pconfig['radns2']);?>" /><br />
+ <input name="radns3" type="text" class="formfld unknown" id="radns3" size="28" value="<?=htmlspecialchars($pconfig['radns3']);?>" /><br />
+ <input name="radns4" type="text" class="formfld unknown" id="radns4" size="28" value="<?=htmlspecialchars($pconfig['radns4']);?>" /><br />
+ <?=gettext("NOTE: leave blank to use the system default DNS servers - this interface's IP if DNS forwarder is enabled, otherwise the servers configured on the General page.");?>
+ </td>
+ </tr>
+
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Domain search list");?></td>
+ <td width="78%" class="vtable">
+ <input name="radomainsearchlist" type="text" class="formfld unknown" id="radomainsearchlist" size="28" value="<?=htmlspecialchars($pconfig['radomainsearchlist']);?>" /><br />
+ <?=gettext("The RA server can optionally provide a domain search list. Use the semicolon character as separator");?>
+ </td>
+ </tr>
+
+ <tr>
+ <td width="22%" valign="top" class="vncell">&nbsp;</td>
+ <td width="78%" class="vtable">
+ <input id="rasamednsasdhcp6" name="rasamednsasdhcp6" type="checkbox" value="yes" <?php if ($pconfig['rasamednsasdhcp6']) { echo "checked='checked'"; } ?> />
+ <strong><?= gettext("Use same settings as DHCPv6 server"); ?></strong>
+ </td>
+ </tr>
+
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input name="if" type="hidden" value="<?=$if;?>" />
+ <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
+ </td>
+ </tr>
+ </table>
+ </div>
+ </td>
+ </tr>
</table>
</form>
diff --git a/usr/local/www/services_snmp.php b/usr/local/www/services_snmp.php
index 4d8b34b..a29ade0 100644
--- a/usr/local/www/services_snmp.php
+++ b/usr/local/www/services_snmp.php
@@ -1,26 +1,26 @@
-<?php
+<?php
/* $Id$ */
/*
services_snmp.php
part of m0n0wall (http://m0n0.ch/wall)
-
+
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved.
part of pfSense
Copyright (C) 2013-2015 Electric Sheep Fencing, LP
All rights reserved.
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-
+
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
-
+
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
@@ -92,9 +92,15 @@ if ($_POST) {
/* input validation */
if ($_POST['enable']) {
- if (strstr($_POST['syslocation'],"#")) $input_errors[] = gettext("Invalid character '#' in system location");
- if (strstr($_POST['syscontact'],"#")) $input_errors[] = gettext("Invalid character '#' in system contact");
- if (strstr($_POST['rocommunity'],"#")) $input_errors[] = gettext("Invalid character '#' in read community string");
+ if (strstr($_POST['syslocation'], "#")) {
+ $input_errors[] = gettext("Invalid character '#' in system location");
+ }
+ if (strstr($_POST['syscontact'], "#")) {
+ $input_errors[] = gettext("Invalid character '#' in system contact");
+ }
+ if (strstr($_POST['rocommunity'], "#")) {
+ $input_errors[] = gettext("Invalid character '#' in read community string");
+ }
$reqdfields = explode(" ", "rocommunity");
$reqdfieldsn = array(gettext("Community"));
@@ -103,12 +109,14 @@ if ($_POST) {
$reqdfields = explode(" ", "pollport");
$reqdfieldsn = array(gettext("Polling Port"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
-
-
+
+
}
if ($_POST['trapenable']) {
- if (strstr($_POST['trapstring'],"#")) $input_errors[] = gettext("Invalid character '#' in SNMP trap string");
+ if (strstr($_POST['trapstring'], "#")) {
+ $input_errors[] = gettext("Invalid character '#' in SNMP trap string");
+ }
$reqdfields = explode(" ", "trapserver");
$reqdfieldsn = array(gettext("Trap server"));
@@ -126,18 +134,18 @@ if ($_POST) {
/* disabled until some docs show up on what this does.
if ($_POST['rwenable']) {
- $reqdfields = explode(" ", "rwcommunity");
- $reqdfieldsn = explode(",", "Write community string");
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
+ $reqdfields = explode(" ", "rwcommunity");
+ $reqdfieldsn = explode(",", "Write community string");
+ do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
}
*/
-
+
if (!$input_errors) {
$config['snmpd']['enable'] = $_POST['enable'] ? true : false;
$config['snmpd']['pollport'] = $_POST['pollport'];
- $config['snmpd']['syslocation'] = $_POST['syslocation'];
+ $config['snmpd']['syslocation'] = $_POST['syslocation'];
$config['snmpd']['syscontact'] = $_POST['syscontact'];
$config['snmpd']['rocommunity'] = $_POST['rocommunity'];
/* disabled until some docs show up on what this does.
@@ -148,7 +156,7 @@ if ($_POST) {
$config['snmpd']['trapserver'] = $_POST['trapserver'];
$config['snmpd']['trapserverport'] = $_POST['trapserverport'];
$config['snmpd']['trapstring'] = $_POST['trapstring'];
-
+
$config['snmpd']['modules']['mibii'] = $_POST['mibii'] ? true : false;
$config['snmpd']['modules']['netgraph'] = $_POST['netgraph'] ? true : false;
$config['snmpd']['modules']['pf'] = $_POST['pf'] ? true : false;
@@ -157,9 +165,9 @@ if ($_POST) {
$config['snmpd']['modules']['ucd'] = $_POST['ucd'] ? true : false;
$config['snmpd']['modules']['regex'] = $_POST['regex'] ? true : false;
$config['snmpd']['bindip'] = $_POST['bindip'];
-
+
write_config();
-
+
$retval = 0;
$retval = services_snmpd_configure();
$savemsg = get_std_save_message($retval);
@@ -167,7 +175,7 @@ if ($_POST) {
}
$closehead = false;
-$pgtitle = array(gettext("Services"),gettext("SNMP"));
+$pgtitle = array(gettext("Services"), gettext("SNMP"));
$shortcut_section = "snmp";
include("head.inc");
@@ -176,102 +184,85 @@ include("head.inc");
//<![CDATA[
function check_deps() {
if (jQuery('#hostres').prop('checked') == true) {
- jQuery('#mibii').prop('checked',true);
+ jQuery('#mibii').prop('checked', true);
}
}
function enable_change(whichone) {
- if( whichone.name == "trapenable" )
- {
- if( whichone.checked == true )
- {
- document.iform.trapserver.disabled = false;
- document.iform.trapserverport.disabled = false;
- document.iform.trapstring.disabled = false;
- }
- else
- {
- document.iform.trapserver.disabled = true;
- document.iform.trapserverport.disabled = true;
- document.iform.trapstring.disabled = true;
- }
+ if (whichone.name == "trapenable") {
+ if (whichone.checked == true) {
+ document.iform.trapserver.disabled = false;
+ document.iform.trapserverport.disabled = false;
+ document.iform.trapstring.disabled = false;
+ } else {
+ document.iform.trapserver.disabled = true;
+ document.iform.trapserverport.disabled = true;
+ document.iform.trapstring.disabled = true;
+ }
}
/* disabled until some docs show up on what this does.
- if( whichone.name == "rwenable" )
- {
- if( whichone.checked == true )
- {
- document.iform.rwcommunity.disabled = false;
- }
- else
- {
- document.iform.rwcommunity.disabled = true;
- }
+ if (whichone.name == "rwenable") {
+ if (whichone.checked == true) {
+ document.iform.rwcommunity.disabled = false;
+ } else {
+ document.iform.rwcommunity.disabled = true;
+ }
}
*/
- if( document.iform.enable.checked == true )
- {
- document.iform.pollport.disabled = false;
- document.iform.syslocation.disabled = false;
- document.iform.syscontact.disabled = false;
- document.iform.rocommunity.disabled = false;
- document.iform.trapenable.disabled = false;
- /* disabled until some docs show up on what this does.
- document.iform.rwenable.disabled = false;
- if( document.iform.rwenable.checked == true )
- {
- document.iform.rwcommunity.disabled = false;
- }
- else
- {
+ if (document.iform.enable.checked == true) {
+ document.iform.pollport.disabled = false;
+ document.iform.syslocation.disabled = false;
+ document.iform.syscontact.disabled = false;
+ document.iform.rocommunity.disabled = false;
+ document.iform.trapenable.disabled = false;
+ /* disabled until some docs show up on what this does.
+ document.iform.rwenable.disabled = false;
+ if (document.iform.rwenable.checked == true) {
+ document.iform.rwcommunity.disabled = false;
+ } else {
+ document.iform.rwcommunity.disabled = true;
+ }
+ */
+ if (document.iform.trapenable.checked == true) {
+ document.iform.trapserver.disabled = false;
+ document.iform.trapserverport.disabled = false;
+ document.iform.trapstring.disabled = false;
+ } else {
+ document.iform.trapserver.disabled = true;
+ document.iform.trapserverport.disabled = true;
+ document.iform.trapstring.disabled = true;
+ }
+ document.iform.mibii.disabled = false;
+ document.iform.netgraph.disabled = false;
+ document.iform.pf.disabled = false;
+ document.iform.hostres.disabled = false;
+ document.iform.ucd.disabled = false;
+ document.iform.regex.disabled = false;
+ //document.iform.bridge.disabled = false;
+ } else {
+ document.iform.pollport.disabled = true;
+ document.iform.syslocation.disabled = true;
+ document.iform.syscontact.disabled = true;
+ document.iform.rocommunity.disabled = true;
+ /*
+ document.iform.rwenable.disabled = true;
document.iform.rwcommunity.disabled = true;
- }
- */
- if( document.iform.trapenable.checked == true )
- {
- document.iform.trapserver.disabled = false;
- document.iform.trapserverport.disabled = false;
- document.iform.trapstring.disabled = false;
- }
- else
- {
- document.iform.trapserver.disabled = true;
- document.iform.trapserverport.disabled = true;
- document.iform.trapstring.disabled = true;
- }
- document.iform.mibii.disabled = false;
- document.iform.netgraph.disabled = false;
- document.iform.pf.disabled = false;
- document.iform.hostres.disabled = false;
- document.iform.ucd.disabled = false;
- document.iform.regex.disabled = false;
- //document.iform.bridge.disabled = false;
- }
- else
- {
- document.iform.pollport.disabled = true;
- document.iform.syslocation.disabled = true;
- document.iform.syscontact.disabled = true;
- document.iform.rocommunity.disabled = true;
- /*
- document.iform.rwenable.disabled = true;
- document.iform.rwcommunity.disabled = true;
- */
- document.iform.trapenable.disabled = true;
- document.iform.trapserver.disabled = true;
- document.iform.trapserverport.disabled = true;
- document.iform.trapstring.disabled = true;
-
- document.iform.mibii.disabled = true;
- document.iform.netgraph.disabled = true;
- document.iform.pf.disabled = true;
- document.iform.hostres.disabled = true;
- document.iform.ucd.disabled = true;
- document.iform.regex.disabled = true;
- //document.iform.bridge.disabled = true;
+ */
+ document.iform.trapenable.disabled = true;
+ document.iform.trapserver.disabled = true;
+ document.iform.trapserverport.disabled = true;
+ document.iform.trapstring.disabled = true;
+
+ document.iform.mibii.disabled = true;
+ document.iform.netgraph.disabled = true;
+ document.iform.pf.disabled = true;
+ document.iform.hostres.disabled = true;
+ document.iform.ucd.disabled = true;
+ document.iform.regex.disabled = true;
+ //document.iform.bridge.disabled = true;
}
}
//]]>
@@ -281,142 +272,166 @@ function enable_change(whichone) {
<?php include("fbegin.inc"); ?>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
- <form action="services_snmp.php" method="post" name="iform" id="iform">
- <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="snmp">
-
- <tr>
- <td colspan="2" valign="top" class="optsect_t">
- <table border="0" cellspacing="0" cellpadding="0" width="100%" summary="enable">
- <tr><td class="optsect_s"><strong><?=gettext("SNMP Daemon");?></strong></td>
- <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>
- </table></td>
- </tr>
-
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Polling Port ");?></td>
- <td width="78%" class="vtable">
- <input name="pollport" type="text" class="formfld unknown" id="pollport" size="40" value="<?=htmlspecialchars($pconfig['pollport']) ? htmlspecialchars($pconfig['pollport']) : htmlspecialchars(161);?>" />
- <br /><?=gettext("Enter the port to accept polling events on (default 161)");?><br />
- </td>
- </tr>
-
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("System location");?></td>
- <td width="78%" class="vtable">
- <input name="syslocation" type="text" class="formfld unknown" id="syslocation" size="40" value="<?=htmlspecialchars($pconfig['syslocation']);?>" />
- </td>
- </tr>
-
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("System contact");?></td>
- <td width="78%" class="vtable">
- <input name="syscontact" type="text" class="formfld unknown" id="syscontact" size="40" value="<?=htmlspecialchars($pconfig['syscontact']);?>" />
- </td>
- </tr>
-
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Read Community String");?></td>
- <td width="78%" class="vtable">
- <input name="rocommunity" type="text" class="formfld unknown" id="rocommunity" size="40" value="<?=htmlspecialchars($pconfig['rocommunity']);?>" />
- <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 />
- </td>
- </tr>
- <tr><td>&nbsp;</td></tr>
-
- <tr>
- <td colspan="2" valign="top" class="optsect_t">
- <table border="0" cellspacing="0" cellpadding="0" width="100%" summary="enable">
- <tr><td class="optsect_s"><strong><?=gettext("SNMP Traps");?></strong></td>
- <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>
- </table></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Trap server");?></td>
- <td width="78%" class="vtable">
- <input name="trapserver" type="text" class="formfld unknown" id="trapserver" size="40" value="<?=htmlspecialchars($pconfig['trapserver']);?>" />
- <br /><?=gettext("Enter trap server name");?><br />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Trap server port ");?></td>
- <td width="78%" class="vtable">
- <input name="trapserverport" type="text" class="formfld unknown" id="trapserverport" size="40" value="<?=htmlspecialchars($pconfig['trapserverport']) ? htmlspecialchars($pconfig['trapserverport']) : htmlspecialchars(162);?>" />
- <br /><?=gettext("Enter the port to send the traps to (default 162)");?><br />
- </td>
- </tr>
-
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Enter the SNMP trap string");?></td>
- <td width="78%" class="vtable">
- <input name="trapstring" type="text" class="formfld unknown" id="trapstring" size="40" value="<?=htmlspecialchars($pconfig['trapstring']);?>" />
- <br /><?=gettext("Trap string");?><br />
- </td>
- </tr>
-
- <tr><td>&nbsp;</td></tr>
-
- <tr>
- <td colspan="2" valign="top" class="optsect_t">
- <table border="0" cellspacing="0" cellpadding="0" width="100%" summary="modules">
- <tr><td class="optsect_s"><strong><?=gettext("Modules");?></strong></td>
- <td align="right" class="optsect_s">&nbsp;</td></tr>
- </table></td>
- </tr>
+<form action="services_snmp.php" method="post" name="iform" id="iform">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="snmp">
+ <tr>
+ <td colspan="2" valign="top" class="optsect_t">
+ <table border="0" cellspacing="0" cellpadding="0" width="100%" summary="enable">
+ <tr>
+ <td class="optsect_s"><strong><?=gettext("SNMP Daemon");?></strong></td>
+ <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>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Polling Port ");?></td>
+ <td width="78%" class="vtable">
+ <input name="pollport" type="text" class="formfld unknown" id="pollport" size="40" value="<?=htmlspecialchars($pconfig['pollport']) ? htmlspecialchars($pconfig['pollport']) : htmlspecialchars(161);?>" />
+ <br /><?=gettext("Enter the port to accept polling events on (default 161)");?><br />
+ </td>
+ </tr>
<tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("SNMP Modules");?></td>
- <td width="78%" class="vtable">
- <input name="mibii" type="checkbox" id="mibii" value="yes" onclick="check_deps()" <?php if ($pconfig['mibii']) echo "checked=\"checked\""; ?> /><?=gettext("MibII"); ?>
- <br />
- <input name="netgraph" type="checkbox" id="netgraph" value="yes" <?php if ($pconfig['netgraph']) echo "checked=\"checked\""; ?> /><?=gettext("Netgraph"); ?>
- <br />
- <input name="pf" type="checkbox" id="pf" value="yes" <?php if ($pconfig['pf']) echo "checked=\"checked\""; ?> /><?=gettext("PF"); ?>
- <br />
- <input name="hostres" type="checkbox" id="hostres" value="yes" onclick="check_deps()" <?php if ($pconfig['hostres']) echo "checked=\"checked\""; ?> /><?=gettext("Host Resources (Requires MibII)");?>
- <br />
- <input name="ucd" type="checkbox" id="ucd" value="yes" <?php if ($pconfig['ucd']) echo "checked=\"checked\""; ?> /><?=gettext("UCD"); ?>
- <br />
- <input name="regex" type="checkbox" id="regex" value="yes" <?php if ($pconfig['regex']) echo "checked=\"checked\""; ?> /><?=gettext("Regex"); ?>
- <br />
- </td>
+ <td width="22%" valign="top" class="vncell"><?=gettext("System location");?></td>
+ <td width="78%" class="vtable">
+ <input name="syslocation" type="text" class="formfld unknown" id="syslocation" size="40" value="<?=htmlspecialchars($pconfig['syslocation']);?>" />
+ </td>
</tr>
- <tr><td>&nbsp;</td></tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("System contact");?></td>
+ <td width="78%" class="vtable">
+ <input name="syscontact" type="text" class="formfld unknown" id="syscontact" size="40" value="<?=htmlspecialchars($pconfig['syscontact']);?>" />
+ </td>
+ </tr>
+
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Read Community String");?></td>
+ <td width="78%" class="vtable">
+ <input name="rocommunity" type="text" class="formfld unknown" id="rocommunity" size="40" value="<?=htmlspecialchars($pconfig['rocommunity']);?>" />
+ <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 />
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
<tr>
<td colspan="2" valign="top" class="optsect_t">
- <table border="0" cellspacing="0" cellpadding="0" width="100%" summary="interface">
- <tr><td class="optsect_s"><strong><?=gettext("Interface Binding");?></strong></td>
- <td align="right" class="optsect_s">&nbsp;</td></tr>
- </table></td>
+ <table border="0" cellspacing="0" cellpadding="0" width="100%" summary="enable">
+ <tr>
+ <td class="optsect_s"><strong><?=gettext("SNMP Traps");?></strong></td>
+ <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>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Trap server");?></td>
+ <td width="78%" class="vtable">
+ <input name="trapserver" type="text" class="formfld unknown" id="trapserver" size="40" value="<?=htmlspecialchars($pconfig['trapserver']);?>" />
+ <br /><?=gettext("Enter trap server name");?><br />
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Trap server port ");?></td>
+ <td width="78%" class="vtable">
+ <input name="trapserverport" type="text" class="formfld unknown" id="trapserverport" size="40" value="<?=htmlspecialchars($pconfig['trapserverport']) ? htmlspecialchars($pconfig['trapserverport']) : htmlspecialchars(162);?>" />
+ <br /><?=gettext("Enter the port to send the traps to (default 162)");?><br />
+ </td>
+ </tr>
+
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Enter the SNMP trap string");?></td>
+ <td width="78%" class="vtable">
+ <input name="trapstring" type="text" class="formfld unknown" id="trapstring" size="40" value="<?=htmlspecialchars($pconfig['trapstring']);?>" />
+ <br /><?=gettext("Trap string");?><br />
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td colspan="2" valign="top" class="optsect_t">
+ <table border="0" cellspacing="0" cellpadding="0" width="100%" summary="modules">
+ <tr>
+ <td class="optsect_s"><strong><?=gettext("Modules");?></strong></td>
+ <td align="right" class="optsect_s">&nbsp;</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("SNMP Modules");?></td>
+ <td width="78%" class="vtable">
+ <input name="mibii" type="checkbox" id="mibii" value="yes" onclick="check_deps()" <?php if ($pconfig['mibii']) echo "checked=\"checked\""; ?> /><?=gettext("MibII"); ?>
+ <br />
+ <input name="netgraph" type="checkbox" id="netgraph" value="yes" <?php if ($pconfig['netgraph']) echo "checked=\"checked\""; ?> /><?=gettext("Netgraph"); ?>
+ <br />
+ <input name="pf" type="checkbox" id="pf" value="yes" <?php if ($pconfig['pf']) echo "checked=\"checked\""; ?> /><?=gettext("PF"); ?>
+ <br />
+ <input name="hostres" type="checkbox" id="hostres" value="yes" onclick="check_deps()" <?php if ($pconfig['hostres']) echo "checked=\"checked\""; ?> /><?=gettext("Host Resources (Requires MibII)");?>
+ <br />
+ <input name="ucd" type="checkbox" id="ucd" value="yes" <?php if ($pconfig['ucd']) echo "checked=\"checked\""; ?> /><?=gettext("UCD"); ?>
+ <br />
+ <input name="regex" type="checkbox" id="regex" value="yes" <?php if ($pconfig['regex']) echo "checked=\"checked\""; ?> /><?=gettext("Regex"); ?>
+ <br />
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td colspan="2" valign="top" class="optsect_t">
+ <table border="0" cellspacing="0" cellpadding="0" width="100%" summary="interface">
+ <tr>
+ <td class="optsect_s"><strong><?=gettext("Interface Binding");?></strong></td>
+ <td align="right" class="optsect_s">&nbsp;</td>
+ </tr>
+ </table>
+ </td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Bind Interface"); ?></td>
<td width="78%" class="vtable">
<select name="bindip" class="formselect">
<option value="">All</option>
- <?php $listenips = get_possible_listen_ips();
+ <?php
+ $listenips = get_possible_listen_ips();
foreach ($listenips as $lip => $ldescr):
$selected = "";
- if ($lip == $pconfig['bindip'])
+ if ($lip == $pconfig['bindip']) {
$selected = "selected=\"selected\"";
+ }
?>
<option value="<?=$lip;?>" <?=$selected;?>>
<?=htmlspecialchars($ldescr);?>
</option>
- <?php endforeach;
- unset($listenips);
+ <?php
+ endforeach;
+ unset($listenips);
?>
</select>
</td>
</tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="enable_change(true)" />
- </td>
- </tr>
- </table>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="enable_change(true)" />
+ </td>
+ </tr>
+ </table>
</form>
<script type="text/javascript">
//<![CDATA[
diff --git a/usr/local/www/services_wol.php b/usr/local/www/services_wol.php
index 0993d8e..e443ab0 100644
--- a/usr/local/www/services_wol.php
+++ b/usr/local/www/services_wol.php
@@ -30,7 +30,7 @@
POSSIBILITY OF SUCH DAMAGE.
*/
/*
- pfSense_BUILDER_BINARIES: /usr/local/bin/wol
+ pfSense_BUILDER_BINARIES: /usr/local/bin/wol
pfSense_MODULE: wol
*/
@@ -48,7 +48,7 @@ if (!is_array($config['wol']['wolentry'])) {
}
$a_wol = &$config['wol']['wolentry'];
-if($_GET['wakeall'] <> "") {
+if ($_GET['wakeall'] <> "") {
$i = 0;
$savemsg = "";
foreach ($a_wol as $wolent) {
@@ -56,14 +56,16 @@ if($_GET['wakeall'] <> "") {
$if = $wolent['interface'];
$description = $wolent['descr'];
$ipaddr = get_interface_ip($if);
- if (!is_ipaddr($ipaddr))
+ if (!is_ipaddr($ipaddr)) {
continue;
+ }
$bcip = gen_subnet_max($ipaddr, get_interface_subnet($if));
/* Execute wol command and check return code. */
- if (!mwexec("/usr/local/bin/wol -i {$bcip} {$mac}"))
- $savemsg .= sprintf(gettext('Sent magic packet to %1$s (%2$s)%3$s'),$mac, $description, ".<br />");
- else
- $savemsg .= sprintf(gettext('Please check the %1$ssystem log%2$s, the wol command for %3$s (%4$s) did not complete successfully%5$s'),'<a href="/diag_logs.php">','</a>',$description,$mac,".<br />");
+ if (!mwexec("/usr/local/bin/wol -i {$bcip} {$mac}")) {
+ $savemsg .= sprintf(gettext('Sent magic packet to %1$s (%2$s)%3$s'), $mac, $description, ".<br />");
+ } else {
+ $savemsg .= sprintf(gettext('Please check the %1$ssystem log%2$s, the wol command for %3$s (%4$s) did not complete successfully%5$s'), '<a href="/diag_logs.php">', '</a>', $description, $mac, ".<br />");
+ }
}
}
@@ -71,35 +73,38 @@ if ($_POST || $_GET['mac']) {
unset($input_errors);
if ($_GET['mac']) {
- /* normalize MAC addresses - lowercase and convert Windows-ized hyphenated MACs to colon delimited */
- $_GET['mac'] = strtolower(str_replace("-", ":", $_GET['mac']));
+ /* normalize MAC addresses - lowercase and convert Windows-ized hyphenated MACs to colon delimited */
+ $_GET['mac'] = strtolower(str_replace("-", ":", $_GET['mac']));
$mac = $_GET['mac'];
$if = $_GET['if'];
} else {
- /* normalize MAC addresses - lowercase and convert Windows-ized hyphenated MACs to colon delimited */
- $_POST['mac'] = strtolower(str_replace("-", ":", $_POST['mac']));
+ /* normalize MAC addresses - lowercase and convert Windows-ized hyphenated MACs to colon delimited */
+ $_POST['mac'] = strtolower(str_replace("-", ":", $_POST['mac']));
$mac = $_POST['mac'];
$if = $_POST['interface'];
}
/* input validation */
- if (!$mac || !is_macaddr($mac))
+ if (!$mac || !is_macaddr($mac)) {
$input_errors[] = gettext("A valid MAC address must be specified.");
- if (!$if)
+ }
+ if (!$if) {
$input_errors[] = gettext("A valid interface must be specified.");
+ }
if (!$input_errors) {
/* determine broadcast address */
$ipaddr = get_interface_ip($if);
- if (!is_ipaddr($ipaddr))
+ if (!is_ipaddr($ipaddr)) {
$input_errors[] = gettext("A valid ip could not be found!");
- else {
+ } else {
$bcip = gen_subnet_max($ipaddr, get_interface_subnet($if));
/* Execute wol command and check return code. */
- if(!mwexec("/usr/local/bin/wol -i {$bcip} " . escapeshellarg($mac)))
- $savemsg .= sprintf(gettext("Sent magic packet to %s."),$mac);
- else
- $savemsg .= sprintf(gettext('Please check the %1$ssystem log%2$s, the wol command for %3$s did not complete successfully%4$s'),'<a href="/diag_logs.php">', '</a>', $mac, ".<br />");
+ if (!mwexec("/usr/local/bin/wol -i {$bcip} " . escapeshellarg($mac))) {
+ $savemsg .= sprintf(gettext("Sent magic packet to %s."), $mac);
+ } else {
+ $savemsg .= sprintf(gettext('Please check the %1$ssystem log%2$s, the wol command for %3$s did not complete successfully%4$s'), '<a href="/diag_logs.php">', '</a>', $mac, ".<br />");
+ }
}
}
}
@@ -113,7 +118,7 @@ if ($_GET['act'] == "del") {
}
}
-$pgtitle = array(gettext("Services"),gettext("Wake on LAN"));
+$pgtitle = array(gettext("Services"), gettext("Wake on LAN"));
include("head.inc");
?>
@@ -122,97 +127,106 @@ include("head.inc");
<?php include("fbegin.inc"); ?>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
- <form action="services_wol.php" method="post" name="iform" id="iform">
- <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="wake on lan">
- <tr>
- <td colspan="2" valign="top" class="listtopic"><?=gettext("Wake on LAN");?></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Interface");?></td>
- <td width="78%" class="vtable">
- <select name="interface" class="formselect">
- <?php
- $interfaces = get_configured_interface_with_descr();
- foreach ($interfaces as $iface => $ifacename): ?>
- <option value="<?=$iface;?>" <?php if (!link_interface_to_bridge($iface) && $iface == $if) echo "selected=\"selected\""; ?>>
- <?=htmlspecialchars($ifacename);?>
- </option>
- <?php endforeach; ?>
- </select> <br />
- <span class="vexpl"><?=gettext("Choose which interface the host to be woken up is connected to.");?></span></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("MAC address");?></td>
- <td width="78%" class="vtable">
- <input name="mac" type="text" class="formfld unknown" id="mac" size="20" value="<?=htmlspecialchars($mac);?>" />
- <br />
- <?=gettext("Enter a MAC address ");?><span class="vexpl"> <?=gettext("in the following format: xx:xx:xx:xx:xx:xx");?></span></td></tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Send");?>" />
- </td>
- </tr>
- </table>
- &nbsp;<br />
- <?=gettext("Wake all clients at once: ");?><a href="services_wol.php?wakeall=true"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_wol_all.gif" width="17" height="17" border="0" alt="wol all" /></a><br/>
- <?=gettext("Or Click the MAC address to wake up an individual device:");?>
- <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont" summary="clients">
- <tr>
- <td width="15%" class="listhdrr"><?=gettext("Interface");?></td>
- <td width="25%" class="listhdrr"><?=gettext("MAC address");?></td>
- <td width="50%" class="listhdr"><?=gettext("Description");?></td>
- <td width="10%" class="list">
- <table border="0" cellspacing="0" cellpadding="1" summary="add">
- <tr>
- <td valign="middle" width="17"></td>
- <td valign="middle"><a href="services_wol_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
- </tr>
- </table>
- </td>
+<form action="services_wol.php" method="post" name="iform" id="iform">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="wake on lan">
+ <tr>
+ <td colspan="2" valign="top" class="listtopic"><?=gettext("Wake on LAN");?></td>
</tr>
- <?php $i = 0; foreach ($a_wol as $wolent): ?>
- <tr>
- <td class="listlr" ondblclick="document.location='services_wol_edit.php?id=<?=$i;?>';">
- <?=convert_friendly_interface_to_friendly_descr($wolent['interface']);?>
- </td>
- <td class="listr" ondblclick="document.location='services_wol_edit.php?id=<?=$i;?>';">
- <a href="?mac=<?=$wolent['mac'];?>&amp;if=<?=$wolent['interface'];?>"><?=strtolower($wolent['mac']);?></a>
- </td>
- <td class="listbg" ondblclick="document.location='services_wol_edit.php?id=<?=$i;?>';">
- <?=htmlspecialchars($wolent['descr']);?>
- </td>
- <td valign="middle" class="list nowrap">
- <table border="0" cellspacing="0" cellpadding="1" summary="icons">
- <tr>
- <td valign="middle"><a href="services_wol_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" /></a></td>
- <td valign="middle"><a href="services_wol.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this entry?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" /></a></td>
- </tr>
- </table>
- </td>
- </tr>
- <?php $i++; endforeach; ?>
- <tr>
- <td class="list" colspan="3"></td>
- <td class="list">
- <table border="0" cellspacing="0" cellpadding="1" summary="add">
- <tr>
- <td valign="middle" width="17"></td>
- <td valign="middle"><a href="services_wol_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
- </tr>
- </table>
- </td>
-
- </tr>
- </table>
- <span class="vexpl">
- <span class="red">
- <strong>
- <?=gettext("Note:");?><br />
- </strong>
- </span><?=gettext("This service can be used to wake up (power on) computers by sending special"); ?> &quot;<?=gettext("Magic Packets"); ?>&quot;. <?=gettext("The NIC in the computer that is to be woken up must support Wake on LAN and has to be configured properly (WOL cable, BIOS settings). ");?>
- </span>
-
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Interface");?></td>
+ <td width="78%" class="vtable">
+ <select name="interface" class="formselect">
+ <?php
+ $interfaces = get_configured_interface_with_descr();
+ foreach ($interfaces as $iface => $ifacename): ?>
+ <option value="<?=$iface;?>" <?php if (!link_interface_to_bridge($iface) && $iface == $if) echo "selected=\"selected\""; ?>>
+ <?=htmlspecialchars($ifacename);?>
+ </option>
+ <?php endforeach; ?>
+ </select>
+ <br />
+ <span class="vexpl"><?=gettext("Choose which interface the host to be woken up is connected to.");?></span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("MAC address");?></td>
+ <td width="78%" class="vtable">
+ <input name="mac" type="text" class="formfld unknown" id="mac" size="20" value="<?=htmlspecialchars($mac);?>" />
+ <br />
+ <?=gettext("Enter a MAC address ");?><span class="vexpl"> <?=gettext("in the following format: xx:xx:xx:xx:xx:xx");?></span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Send");?>" />
+ </td>
+ </tr>
+ </table>
+ &nbsp;<br />
+ <?=gettext("Wake all clients at once: ");?><a href="services_wol.php?wakeall=true"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_wol_all.gif" width="17" height="17" border="0" alt="wol all" /></a><br/>
+ <?=gettext("Or Click the MAC address to wake up an individual device:");?>
+ <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont" summary="clients">
+ <tr>
+ <td width="15%" class="listhdrr"><?=gettext("Interface");?></td>
+ <td width="25%" class="listhdrr"><?=gettext("MAC address");?></td>
+ <td width="50%" class="listhdr"><?=gettext("Description");?></td>
+ <td width="10%" class="list">
+ <table border="0" cellspacing="0" cellpadding="1" summary="add">
+ <tr>
+ <td valign="middle" width="17"></td>
+ <td valign="middle"><a href="services_wol_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+<?php
+ $i = 0;
+ foreach ($a_wol as $wolent):
+?>
+ <tr>
+ <td class="listlr" ondblclick="document.location='services_wol_edit.php?id=<?=$i;?>';">
+ <?=convert_friendly_interface_to_friendly_descr($wolent['interface']);?>
+ </td>
+ <td class="listr" ondblclick="document.location='services_wol_edit.php?id=<?=$i;?>';">
+ <a href="?mac=<?=$wolent['mac'];?>&amp;if=<?=$wolent['interface'];?>"><?=strtolower($wolent['mac']);?></a>
+ </td>
+ <td class="listbg" ondblclick="document.location='services_wol_edit.php?id=<?=$i;?>';">
+ <?=htmlspecialchars($wolent['descr']);?>
+ </td>
+ <td valign="middle" class="list nowrap">
+ <table border="0" cellspacing="0" cellpadding="1" summary="icons">
+ <tr>
+ <td valign="middle"><a href="services_wol_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" /></a></td>
+ <td valign="middle"><a href="services_wol.php?act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this entry?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" /></a></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+<?php
+ $i++;
+ endforeach;
+?>
+ <tr>
+ <td class="list" colspan="3"></td>
+ <td class="list">
+ <table border="0" cellspacing="0" cellpadding="1" summary="add">
+ <tr>
+ <td valign="middle" width="17"></td>
+ <td valign="middle"><a href="services_wol_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ <span class="vexpl">
+ <span class="red">
+ <strong>
+ <?=gettext("Note:");?><br />
+ </strong>
+ </span>
+ <?=gettext("This service can be used to wake up (power on) computers by sending special"); ?> &quot;<?=gettext("Magic Packets"); ?>&quot;. <?=gettext("The NIC in the computer that is to be woken up must support Wake on LAN and has to be configured properly (WOL cable, BIOS settings). ");?>
+ </span>
</form>
<?php include("fend.inc"); ?>
</body>
diff --git a/usr/local/www/services_wol_edit.php b/usr/local/www/services_wol_edit.php
index da43c6f..21bf790 100644
--- a/usr/local/www/services_wol_edit.php
+++ b/usr/local/www/services_wol_edit.php
@@ -1,23 +1,23 @@
-<?php
+<?php
/* $Id$ */
/*
services_wol_edit.php
part of m0n0wall (http://m0n0.ch/wall)
-
+
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
Copyright (C) 2013-2015 Electric Sheep Fencing, LP
All rights reserved.
-
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
-
+
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
-
+
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
-
+
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
@@ -45,9 +45,9 @@ function wolcmp($a, $b) {
}
function wol_sort() {
- global $config;
+ global $config;
- usort($config['wol']['wolentry'], "wolcmp");
+ usort($config['wol']['wolentry'], "wolcmp");
}
require("guiconfig.inc");
@@ -59,18 +59,18 @@ if (!is_array($config['wol']['wolentry'])) {
}
$a_wol = &$config['wol']['wolentry'];
-if (is_numericint($_GET['id']))
+if (is_numericint($_GET['id'])) {
$id = $_GET['id'];
-if (isset($_POST['id']) && is_numericint($_POST['id']))
+}
+if (isset($_POST['id']) && is_numericint($_POST['id'])) {
$id = $_POST['id'];
+}
if (isset($id) && $a_wol[$id]) {
$pconfig['interface'] = $a_wol[$id]['interface'];
$pconfig['mac'] = $a_wol[$id]['mac'];
$pconfig['descr'] = $a_wol[$id]['descr'];
-}
-else
-{
+} else {
$pconfig['interface'] = $_GET['if'];
$pconfig['mac'] = $_GET['mac'];
$pconfig['descr'] = $_GET['descr'];
@@ -83,13 +83,13 @@ if ($_POST) {
/* input validation */
$reqdfields = explode(" ", "interface mac");
- $reqdfieldsn = array(gettext("Interface"),gettext("MAC address"));
-
+ $reqdfieldsn = array(gettext("Interface"), gettext("MAC address"));
+
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
- /* normalize MAC addresses - lowercase and convert Windows-ized hyphenated MACs to colon delimited */
- $_POST['mac'] = strtolower(str_replace("-", ":", $_POST['mac']));
-
+ /* normalize MAC addresses - lowercase and convert Windows-ized hyphenated MACs to colon delimited */
+ $_POST['mac'] = strtolower(str_replace("-", ":", $_POST['mac']));
+
if (($_POST['mac'] && !is_macaddr($_POST['mac']))) {
$input_errors[] = gettext("A valid MAC address must be specified.");
}
@@ -100,20 +100,21 @@ if ($_POST) {
$wolent['mac'] = $_POST['mac'];
$wolent['descr'] = $_POST['descr'];
- if (isset($id) && $a_wol[$id])
+ if (isset($id) && $a_wol[$id]) {
$a_wol[$id] = $wolent;
- else
+ } else {
$a_wol[] = $wolent;
+ }
wol_sort();
-
+
write_config();
-
+
header("Location: services_wol.php");
exit;
}
}
-$pgtitle = array(gettext("Services"),gettext("Wake on LAN"),gettext("Edit"));
+$pgtitle = array(gettext("Services"), gettext("Wake on LAN"), gettext("Edit"));
include("head.inc");
?>
@@ -121,51 +122,53 @@ include("head.inc");
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
<?php if ($input_errors) print_input_errors($input_errors); ?>
- <form action="services_wol_edit.php" method="post" name="iform" id="iform">
- <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="wol edit">
- <tr>
- <td colspan="2" valign="top" class="listtopic"><?=gettext("Edit WOL entry");?></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Interface");?></td>
- <td width="78%" class="vtable">
-<select name="interface" class="formfld">
- <?php
- $interfaces = get_configured_interface_with_descr();
- foreach ($interfaces as $iface => $ifacename): ?>
- <option value="<?=$iface;?>" <?php if (!link_interface_to_bridge($iface) && $iface == $pconfig['interface']) echo "selected=\"selected\""; ?>>
- <?=htmlspecialchars($ifacename);?>
- </option>
- <?php endforeach; ?>
- </select> <br />
- <span class="vexpl"><?=gettext("Choose which interface this host is connected to.");?></span></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("MAC address");?></td>
- <td width="78%" class="vtable">
- <input name="mac" type="text" class="formfld unknown" id="mac" size="20" value="<?=htmlspecialchars($pconfig['mac']);?>" />
- <br />
- <span class="vexpl"><?=gettext("Enter a MAC address in the following format: ".
- "xx:xx:xx:xx:xx:xx");?></span></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
- <td width="78%" class="vtable">
- <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" />
- <br /> <span class="vexpl"><?=gettext("You may enter a description here".
- " for your reference (not parsed).");?></span></td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
- <input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
- <?php if (isset($id) && $a_wol[$id]): ?>
- <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
- <?php endif; ?>
- </td>
- </tr>
- </table>
+<form action="services_wol_edit.php" method="post" name="iform" id="iform">
+ <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="wol edit">
+ <tr>
+ <td colspan="2" valign="top" class="listtopic"><?=gettext("Edit WOL entry");?></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Interface");?></td>
+ <td width="78%" class="vtable">
+ <select name="interface" class="formfld">
+ <?php
+ $interfaces = get_configured_interface_with_descr();
+ foreach ($interfaces as $iface => $ifacename): ?>
+ <option value="<?=$iface;?>" <?php if (!link_interface_to_bridge($iface) && $iface == $pconfig['interface']) echo "selected=\"selected\""; ?>>
+ <?=htmlspecialchars($ifacename);?>
+ </option>
+ <?php endforeach; ?>
+ </select>
+ <br />
+ <span class="vexpl"><?=gettext("Choose which interface this host is connected to.");?></span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("MAC address");?></td>
+ <td width="78%" class="vtable">
+ <input name="mac" type="text" class="formfld unknown" id="mac" size="20" value="<?=htmlspecialchars($pconfig['mac']);?>" />
+ <br />
+ <span class="vexpl"><?=gettext("Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx");?></span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
+ <td width="78%" class="vtable">
+ <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>" />
+ <br /> <span class="vexpl"><?=gettext("You may enter a description here for your reference (not parsed).");?></span>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top">&nbsp;</td>
+ <td width="78%">
+ <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
+ <input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <?php if (isset($id) && $a_wol[$id]): ?>
+ <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
+ <?php endif; ?>
+ </td>
+ </tr>
+ </table>
</form>
<?php include("fend.inc"); ?>
</body>
OpenPOWER on IntegriCloud