From d6cd11df635941a4e7d35e6e45b4e59cb8bd4469 Mon Sep 17 00:00:00 2001
From: Florian Schaal <florian@schaal-24.de>
Date: Fri, 04 Sep 2015 07:57:19 -0400
Subject: [PATCH] default for mount backup_dir set to no

---
 interface/web/dns/form/dns_txt.tform.php |   47 +++++++++++++++++++++++++++++++----------------
 1 files changed, 31 insertions(+), 16 deletions(-)

diff --git a/interface/web/dns/form/dns_txt.tform.php b/interface/web/dns/form/dns_txt.tform.php
index 159629b..01b731a 100644
--- a/interface/web/dns/form/dns_txt.tform.php
+++ b/interface/web/dns/form/dns_txt.tform.php
@@ -86,7 +86,7 @@
 					'type' => 'TOLOWER')
 			),
 			'validators' => array (  0 => array ( 'type' => 'REGEX',
-					'regex' => '/^[\w\.\-]{0,255}$/',
+					'regex' => '/^[a-zA-Z0-9\.\-\_]{0,255}$/',
 					'errmsg'=> 'name_error_regex'),
 			),
 			'default' => '',
@@ -105,28 +105,39 @@
 		'data' => array (
 			'datatype' => 'VARCHAR',
 			'formtype' => 'TEXT',
-			'validators' => array (  0 => array ( 'type' => 'NOTEMPTY',
-					'errmsg'=> 'data_error_empty'),
+			'validators' => array (  
+				0 => array ( 
+					'type' => 'NOTEMPTY', 
+					'errmsg'=> 'data_error_empty'
+				),
+				1 => array ( 
+					'type' => 'REGEX', 
+					'regex' => "/^((?!v=DKIM).)*$/s", 
+					'errmsg'=> 'invalid_type_dkim'
+				),
+				2 => array ( 
+					'type' => 'REGEX', 
+					'regex' => "/^((?!v=DMARC1; ).)*$/s", 
+					'errmsg'=> 'invalid_type_dmarc'),
+				3 => array ( 
+					'type' => 'REGEX', 
+					'regex' => "/^((?!v=spf).)*$/s", 
+					'errmsg'=> 'invalid_type_spf'
+				),
 			),
 			'default' => '',
 			'value'  => '',
 			'width'  => '30',
 			'maxlength' => '255'
 		),
-		/*
-		'aux' => array (
-			'datatype'	=> 'INTEGER',
-			'formtype'	=> 'TEXT',
-			'default'	=> '0',
-			'value'		=> '',
-			'width'		=> '10',
-			'maxlength'	=> '10'
-		),
-		*/
 		'ttl' => array (
 			'datatype' => 'INTEGER',
 			'formtype' => 'TEXT',
-			'default' => '86400',
+			'validators' => array (  0 => array ( 'type' => 'RANGE',
+					'range' => '60:',
+					'errmsg'=> 'ttl_range_error'),
+			),
+			'default' => '3600',
 			'value'  => '',
 			'width'  => '10',
 			'maxlength' => '10'
@@ -159,6 +170,10 @@
 	)
 );
 
-
-
+if($_SESSION["s"]["user"]["typ"] == 'admin') {
+	unset($form["tabs"]['dns']['fields']['data']['validators']);
+	$form["tabs"]['dns']['fields']['data']['validators'][0]['type'] = 'NOTEMPTY';
+	$form["tabs"]['dns']['fields']['data']['validators'][0]['errmsg'] = 'data_error_empty';
+	$form["tabs"]['dns']['fields']['data']['maxlength'] = 512;
+}
 ?>

--
Gitblit v1.9.1