commit 9c12c13069588d2d4df524db6e70819654f7f400
Author: Phil Davis <phil.davis@inf.org>
Date:   Sun May 24 12:38:27 2015 +0545

    Code style services dyndns

diff --git a/usr/local/www/services_dyndns.php b/usr/local/www/services_dyndns.php
index 6d2f678cd3..5051f0086b 100644
--- a/usr/local/www/services_dyndns.php
+++ b/usr/local/www/services_dyndns.php
@@ -42,8 +42,9 @@
 
 require("guiconfig.inc");
 
-if (!is_array($config['dyndnses']['dyndns']))
+if (!is_array($config['dyndnses']['dyndns'])) {
 	$config['dyndnses']['dyndns'] = array();
+}
 
 $a_dyndns = &$config['dyndnses']['dyndns'];
 
@@ -70,135 +71,157 @@ include("head.inc");
 <form action="services_dyndns.php" method="post" name="iform" id="iform">
 <?php if ($input_errors) print_input_errors($input_errors); ?>
 <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="dynamic dns">
-  <tr>
-	<td>
+	<tr>
+		<td>
 <?php
 	$tab_array = array();
 	$tab_array[] = array(gettext("DynDns"), true, "services_dyndns.php");
 	$tab_array[] = array(gettext("RFC 2136"), false, "services_rfc2136.php");
 	display_top_tabs($tab_array);
 ?>
-	</td>
-  </tr>
-  <tr>
-	<td>
-	  <div id="mainarea">
-	  <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area">
-		<tr>
-		  <td width="5%"  class="listhdrr"><?=gettext("Interface");?></td>
-		  <td width="15%" class="listhdrr"><?=gettext("Service");?></td>
-		  <td width="20%" class="listhdrr"><?=gettext("Hostname");?></td>
-		  <td width="20%" class="listhdrr"><?=gettext("Cached IP");?></td>
-		  <td width="50%" class="listhdr"><?=gettext("Description");?></td>
-		  <td width="10%" class="list"></td>
-		</tr>
-		<?php $i = 0; foreach ($a_dyndns as $dyndns): ?>
-		<tr ondblclick="document.location='services_dyndns_edit.php?id=<?=$i;?>'">
-		  <td class="listlr">
-		  <?php	$iflist = get_configured_interface_with_descr();
-			foreach ($iflist as $if => $ifdesc) {
-				if ($dyndns['interface'] == $if) {
-					if (!isset($dyndns['enable']))
-						echo "<span class=\"gray\">{$ifdesc}</span>";
-					else
-						echo "{$ifdesc}";
-					break;
+		</td>
+	</tr>
+	<tr>
+		<td>
+			<div id="mainarea">
+			<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area">
+				<tr>
+					<td width="5%"  class="listhdrr"><?=gettext("Interface");?></td>
+					<td width="15%" class="listhdrr"><?=gettext("Service");?></td>
+					<td width="20%" class="listhdrr"><?=gettext("Hostname");?></td>
+					<td width="20%" class="listhdrr"><?=gettext("Cached IP");?></td>
+					<td width="50%" class="listhdr"><?=gettext("Description");?></td>
+					<td width="10%" class="list"></td>
+				</tr>
+<?php
+	$i = 0;
+	foreach ($a_dyndns as $dyndns):
+?>
+				<tr ondblclick="document.location='services_dyndns_edit.php?id=<?=$i;?>'">
+					<td class="listlr">
+<?php
+		$iflist = get_configured_interface_with_descr();
+		foreach ($iflist as $if => $ifdesc) {
+			if ($dyndns['interface'] == $if) {
+				if (!isset($dyndns['enable'])) {
+					echo "<span class=\"gray\">{$ifdesc}</span>";
+				} else {
+					echo "{$ifdesc}";
 				}
+				break;
 			}
-			$groupslist = return_gateway_groups_array();
-			foreach ($groupslist as $if => $group) {
-				if ($dyndns['interface'] == $if) {
-					if (!isset($dyndns['enable']))
-						echo "<span class=\"gray\">{$if}</span>";
-					else
-						echo "{$if}";
-					break;
+		}
+		$groupslist = return_gateway_groups_array();
+		foreach ($groupslist as $if => $group) {
+			if ($dyndns['interface'] == $if) {
+				if (!isset($dyndns['enable'])) {
+					echo "<span class=\"gray\">{$if}</span>";
+				} else {
+					echo "{$if}";
 				}
+				break;
 			}
-		  ?>
-		  </td>
-		  <td class="listr">
-		  <?php
-			$types = explode(",", DYNDNS_PROVIDER_DESCRIPTIONS);
-			$vals = explode(" ", DYNDNS_PROVIDER_VALUES);
-			for ($j = 0; $j < count($vals); $j++)
-				if ($vals[$j] == $dyndns['type']) {
-					if (!isset($dyndns['enable']))
-						echo "<span class=\"gray\">" . htmlspecialchars($types[$j]) . "</span>";
-					else
-						echo htmlspecialchars($types[$j]);
-					break;
+		}
+?>
+					</td>
+					<td class="listr">
+<?php
+		$types = explode(",", DYNDNS_PROVIDER_DESCRIPTIONS);
+		$vals = explode(" ", DYNDNS_PROVIDER_VALUES);
+		for ($j = 0; $j < count($vals); $j++) {
+			if ($vals[$j] == $dyndns['type']) {
+				if (!isset($dyndns['enable'])) {
+					echo "<span class=\"gray\">" . htmlspecialchars($types[$j]) . "</span>";
+				} else {
+					echo htmlspecialchars($types[$j]);
 				}
-		  ?>
-		  </td>
-		  <td class="listr">
-		  <?php
-			if (!isset($dyndns['enable']))
-				echo "<span class=\"gray\">" . htmlspecialchars($dyndns['host']) . "</span>";
-			else
-				echo htmlspecialchars($dyndns['host']);
-		  ?>
-		  </td>
-		  <td class="listr">
-		  <?php
-			$filename = "{$g['conf_path']}/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($dyndns['host']) . "{$dyndns['id']}.cache";
-			$filename_v6 = "{$g['conf_path']}/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($dyndns['host']) . "{$dyndns['id']}_v6.cache";
-			if (file_exists($filename)) {
-				$ipaddr = dyndnsCheckIP($dyndns['interface']);
-				$cached_ip_s = explode(":", file_get_contents($filename));
-				$cached_ip = $cached_ip_s[0];
-				if ($ipaddr <> $cached_ip)
-					echo "<font color='red'>";
-				else
-					echo "<font color='green'>";
-				echo htmlspecialchars($cached_ip);
-				echo "</font>";
-			} else if (file_exists($filename_v6)) {
-				$ipv6addr = get_interface_ipv6($dyndns['interface']);
-				$cached_ipv6_s = explode("|", file_get_contents($filename_v6));
-				$cached_ipv6 = $cached_ipv6_s[0];
-				if ($ipv6addr <> $cached_ipv6)
-					echo "<font color='red'>";
-				else
-					echo "<font color='green'>";
-				echo htmlspecialchars($cached_ipv6);
-				echo "</font>";
+				break;
+			}
+		}
+?>
+					</td>
+					<td class="listr">
+<?php
+		if (!isset($dyndns['enable'])) {
+			echo "<span class=\"gray\">" . htmlspecialchars($dyndns['host']) . "</span>";
+		} else {
+			echo htmlspecialchars($dyndns['host']);
+		}
+?>
+					</td>
+					<td class="listr">
+<?php
+		$filename = "{$g['conf_path']}/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($dyndns['host']) . "{$dyndns['id']}.cache";
+		$filename_v6 = "{$g['conf_path']}/dyndns_{$dyndns['interface']}{$dyndns['type']}" . escapeshellarg($dyndns['host']) . "{$dyndns['id']}_v6.cache";
+		if (file_exists($filename)) {
+			$ipaddr = dyndnsCheckIP($dyndns['interface']);
+			$cached_ip_s = explode(":", file_get_contents($filename));
+			$cached_ip = $cached_ip_s[0];
+			if ($ipaddr <> $cached_ip) {
+				echo "<font color='red'>";
 			} else {
-				echo "N/A";
+				echo "<font color='green'>";
 			}
-		  ?>
-		  </td>
-		  <td class="listbg">
-		  <?php
-			if (!isset($dyndns['enable']))
-				echo "<span class=\"gray\">".htmlspecialchars($dyndns['descr'])."</span>";
-			else
-				echo htmlspecialchars($dyndns['descr']);
-		  ?>
-		  </td>
-		  <td valign="middle" class="list nowrap">
-			<a href="services_dyndns_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" /></a>
-			&nbsp;<a href="services_dyndns.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>
-		<?php $i++; endforeach; ?>
-		<tr>
-		  <td class="list" colspan="5"></td>
-		  <td class="list"><a href="services_dyndns_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
-		</tr>
-		<tr>
-		  <td colspan="5" class="list"><p class="vexpl"><span class="red"><strong>
-			<?=gettext("Note:");?><br />
-			</strong></span>
-			<?=gettext("IP addresses appearing in green are up to date with Dynamic DNS provider.");?><br />
-			<?=gettext("You can force an update for an IP address on the edit page for that service.");?></p>
-		  </td>
-		  <td class="list">&nbsp;</td>
-		</tr>
-	  </table>
-	  </div>
-	</td>
-  </tr>
+			echo htmlspecialchars($cached_ip);
+			echo "</font>";
+		} else if (file_exists($filename_v6)) {
+			$ipv6addr = get_interface_ipv6($dyndns['interface']);
+			$cached_ipv6_s = explode("|", file_get_contents($filename_v6));
+			$cached_ipv6 = $cached_ipv6_s[0];
+			if ($ipv6addr <> $cached_ipv6) {
+				echo "<font color='red'>";
+			} else {
+				echo "<font color='green'>";
+			}
+			echo htmlspecialchars($cached_ipv6);
+			echo "</font>";
+		} else {
+			echo "N/A";
+		}
+?>
+					</td>
+					<td class="listbg">
+<?php
+		if (!isset($dyndns['enable'])) {
+			echo "<span class=\"gray\">".htmlspecialchars($dyndns['descr'])."</span>";
+		} else {
+			echo htmlspecialchars($dyndns['descr']);
+		}
+?>
+					</td>
+					<td valign="middle" class="list nowrap">
+						<a href="services_dyndns_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" /></a>
+						&nbsp;<a href="services_dyndns.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>
+<?php
+		$i++;
+	endforeach;
+?>
+				<tr>
+					<td class="list" colspan="5"></td>
+					<td class="list">
+						<a href="services_dyndns_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a>
+					</td>
+				</tr>
+				<tr>
+					<td colspan="5" class="list">
+						<p class="vexpl">
+							<span class="red">
+								<strong>
+									<?=gettext("Note:");?><br />
+								</strong>
+							</span>
+							<?=gettext("IP addresses appearing in green are up to date with Dynamic DNS provider.");?><br />
+							<?=gettext("You can force an update for an IP address on the edit page for that service.");?>
+						</p>
+					</td>
+					<td class="list">&nbsp;</td>
+				</tr>
+			</table>
+			</div>
+		</td>
+	</tr>
 </table>
 </form>
 <?php include("fend.inc"); ?>
diff --git a/usr/local/www/services_dyndns_edit.php b/usr/local/www/services_dyndns_edit.php
index aa2bf43201..0387dcfa24 100644
--- a/usr/local/www/services_dyndns_edit.php
+++ b/usr/local/www/services_dyndns_edit.php
@@ -42,13 +42,15 @@
 
 /* returns true if $uname is a valid DynDNS username */
 function is_dyndns_username($uname) {
-        if (!is_string($uname))
-                return false;
-        
-        if (preg_match("/[^a-z0-9\-\+.@_:]/i", $uname))
-                return false;
-        else
-                return true;
+	if (!is_string($uname)) {
+		return false;
+	}
+
+	if (preg_match("/[^a-z0-9\-\+.@_:]/i", $uname)) {
+		return false;
+	} else {
+		return true;
+	}
 }
 
 require("guiconfig.inc");
@@ -59,10 +61,12 @@ if (!is_array($config['dyndnses']['dyndns'])) {
 
 $a_dyndns = &$config['dyndnses']['dyndns'];
 
-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) && isset($a_dyndns[$id])) {
 	$pconfig['username'] = $a_dyndns[$id]['username'];
@@ -88,9 +92,10 @@ if ($_POST) {
 
 	unset($input_errors);
 	$pconfig = $_POST;
-	
-	if(($pconfig['type'] == "freedns" || $pconfig['type'] == "namecheap") && $_POST['username'] == "")
-		$_POST['username'] = "none"; 
+
+	if (($pconfig['type'] == "freedns" || $pconfig['type'] == "namecheap") && $_POST['username'] == "") {
+		$_POST['username'] = "none";
+	}
 
 	/* input validation */
 	$reqdfields = array();
@@ -102,32 +107,37 @@ if ($_POST) {
 		$reqdfieldsn[] = gettext("Hostname");
 		$reqdfields[] = "passwordfld";
 		$reqdfieldsn[] = gettext("Password");
- 		$reqdfields[] = "username";
- 		$reqdfieldsn[] = gettext("Username");
-	}else{
+		$reqdfields[] = "username";
+		$reqdfieldsn[] = gettext("Username");
+	} else {
 		$reqdfields[] = "updateurl";
 		$reqdfieldsn[] = gettext("Update URL");
- 	}
+	}
 
 	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
 
 	if (isset($_POST['host']) && in_array("host", $reqdfields)) {
 		/* Namecheap can have a @. in hostname */
-		if ($pconfig['type'] == "namecheap" && substr($_POST['host'], 0, 2) == '@.')
+		if ($pconfig['type'] == "namecheap" && substr($_POST['host'], 0, 2) == '@.') {
 			$host_to_check = substr($_POST['host'], 2);
-		else
+		} else {
 			$host_to_check = $_POST['host'];
+		}
 
-		if ($pconfig['type'] != "custom" && $pconfig['type'] != "custom-v6")
-			if (!is_domain($host_to_check))
+		if ($pconfig['type'] != "custom" && $pconfig['type'] != "custom-v6") {
+			if (!is_domain($host_to_check)) {
 				$input_errors[] = gettext("The hostname contains invalid characters.");
+			}
+		}
 
 		unset($host_to_check);
 	}
-	if (($_POST['mx'] && !is_domain($_POST['mx']))) 
+	if (($_POST['mx'] && !is_domain($_POST['mx']))) {
 		$input_errors[] = gettext("The MX contains invalid characters.");
-	if ((in_array("username", $reqdfields) && $_POST['username'] && !is_dyndns_username($_POST['username'])) || ((in_array("username", $reqdfields)) && ($_POST['username'] == ""))) 
- 		$input_errors[] = gettext("The username contains invalid characters.");
+	}
+	if ((in_array("username", $reqdfields) && $_POST['username'] && !is_dyndns_username($_POST['username'])) || ((in_array("username", $reqdfields)) && ($_POST['username'] == ""))) {
+		$input_errors[] = gettext("The username contains invalid characters.");
+	}
 
 	if (!$input_errors) {
 		$dyndns = array();
@@ -141,10 +151,11 @@ if ($_POST) {
 		$dyndns['curl_ipresolve_v4'] = $_POST['curl_ipresolve_v4'] ? true : false;
 		$dyndns['curl_ssl_verifypeer'] = $_POST['curl_ssl_verifypeer'] ? true : false;
 		/* In this place enable means disabled */
-		if ($_POST['enable'])
+		if ($_POST['enable']) {
 			unset($dyndns['enable']);
-		else
+		} else {
 			$dyndns['enable'] = true;
+		}
 		$dyndns['interface'] = $_POST['interface'];
 		$dyndns['zoneid'] = $_POST['zoneid'];
 		$dyndns['ttl'] = $_POST['ttl'];
@@ -154,20 +165,21 @@ if ($_POST) {
 		($dyndns['type'] == "custom" || $dyndns['type'] == "custom-v6") ? $dyndns['requestif'] = $_POST['requestif'] : $dyndns['requestif'] = $_POST['interface'];
 		$dyndns['descr'] = $_POST['descr'];
 		$dyndns['force'] = isset($_POST['force']);
-		
-		if($dyndns['username'] == "none")
+
+		if ($dyndns['username'] == "none") {
 			$dyndns['username'] = "";
+		}
 
-		if (isset($id) && $a_dyndns[$id])
+		if (isset($id) && $a_dyndns[$id]) {
 			$a_dyndns[$id] = $dyndns;
-		else {
- 			$a_dyndns[] = $dyndns;
+		} else {
+			$a_dyndns[] = $dyndns;
 			$id = count($a_dyndns) - 1;
 		}
 
 		$dyndns['id'] = $id;
 		//Probably overkill, but its better to be safe
-		for($i = 0; $i < count($a_dyndns); $i++) {
+		for ($i = 0; $i < count($a_dyndns); $i++) {
 			$a_dyndns[$i]['id'] = $i;
 		}
 
@@ -180,7 +192,7 @@ if ($_POST) {
 	}
 }
 
-$pgtitle = array(gettext("Services"),gettext("Dynamic DNS client"));
+$pgtitle = array(gettext("Services"), gettext("Dynamic DNS client"));
 include("head.inc");
 
 ?>
@@ -191,8 +203,8 @@ include("head.inc");
 <?php if ($savemsg) print_info_box($savemsg); ?>
 <script type="text/javascript">
 //<![CDATA[
-function _onTypeChange(type){ 
-	switch(type) {
+function _onTypeChange(type) {
+	switch (type) {
 		case "custom":
 		case "custom-v6":
 			document.getElementById("_resulttr").style.display = '';
@@ -232,220 +244,233 @@ function _onTypeChange(type){
 //]]>
 </script>
 <form action="services_dyndns_edit.php" method="post" name="iform" id="iform">
-              <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="dynamic dns edit">
-                <tr>
-                  <td colspan="2" valign="top" class="optsect_t">
-				  <table border="0" cellspacing="0" cellpadding="0" width="100%" summary="title">
-				  <tr><td class="optsect_s"><strong><?=gettext("Dynamic DNS client");?></strong></td></tr>
-				  </table>
-				  </td>
-                </tr>
-                <tr>
-                  <td width="22%" valign="top" class="vncell"><?=gettext("Disable");?></td>
-				  <td width="78%" class="vtable">
-				    <input name="enable" type="checkbox" id="enable" value="<?=gettext("yes");?>" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> />
-				  </td>
-                </tr>
-                <tr>
-                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Service type");?></td>
-                  <td width="78%" class="vtable">
-			<select name="type" class="formselect" id="type" onchange="_onTypeChange(this.options[this.selectedIndex].value);">
-                      <?php
+	<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="dynamic dns edit">
+		<tr>
+			<td colspan="2" valign="top" class="optsect_t">
+				<table border="0" cellspacing="0" cellpadding="0" width="100%" summary="title">
+					<tr>
+						<td class="optsect_s"><strong><?=gettext("Dynamic DNS client");?></strong></td>
+					</tr>
+				</table>
+			</td>
+		</tr>
+		<tr>
+			<td width="22%" valign="top" class="vncell"><?=gettext("Disable");?></td>
+			<td width="78%" class="vtable">
+				<input name="enable" type="checkbox" id="enable" value="<?=gettext("yes");?>" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> />
+			</td>
+		</tr>
+		<tr>
+			<td width="22%" valign="top" class="vncellreq"><?=gettext("Service type");?></td>
+			<td width="78%" class="vtable">
+				<select name="type" class="formselect" id="type" onchange="_onTypeChange(this.options[this.selectedIndex].value);">
+					<?php
 						$types = explode(",", DYNDNS_PROVIDER_DESCRIPTIONS);
 						$vals = explode(" ", DYNDNS_PROVIDER_VALUES);
-						$j = 0; for ($j = 0; $j < count($vals); $j++): ?>
-                      <option value="<?=$vals[$j];?>" <?php if ($vals[$j] == $pconfig['type']) echo "selected=\"selected\"";?>>
-                      <?=htmlspecialchars($types[$j]);?>
-                      </option>
-                      <?php endfor; ?>
-                    </select></td>
-				</tr>
-				<tr>
-				   <td width="22%" valign="top" class="vncellreq"><?=gettext("Interface to monitor");?></td>  
-				   <td width="78%" class="vtable">
-				   <select name="interface" class="formselect" id="interface">
+						$j = 0;
+						for ($j = 0; $j < count($vals); $j++):
+					?>
+					<option value="<?=$vals[$j];?>" <?php if ($vals[$j] == $pconfig['type']) echo "selected=\"selected\"";?>>
+						<?=htmlspecialchars($types[$j]);?>
+					</option>
+					<?php
+						endfor;
+					?>
+				</select>
+			</td>
+		</tr>
+		<tr>
+			<td width="22%" valign="top" class="vncellreq"><?=gettext("Interface to monitor");?></td>
+			<td width="78%" class="vtable">
+				<select name="interface" class="formselect" id="interface">
 				<?php
-					$iflist = get_configured_interface_with_descr();					
-				   	foreach ($iflist as $if => $ifdesc) {
+					$iflist = get_configured_interface_with_descr();
+					foreach ($iflist as $if => $ifdesc) {
 						echo "<option value=\"{$if}\"";
-						if ($pconfig['interface'] == $if)
+						if ($pconfig['interface'] == $if) {
 							echo "selected=\"selected\"";
+						}
 						echo ">{$ifdesc}</option>\n";
 					}
 					unset($iflist);
 					$grouplist = return_gateway_groups_array();
-				   	foreach ($grouplist as $name => $group) {
+					foreach ($grouplist as $name => $group) {
 						echo "<option value=\"{$name}\"";
-						if ($pconfig['interface'] == $name)
+						if ($pconfig['interface'] == $name) {
 							echo "selected=\"selected\"";
+						}
 						echo ">GW Group {$name}</option>\n";
 					}
 					unset($grouplist);
 				?>
-					</select>
-					</td>
-				</tr>	
-				<tr id="_requestiftr">
-					<td width="22%" valign="top" class="vncellreq"><?=gettext("Interface to send update from");?></td>  
-					<td width="78%" class="vtable">
-					<select name="requestif" class="formselect" id="requestif">
+				</select>
+			</td>
+		</tr>
+		<tr id="_requestiftr">
+			<td width="22%" valign="top" class="vncellreq"><?=gettext("Interface to send update from");?></td>
+			<td width="78%" class="vtable">
+				<select name="requestif" class="formselect" id="requestif">
 				<?php
-					$iflist = get_configured_interface_with_descr();					
+					$iflist = get_configured_interface_with_descr();
 					foreach ($iflist as $if => $ifdesc) {
 						echo "<option value=\"{$if}\"";
-						if ($pconfig['requestif'] == $if)
+						if ($pconfig['requestif'] == $if) {
 							echo "selected=\"selected\"";
+						}
 						echo ">{$ifdesc}</option>\n";
 					}
 					unset($iflist);
 					$grouplist = return_gateway_groups_array();
 					foreach ($grouplist as $name => $group) {
 						echo "<option value=\"{$name}\"";
-						if ($pconfig['requestif'] == $name)
+						if ($pconfig['requestif'] == $name) {
 							echo "selected=\"selected\"";
+						}
 						echo ">GW Group {$name}</option>\n";
 					}
 					unset($grouplist);
 				?>
-					</select>
-					<br /><?= gettext("Note: This is almost always the same as the Interface to Monitor.");?>
-					</td>
-				</tr>
-                <tr id="_hostnametr">
-                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Hostname");?></td>
-                  <td width="78%" class="vtable">
-                    <input name="host" type="text" class="formfld unknown" id="host" size="30" value="<?=htmlspecialchars($pconfig['host']);?>" />
-                    <br />
-				    <span class="vexpl">
-				    <span class="red"><strong><?=gettext("Note:");?><br /></strong>
-				    </span>
+				</select>
+				<br /><?=gettext("Note: This is almost always the same as the Interface to Monitor.");?>
+			</td>
+		</tr>
+		<tr id="_hostnametr">
+			<td width="22%" valign="top" class="vncellreq"><?=gettext("Hostname");?></td>
+			<td width="78%" class="vtable">
+				<input name="host" type="text" class="formfld unknown" id="host" size="30" value="<?=htmlspecialchars($pconfig['host']);?>" />
+				<br />
+				<span class="vexpl">
+					<span class="red">
+						<strong><?=gettext("Note:");?><br /></strong>
+					</span>
 					<?=gettext("Enter the complete host/domain name.  example:  myhost.dyndns.org");?><br />
 					<?=gettext("he.net tunnelbroker: Enter your tunnel ID");?><br />
 					<?=gettext("GleSYS: Enter your record ID");?><br />
-					<?= gettext("DNSimple: Enter only the domain name.");?>
-				    </span>
-		          </td>
-				</tr>
-                <tr id="_mxtr">
-                  <td width="22%" valign="top" class="vncell"><?=gettext("MX"); ?></td>
-                  <td width="78%" class="vtable">
-                    <input name="mx" type="text" class="formfld unknown" id="mx" size="30" value="<?=htmlspecialchars($pconfig['mx']);?>" />
-                    <br />
-					<?=gettext("Note: With DynDNS service you can only use a hostname, not an IP address.");?>
-					<br />
-                    <?=gettext("Set this option only if you need a special MX record. Not".
-                   " all services support this.");?></td>
-				</tr>
-                <tr id="_wildcardtr">
-                  <td width="22%" valign="top" class="vncell"><?=gettext("Wildcards"); ?></td>
-                  <td width="78%" class="vtable">
-                    <input name="wildcard" type="checkbox" id="wildcard" value="yes" <?php if ($pconfig['wildcard']) echo "checked=\"checked\""; ?> />
-                    <?=gettext("Enable ");?><?=gettext("Wildcard"); ?></td>
-				</tr>
-                <tr id="_verboselogtr">
-                  <td width="22%" valign="top" class="vncell"><?=gettext("Verbose logging"); ?></td>
-                  <td width="78%" class="vtable">
-                    <input name="verboselog" type="checkbox" id="verboselog" value="yes" <?php if ($pconfig['verboselog']) echo "checked=\"checked\""; ?> />
-                    <?=gettext("Enable ");?><?=gettext("verbose logging"); ?></td>
-				</tr>
-				<tr id="_curloptions">
-                  <td width="22%" valign="top" class="vncell"><?=gettext("CURL options"); ?></td>
-                  <td width="78%" class="vtable">
-                    <input name="curl_ipresolve_v4" type="checkbox" id="curl_ipresolve_v4" value="yes" <?php if ($pconfig['curl_ipresolve_v4']) echo "checked=\"checked\""; ?> />
-                    <?=gettext("Force IPv4 resolving"); ?><br />
-					<input name="curl_ssl_verifypeer" type="checkbox" id="curl_ssl_verifypeer" value="yes" <?php if ($pconfig['curl_ssl_verifypeer']) echo "checked=\"checked\""; ?> />
-                    <?=gettext("Verify SSL peer"); ?>
-				  </td>
-				</tr>
-                <tr id="_usernametr">
-                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Username");?></td>
-                  <td width="78%" class="vtable">
-                    <input name="username" type="text" class="formfld user" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>" />
-                    <br /><?= gettext("Username is required for all types except Namecheap, FreeDNS and Custom Entries.");?>
-                    <br /><?= gettext("Route 53: Enter your Access Key ID.");?>
-                    <br /><?= gettext("GleSYS: Enter your API user.");?>
-                    <br /><?= gettext("For Custom Entries, Username and Password represent HTTP Authentication username and passwords.");?>
-                  </td>
-                </tr>
-                <tr>
-                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Password");?></td>
-                  <td width="78%" class="vtable">
-                    <input name="passwordfld" type="password" class="formfld pwd" id="passwordfld" size="20" value="<?=htmlspecialchars($pconfig['password']);?>" />
-                    <br />
-                    <?=gettext("FreeDNS (freedns.afraid.org): Enter your \"Authentication Token\" provided by FreeDNS.");?>
-                    <br /><?= gettext("Route 53: Enter your Secret Access Key.");?>
-                    <br /><?= gettext("GleSYS: Enter your API key.");?>
-                    <br /><?= gettext("DNSimple: Enter your API token.");?>
-                  </td>
-                </tr>
-
-                <tr id="r53_zoneid" style="display:none">
-                  <td width="22%" valign="top" class="vncellreq"><?=gettext("Zone ID");?></td>
-                  <td width="78%" class="vtable">
-                    <input name="zoneid" type="text" class="formfld user" id="zoneid" size="20" value="<?=htmlspecialchars($pconfig['zoneid']);?>" />
-                    <br /><?= gettext("Enter Zone ID that you received when you created your domain in Route 53.");?>
-                    <br /><?= gettext("DNSimple: Enter the Record ID of record to update.");?>
-                  </td>
-                </tr>
-                <tr id="_urltr">
-                  <td width="22%" valign="top" class="vncell"><?=gettext("Update URL");?></td>
-                  <td width="78%" class="vtable">
-                    <input name="updateurl" type="text" class="formfld unknown" id="updateurl" size="60" value="<?=htmlspecialchars($pconfig['updateurl']);?>" />
-                    <br /><?= gettext("This is the only field required by for Custom Dynamic DNS, and is only used by Custom Entries.");?>
-			<br />
-			<?= gettext("If you need the new IP to be included in the request, put %IP% in its place.");?>
-                  </td>
-                </tr>
+					<?=gettext("DNSimple: Enter only the domain name.");?>
+				</span>
+			</td>
+		</tr>
+		<tr id="_mxtr">
+			<td width="22%" valign="top" class="vncell"><?=gettext("MX"); ?></td>
+			<td width="78%" class="vtable">
+				<input name="mx" type="text" class="formfld unknown" id="mx" size="30" value="<?=htmlspecialchars($pconfig['mx']);?>" />
+				<br />
+				<?=gettext("Note: With DynDNS service you can only use a hostname, not an IP address.");?>
+				<br />
+				<?=gettext("Set this option only if you need a special MX record. Not all services support this.");?>
+			</td>
+		</tr>
+		<tr id="_wildcardtr">
+			<td width="22%" valign="top" class="vncell"><?=gettext("Wildcards"); ?></td>
+			<td width="78%" class="vtable">
+				<input name="wildcard" type="checkbox" id="wildcard" value="yes" <?php if ($pconfig['wildcard']) echo "checked=\"checked\""; ?> />
+				<?=gettext("Enable ");?><?=gettext("Wildcard"); ?>
+			</td>
+		</tr>
+		<tr id="_verboselogtr">
+			<td width="22%" valign="top" class="vncell"><?=gettext("Verbose logging"); ?></td>
+			<td width="78%" class="vtable">
+				<input name="verboselog" type="checkbox" id="verboselog" value="yes" <?php if ($pconfig['verboselog']) echo "checked=\"checked\""; ?> />
+				<?=gettext("Enable ");?><?=gettext("verbose logging"); ?>
+			</td>
+		</tr>
+		<tr id="_curloptions">
+			<td width="22%" valign="top" class="vncell"><?=gettext("CURL options"); ?></td>
+			<td width="78%" class="vtable">
+				<input name="curl_ipresolve_v4" type="checkbox" id="curl_ipresolve_v4" value="yes" <?php if ($pconfig['curl_ipresolve_v4']) echo "checked=\"checked\""; ?> />
+				<?=gettext("Force IPv4 resolving"); ?><br />
+				<input name="curl_ssl_verifypeer" type="checkbox" id="curl_ssl_verifypeer" value="yes" <?php if ($pconfig['curl_ssl_verifypeer']) echo "checked=\"checked\""; ?> />
+				<?=gettext("Verify SSL peer"); ?>
+			</td>
+		</tr>
+			<tr id="_usernametr">
+			<td width="22%" valign="top" class="vncellreq"><?=gettext("Username");?></td>
+			<td width="78%" class="vtable">
+				<input name="username" type="text" class="formfld user" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>" />
+				<br /><?=gettext("Username is required for all types except Namecheap, FreeDNS and Custom Entries.");?>
+				<br /><?=gettext("Route 53: Enter your Access Key ID.");?>
+				<br /><?=gettext("GleSYS: Enter your API user.");?>
+				<br /><?=gettext("For Custom Entries, Username and Password represent HTTP Authentication username and passwords.");?>
+			</td>
+		</tr>
+		<tr>
+			<td width="22%" valign="top" class="vncellreq"><?=gettext("Password");?></td>
+			<td width="78%" class="vtable">
+				<input name="passwordfld" type="password" class="formfld pwd" id="passwordfld" size="20" value="<?=htmlspecialchars($pconfig['password']);?>" />
+				<br />
+				<?=gettext("FreeDNS (freedns.afraid.org): Enter your \"Authentication Token\" provided by FreeDNS.");?>
+				<br /><?=gettext("Route 53: Enter your Secret Access Key.");?>
+				<br /><?=gettext("GleSYS: Enter your API key.");?>
+				<br /><?=gettext("DNSimple: Enter your API token.");?>
+			</td>
+		</tr>
+		<tr id="r53_zoneid" style="display:none">
+			<td width="22%" valign="top" class="vncellreq"><?=gettext("Zone ID");?></td>
+			<td width="78%" class="vtable">
+				<input name="zoneid" type="text" class="formfld user" id="zoneid" size="20" value="<?=htmlspecialchars($pconfig['zoneid']);?>" />
+				<br /><?=gettext("Enter Zone ID that you received when you created your domain in Route 53.");?>
+				<br /><?=gettext("DNSimple: Enter the Record ID of record to update.");?>
+			</td>
+		</tr>
+		<tr id="_urltr">
+			<td width="22%" valign="top" class="vncell"><?=gettext("Update URL");?></td>
+			<td width="78%" class="vtable">
+				<input name="updateurl" type="text" class="formfld unknown" id="updateurl" size="60" value="<?=htmlspecialchars($pconfig['updateurl']);?>" />
+				<br /><?=gettext("This is the only field required by for Custom Dynamic DNS, and is only used by Custom Entries.");?>
+				<br /><?=gettext("If you need the new IP to be included in the request, put %IP% in its place.");?>
+			</td>
+		</tr>
 		<tr id="_resulttr">
-                  <td width="22%" valign="top" class="vncell"><?=gettext("Result Match");?></td>
-                  <td width="78%" class="vtable">
-                    <textarea name="resultmatch" class="formpre" id="resultmatch" cols="65" rows="7"><?=htmlspecialchars($pconfig['resultmatch']);?></textarea>
-                    <br /><?= gettext("This field is only used by Custom Dynamic DNS Entries.");?>
-			<br />
-			<?= gettext("This field should be identical to what your DDNS Provider will return if the update succeeds, leave it blank to disable checking of returned results.");?>
-			<br />
-			<?= gettext("If you need the new IP to be included in the request, put %IP% in its place.");?>
-			<br />
-			<?= gettext("If you need to include multiple possible values, separate them with a |.  If your provider includes a |, escape it with \\|");?>
-			<br />
-			<?= gettext("Tabs (\\t), newlines (\\n) and carriage returns (\\r) at the beginning or end of the returned results are removed before comparison.");?>
-                  </td>
-                </tr>
-
-                <tr id="r53_ttl" style="display:none">
-                  <td width="22%" valign="top" class="vncellreq"><?=gettext("TTL");?></td>
-                  <td width="78%" class="vtable">
-                    <input name="ttl" type="text" class="formfld user" id="ttl" size="20" value="<?=htmlspecialchars($pconfig['ttl']);?>" />
-                    <br /><?= gettext("Choose TTL for your dns record.");?>
-                  </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="60" value="<?=htmlspecialchars($pconfig['descr']);?>" />
-                  </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)" />
-					<a href="services_dyndns.php"><input name="cancel" type="button" class="formbtn" value="<?=gettext("Cancel");?>" /></a>
-					<?php if (isset($id) && $a_dyndns[$id]): ?>
-						<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
-						<input name="force" type="submit" class="formbtn" value="<?=gettext("Save & Force Update");?>" onclick="enable_change(true)" />
-					<?php endif; ?>
-                  </td>
-                </tr>
-                <tr>
-                  <td width="22%" valign="top">&nbsp;</td>
-                  <td width="78%"><span class="vexpl"><span class="red"><strong><?=gettext("Note:");?><br />
-                    </strong></span><?php printf(gettext("You must configure a DNS server in %sSystem:
-                    General setup%s or allow the DNS server list to be overridden
-                    by DHCP/PPP on WAN for dynamic DNS updates to work."),'<a href="system.php">','</a>');?></span></td>
-                </tr>
-              </table>
+			<td width="22%" valign="top" class="vncell"><?=gettext("Result Match");?></td>
+			<td width="78%" class="vtable">
+				<textarea name="resultmatch" class="formpre" id="resultmatch" cols="65" rows="7"><?=htmlspecialchars($pconfig['resultmatch']);?></textarea>
+				<br /><?=gettext("This field is only used by Custom Dynamic DNS Entries.");?>
+				<br /><?=gettext("This field should be identical to what your DDNS Provider will return if the update succeeds, leave it blank to disable checking of returned results.");?>
+				<br /><?=gettext("If you need the new IP to be included in the request, put %IP% in its place.");?>
+				<br /><?=gettext("If you need to include multiple possible values, separate them with a |.  If your provider includes a |, escape it with \\|");?>
+				<br /><?=gettext("Tabs (\\t), newlines (\\n) and carriage returns (\\r) at the beginning or end of the returned results are removed before comparison.");?>
+			</td>
+		</tr>
+		<tr id="r53_ttl" style="display:none">
+			<td width="22%" valign="top" class="vncellreq"><?=gettext("TTL");?></td>
+			<td width="78%" class="vtable">
+				<input name="ttl" type="text" class="formfld user" id="ttl" size="20" value="<?=htmlspecialchars($pconfig['ttl']);?>" />
+				<br /><?=gettext("Choose TTL for your dns record.");?>
+			</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="60" value="<?=htmlspecialchars($pconfig['descr']);?>" />
+			</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)" />
+				<a href="services_dyndns.php"><input name="cancel" type="button" class="formbtn" value="<?=gettext("Cancel");?>" /></a>
+				<?php if (isset($id) && $a_dyndns[$id]): ?>
+				<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
+				<input name="force" type="submit" class="formbtn" value="<?=gettext("Save & Force Update");?>" onclick="enable_change(true)" />
+				<?php endif; ?>
+			</td>
+		</tr>
+		<tr>
+			<td width="22%" valign="top">&nbsp;</td>
+			<td width="78%">
+				<span class="vexpl">
+					<span class="red">
+						<strong>
+							<?=gettext("Note:");?><br />
+						</strong>
+					</span>
+					<?php printf(gettext("You must configure a DNS server in %sSystem:
+						General setup%s or allow the DNS server list to be overridden
+						by DHCP/PPP on WAN for dynamic DNS updates to work."),'<a href="system.php">','</a>');?>
+				</span>
+			</td>
+		</tr>
+	</table>
 </form>
 <?php include("fend.inc"); ?>
 
