From 8a072e707ee4e5bbf0ac3b77eb426428f2d6b308 Mon Sep 17 00:00:00 2001
From: wyrie <wyrie@ispconfig3>
Date: Wed, 20 Jan 2010 08:24:27 -0500
Subject: [PATCH] Fixed: FS#1034 - Gentoo portage sync too frequent 

---
 interface/web/dns/dns_wizard.php |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/interface/web/dns/dns_wizard.php b/interface/web/dns/dns_wizard.php
index 61d6bb6..4d0a2c9 100644
--- a/interface/web/dns/dns_wizard.php
+++ b/interface/web/dns/dns_wizard.php
@@ -81,7 +81,7 @@
 	$app->tpl->setVar("server_id",$server_id_option);
 	
 	// load the list of clients
-	$sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0";
+	$sql = "SELECT groupid, name FROM sys_group WHERE client_id > 0 ORDER BY name";
 	$clients = $app->db->queryAllRecords($sql);
 	$client_select = '';
 	if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
@@ -137,6 +137,11 @@
 	if(isset($_POST['ns2']) && $_POST['ns2'] == '') $error .= $app->lng('error_ns2_empty').'<br />';
 	if(isset($_POST['email']) && $_POST['email'] == '') $error .= $app->lng('error_email_empty').'<br />';
 	
+	if(!preg_match('/^[\w\.\-]{2,64}\.[a-zA-Z]{2,10}[\.]{0,1}$/',$_POST['domain'])) $error .= $app->lng('error_domain_regex').'<br />';
+	if(!preg_match('/^[\w\.\-]{2,64}\.[a-zA-Z]{2,10}[\.]{0,1}$/',$_POST['ns1'])) $error .= $app->lng('error_ns1_regex').'<br />';
+	if(!preg_match('/^[\w\.\-]{2,64}\.[a-zA-Z]{2,10}[\.]{0,1}$/',$_POST['ns2'])) $error .= $app->lng('error_ns2_regex').'<br />';
+	if(!preg_match('/^\w+[\w.-]*\w+@\w+[\w.-]*\w+\.[a-z]{2,10}$/i',$_POST['email'])) $error .= $app->lng('error_email_regex').'<br />';
+	
 	// make sure that the record belongs to the clinet group and not the admin group when a dmin inserts it
 	if($_SESSION["s"]["user"]["typ"] == 'admin' && isset($_POST['client_group_id'])) {
 		$sys_groupid = intval($_POST['client_group_id']);

--
Gitblit v1.9.1