From 2cb1563f63386b35a69e460051aa9b4a2851d104 Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Wed, 30 May 2012 07:30:44 -0400
Subject: [PATCH] - Added (clickable) placeholders to client messaging function. - Added check so that the client password isn't inserted into the message (for security reasons).

---
 interface/web/sites/form/database.tform.php |   46 ++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 38 insertions(+), 8 deletions(-)

diff --git a/interface/web/sites/form/database.tform.php b/interface/web/sites/form/database.tform.php
index 7ea10ee..b26a1e4 100644
--- a/interface/web/sites/form/database.tform.php
+++ b/interface/web/sites/form/database.tform.php
@@ -29,6 +29,11 @@
 	Hint:
 	The ID field of the database table is not part of the datafield definition.
 	The ID field must be always auto incement (int or bigint).
+	
+	Search:
+	- searchable = 1 or searchable = 2 include the field in the search
+	- searchable = 1: this field will be the title of the search result
+	- searchable = 2: this field will be included in the description of the search result
 
 
 */
@@ -63,11 +68,22 @@
 			'formtype'	=> 'SELECT',
 			'default'	=> '',
 			'datasource'	=> array ( 	'type'	=> 'SQL',
-										'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} AND db_server = 1 ORDER BY server_name',
+										'querystring' => 'SELECT server_id,server_name FROM server WHERE mirror_server_id = 0 AND {AUTHSQL} AND db_server = 1 ORDER BY server_name',
 										'keyfield'=> 'server_id',
 										'valuefield'=> 'server_name'
 									 ),
 			'value'		=> ''
+		),
+		'parent_domain_id' => array (
+			'datatype'	=> 'INTEGER',
+			'formtype'	=> 'SELECT',
+			'default'	=> '',
+			'datasource'	=> array ( 	'type'	=> 'SQL',
+										'querystring' => "SELECT domain_id,domain FROM web_domain WHERE type = 'vhost' AND {AUTHSQL} ORDER BY domain",
+										'keyfield'=> 'domain_id',
+										'valuefield'=> 'domain'
+									 ),
+			'value'		=> array('0' => $app->tform->lng('select_site_txt'))
 		),
 		'type' => array (
 			'datatype'	=> 'VARCHAR',
@@ -80,16 +96,15 @@
 			'formtype'	=> 'TEXT',
 			'validators'	=> array ( 	0 => array (	'type'	=> 'NOTEMPTY',
 														'errmsg'=> 'database_name_error_empty'),
-										1 => array (	'type'	=> 'UNIQUE',
-														'errmsg'=> 'database_name_error_unique'),
-										2 => array (	'type'	=> 'REGEX',
+										1 => array (	'type'	=> 'REGEX',
 														'regex' => '/^[a-zA-Z0-9_]{2,64}$/',
 														'errmsg'=> 'database_name_error_regex'),
 									),
 			'default'	=> '',
 			'value'		=> '',
 			'width'		=> '30',
-			'maxlength'	=> '255'
+			'maxlength'	=> '255',
+			'searchable' => 1
 		),
 		'database_user' => array (
 			'datatype'	=> 'VARCHAR',
@@ -105,11 +120,13 @@
 			'default'	=> '',
 			'value'		=> '',
 			'width'		=> '30',
-			'maxlength'	=> '255'
+			'maxlength'	=> '255',
+			'searchable' => 2
 		),
 		'database_password' => array (
 			'datatype'	=> 'VARCHAR',
-			'formtype'	=> 'TEXT',
+			'formtype'	=> 'PASSWORD',
+			'encryption' => 'MYSQL',
 			'default'	=> '',
 			'value'		=> '',
 			'width'		=> '30',
@@ -124,7 +141,7 @@
 		'remote_access' => array (
 			'datatype'	=> 'VARCHAR',
 			'formtype'	=> 'CHECKBOX',
-			'default'	=> 'y',
+			'default'	=> 'n',
 			'value'		=> array(0 => 'n',1 => 'y')
 		),
 		'active' => array (
@@ -133,6 +150,19 @@
 			'default'	=> 'y',
 			'value'		=> array(0 => 'n',1 => 'y')
 		),
+	    'remote_ips' => array (
+	      'datatype'  => 'TEXT',
+	      'formtype'  => 'TEXT',
+	      'validators'  => array (  0 => array (  'type' => 'CUSTOM',
+	                                              'class' => 'validate_database',
+	                                              'function' => 'valid_ip_list',
+	                                              'errmsg' => 'database_remote_error_ips'),
+	                             ),
+	      'default' => '',
+	      'value'   => '',
+	      'width'   => '60',
+		  'searchable' => 2
+	    ),
 	##################################
 	# ENDE Datatable fields
 	##################################

--
Gitblit v1.9.1