summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_dhcpv6_relay.php
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local/www/services_dhcpv6_relay.php')
-rw-r--r--usr/local/www/services_dhcpv6_relay.php144
1 files changed, 74 insertions, 70 deletions
diff --git a/usr/local/www/services_dhcpv6_relay.php b/usr/local/www/services_dhcpv6_relay.php
index 6b6ebe1..c6e5daf 100644
--- a/usr/local/www/services_dhcpv6_relay.php
+++ b/usr/local/www/services_dhcpv6_relay.php
@@ -43,10 +43,11 @@
require("guiconfig.inc");
$pconfig['enable'] = isset($config['dhcrelay6']['enable']);
-if (empty($config['dhcrelay6']['interface']))
+if (empty($config['dhcrelay6']['interface'])) {
$pconfig['interface'] = array();
-else
+} else {
$pconfig['interface'] = explode(",", $config['dhcrelay6']['interface']);
+}
$pconfig['server'] = $config['dhcrelay6']['server'];
$pconfig['agentoption'] = isset($config['dhcrelay6']['agentoption']);
@@ -58,7 +59,7 @@ $iflist = get_configured_interface_with_descr();
*/
$dhcpd_enabled = false;
if (is_array($config['dhcpdv6'])) {
- foreach($config['dhcpdv6'] as $dhcp) {
+ foreach ($config['dhcpdv6'] as $dhcp) {
if (isset($dhcp['enable']) && isset($config['interfaces'][$dhcpif]['enable'])) {
$dhcpd_enabled = true;
break;
@@ -81,8 +82,9 @@ if ($_POST) {
if ($_POST['server']) {
$checksrv = explode(",", $_POST['server']);
foreach ($checksrv as $srv) {
- if (!is_ipaddrv6($srv))
- $input_errors[] = gettext("A valid Destination Server IPv6 address must be specified.");
+ if (!is_ipaddrv6($srv)) {
+ $input_errors[] = gettext("A valid Destination Server IPv6 address must be specified.");
+ }
}
}
}
@@ -98,12 +100,11 @@ if ($_POST) {
$retval = 0;
$retval = services_dhcrelay6_configure();
$savemsg = get_std_save_message($retval);
-
}
}
$closehead = false;
-$pgtitle = array(gettext("Services"),gettext("DHCPv6 Relay"));
+$pgtitle = array(gettext("Services"), gettext("DHCPv6 Relay"));
$shortcut_section = "dhcp6";
include("head.inc");
@@ -133,73 +134,76 @@ function enable_change(enable_over) {
<?php if ($savemsg) print_info_box($savemsg); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="dhcpv6 relay">
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
- <tr>
-<?php
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
+ <tr>
+<?php
if ($dhcpd_enabled) {
echo "<td>DHCPv6 Server is currently enabled. Cannot enable the DHCPv6 Relay service while the DHCPv6 Server is enabled on any interface.";
- echo "</td></tr></table></div></td></tr></table></form>";
- include("fend.inc");
- echo "</body></html>";
- exit;
- }
+ echo "</td></tr></table></div></td></tr></table></form>";
+ include("fend.inc");
+ echo "</body></html>";
+ exit;
+ }
?>
- <td colspan="2" valign="top" class="listtopic"><?=gettext("DHCPv6 Relay configuration"); ?></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Enable</td>
- <td width="78%" class="vtable">
- <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> onclick="enable_change(false)" />
- <strong><?php printf(gettext("Enable DHCPv6 relay on interface"));?></strong>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq">Interface(s)</td>
- <td width="78%" class="vtable">
- <select id="interface" name="interface[]" multiple="multiple" class="formselect" size="3">
- <?php
- foreach ($iflist as $ifent => $ifdesc) {
- if (!is_ipaddrv6(get_interface_ipv6($ifent)))
- continue;
- echo "<option value=\"{$ifent}\"";
- if (in_array($ifent, $pconfig['interface']))
- echo " selected=\"selected\"";
- echo ">{$ifdesc}</option>\n";
- }
- ?>
- </select>
- <br /><?=gettext("Interfaces without an IPv6 address will not be shown."); ?>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vtable">&nbsp;</td>
- <td width="78%" class="vtable">
-<input name="agentoption" type="checkbox" value="yes" <?php if ($pconfig['agentoption']) echo "checked=\"checked\""; ?> />
- <strong><?=gettext("Append circuit ID and agent ID to requests"); ?></strong><br />
- <?php printf(gettext("If this is checked, the DHCPv6 relay will append the circuit ID (%s interface number) and the agent ID to the DHCPv6 request."), $g['product_name']); ?></td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncell"><?=gettext("Destination server");?></td>
- <td width="78%" class="vtable">
- <input name="server" type="text" class="formfld unknown" id="server" size="20" value="<?=htmlspecialchars($pconfig['server']);?>" />
- <br />
- <?=gettext("This is the IPv6 address of the server to which DHCPv6 requests are relayed. You can enter multiple server IPv6 addresses, separated by commas. ");?>
- </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>
- </div>
- </td>
- </tr>
+ <td colspan="2" valign="top" class="listtopic"><?=gettext("DHCPv6 Relay configuration"); ?></td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Enable</td>
+ <td width="78%" class="vtable">
+ <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> onclick="enable_change(false)" />
+ <strong><?php printf(gettext("Enable DHCPv6 relay on interface"));?></strong>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq">Interface(s)</td>
+ <td width="78%" class="vtable">
+ <select id="interface" name="interface[]" multiple="multiple" class="formselect" size="3">
+ <?php
+ foreach ($iflist as $ifent => $ifdesc) {
+ if (!is_ipaddrv6(get_interface_ipv6($ifent))) {
+ continue;
+ }
+ echo "<option value=\"{$ifent}\"";
+ if (in_array($ifent, $pconfig['interface'])) {
+ echo " selected=\"selected\"";
+ }
+ echo ">{$ifdesc}</option>\n";
+ }
+ ?>
+ </select>
+ <br /><?=gettext("Interfaces without an IPv6 address will not be shown."); ?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vtable">&nbsp;</td>
+ <td width="78%" class="vtable">
+ <input name="agentoption" type="checkbox" value="yes" <?php if ($pconfig['agentoption']) echo "checked=\"checked\""; ?> />
+ <strong><?=gettext("Append circuit ID and agent ID to requests"); ?></strong><br />
+ <?php printf(gettext("If this is checked, the DHCPv6 relay will append the circuit ID (%s interface number) and the agent ID to the DHCPv6 request."), $g['product_name']); ?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Destination server");?></td>
+ <td width="78%" class="vtable">
+ <input name="server" type="text" class="formfld unknown" id="server" size="20" value="<?=htmlspecialchars($pconfig['server']);?>" />
+ <br />
+ <?=gettext("This is the IPv6 address of the server to which DHCPv6 requests are relayed. You can enter multiple server IPv6 addresses, separated by commas. ");?>
+ </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>
+ </div>
+ </td>
+ </tr>
</table>
</form>
<script type="text/javascript">
OpenPOWER on IntegriCloud