From d41111a065e532f3f65e4eee7fed189ef949ade3 Mon Sep 17 00:00:00 2001
From: mcramer <m.cramer@pixcept.de>
Date: Fri, 14 Dec 2012 12:16:27 -0500
Subject: [PATCH] Fixed: Sorting as client can lead to sql errors due to amigious column sys_userid (JOINs)

---
 interface/web/dns/form/dns_soa.tform.php |   36 +++++++++++++++++++++++++++++++++---
 1 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/interface/web/dns/form/dns_soa.tform.php b/interface/web/dns/form/dns_soa.tform.php
index 16e9b11..c8306ae 100644
--- a/interface/web/dns/form/dns_soa.tform.php
+++ b/interface/web/dns/form/dns_soa.tform.php
@@ -37,6 +37,7 @@
 
 
 */
+global $app;
 
 $form["title"] 			= "DNS Zone";
 $form["description"] 	= "";
@@ -82,6 +83,13 @@
 		'origin' => array (
 			'datatype'	=> 'VARCHAR',
 			'formtype'	=> 'TEXT',
+            'filters'   => array( 0 => array( 'event' => 'SAVE',
+                                              'type' => 'IDNTOASCII'),
+                                  1 => array( 'event' => 'SHOW',
+                                              'type' => 'IDNTOUTF8'),
+                                  2 => array( 'event' => 'SAVE',
+                                              'type' => 'TOLOWER')
+                                ),
 			'validators'	=> array ( 	0 => array (	'type'	=> 'NOTEMPTY',
 														'errmsg'=> 'origin_error_empty'),
 										1 => array (	'type'	=> 'UNIQUE',
@@ -99,6 +107,13 @@
 		'ns' => array (
 			'datatype'	=> 'VARCHAR',
 			'formtype'	=> 'TEXT',
+            'filters'   => array( 0 => array( 'event' => 'SAVE',
+                                              'type' => 'IDNTOASCII'),
+                                  1 => array( 'event' => 'SHOW',
+                                              'type' => 'IDNTOUTF8'),
+                                  2 => array( 'event' => 'SAVE',
+                                              'type' => 'TOLOWER')
+                                ),
 			'validators'	=> array ( 	0 => array (	'type'	=> 'REGEX',
 														'regex' => '/^[\w\.\-]{1,255}$/',
 														'errmsg'=> 'ns_error_regex'),
@@ -112,6 +127,13 @@
 		'mbox' => array (
 			'datatype'	=> 'VARCHAR',
 			'formtype'	=> 'TEXT',
+            'filters'   => array( 0 => array( 'event' => 'SAVE',
+                                              'type' => 'IDNTOASCII'),
+                                  1 => array( 'event' => 'SHOW',
+                                              'type' => 'IDNTOUTF8'),
+                                  2 => array( 'event' => 'SAVE',
+                                              'type' => 'TOLOWER')
+                                ),
 			'validators'	=> array ( 	0 => array (	'type'	=> 'NOTEMPTY',
 														'errmsg'=> 'mbox_error_empty'),
 										1 => array (	'type'	=> 'REGEX',
@@ -195,6 +217,10 @@
 		'xfer' => array (
 			'datatype'	=> 'VARCHAR',
 			'formtype'	=> 'TEXT',
+			'validators'	=> array ( 	0 => array (	'type'	=> 'REGEX',
+														'regex' => '/^[0-9\.\,]{0,255}$/',
+														'errmsg'=> 'xfer_error_regex'),
+									),
 			'default'	=> '',
 			'value'		=> '',
 			'width'		=> '30',
@@ -203,10 +229,14 @@
 		'also_notify' => array (
 			'datatype'	=> 'VARCHAR',
 			'formtype'	=> 'TEXT',
-//			'validators'    => array (  0 => array (    'type'  => 'ISIPV4',
+			'validators'    => array (  0 => array (	'type'	=> 'REGEX',
+														'regex' => '/^(((25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|1?[0-9]{1,2})(;){0,1}(\ ){0,1}){0,10}$/',
+														'errmsg'=> 'also_notify_error_regex'
+													),
+//										0 => array (    'type'  => 'ISIPV4',
 //														'errmsg'=> 'also_notify_error_regex'
 //													),
-//									),
+									),
 			'default'	=> '',
 			'value'		=> '',
 			'width'		=> '30',
@@ -250,7 +280,7 @@
          	'class'   => 'plugin_listview',
      		'options' => array(
 				'listdef' => 'list/dns_a.list.php',
-				'sqlextwhere' => "zone = ".@intval(@$_REQUEST['id']),
+				'sqlextwhere' => "zone = ".@$app->functions->intval(@$_REQUEST['id']),
 				'sql_order_by' => "ORDER BY type, name"
 			)
         )

--
Gitblit v1.9.1