From 391e05cbee6ff84bce60b665be60b4e5f049ee7f Mon Sep 17 00:00:00 2001
From: Falko Timme <ft@falkotimme.com>
Date: Tue, 22 Oct 2013 12:48:51 -0400
Subject: [PATCH] - Display hostname next to IP (where available) in the jQuery IP suggestion box.

---
 interface/web/dns/dns_srv_edit.php |   26 +++++++++-----------------
 1 files changed, 9 insertions(+), 17 deletions(-)

diff --git a/interface/web/dns/dns_srv_edit.php b/interface/web/dns/dns_srv_edit.php
index a9d77fd..e41b554 100644
--- a/interface/web/dns/dns_srv_edit.php
+++ b/interface/web/dns/dns_srv_edit.php
@@ -77,18 +77,10 @@
 
 		// Split the 3 parts of the SRV Record apart
 		$split = explode(' ', $this->dataRecord['data']);
-
-		// Weight
-		$this->dataRecord['weight'] = $split[0];
-
-		// Port
-		$this->dataRecord['port'] = $split[1];
-
-		// Target
-		$this->dataRecord['target'] = $split[2];
-
-		// Bind the new datarecord to the template
-		$app->tpl->setVar($this->dataRecord);
+		
+		$app->tpl->setVar('weight', $split[0]);
+		$app->tpl->setVar('port', $split[1]);
+		$app->tpl->setVar('target', $split[2]);
 
 		parent::onShowEnd();
 	}
@@ -105,7 +97,7 @@
 		global $app, $conf;
 
 		// Get the parent soa record of the domain
-		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = '".$app->functions->intval($_POST["zone"])."' AND ".$app->tform->getAuthSQL('r'));
 
 		// Check if Domain belongs to user
 		if($soa["id"] != $_POST["zone"]) $app->tform->errorMessage .= $app->tform->wordbook["no_zone_perm"];
@@ -141,11 +133,11 @@
 		global $app, $conf;
 
 		//* Set the sys_groupid of the rr record to be the same then the sys_groupid of the soa record
-		$soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$soa = $app->db->queryOneRecord("SELECT sys_groupid,serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
 		$app->db->datalogUpdate('dns_rr', "sys_groupid = ".$soa['sys_groupid'], 'id', $this->id);
 
 		//* Update the serial number of the SOA record
-		$soa_id = intval($_POST["zone"]);
+		$soa_id = $app->functions->intval($_POST["zone"]);
 		$serial = $app->validate_dns->increase_serial($soa["serial"]);
 		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
 	}
@@ -154,8 +146,8 @@
 		global $app, $conf;
 
 		//* Update the serial number of the SOA record
-		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
-		$soa_id = intval($_POST["zone"]);
+		$soa = $app->db->queryOneRecord("SELECT serial FROM dns_soa WHERE id = '".$app->functions->intval($this->dataRecord["zone"])."' AND ".$app->tform->getAuthSQL('r'));
+		$soa_id = $app->functions->intval($_POST["zone"]);
 		$serial = $app->validate_dns->increase_serial($soa["serial"]);
 		$app->db->datalogUpdate('dns_soa', "serial = $serial", 'id', $soa_id);
 	}

--
Gitblit v1.9.1