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/vm/form/openvz_vm.tform.php |   26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/interface/web/vm/form/openvz_vm.tform.php b/interface/web/vm/form/openvz_vm.tform.php
index 0077ef2..ac7e8ef 100644
--- a/interface/web/vm/form/openvz_vm.tform.php
+++ b/interface/web/vm/form/openvz_vm.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,7 +68,7 @@
 			'formtype'	=> 'SELECT',
 			'default'	=> '',
 			'datasource'	=> array ( 	'type'	=> 'SQL',
-										'querystring' => 'SELECT server_id,server_name FROM server WHERE vserver_server = 1 AND mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name',
+										'querystring' => 'SELECT server_id,server_name FROM server WHERE vserver_server = 1 AND mirror_server_id = 0 ORDER BY server_name',
 										'keyfield'=> 'server_id',
 										'valuefield'=> 'server_name'
 									 ),
@@ -74,7 +79,7 @@
 			'formtype'	=> 'SELECT',
 			'default'	=> '',
 			'datasource'	=> array ( 	'type'	=> 'SQL',
-										'querystring' => 'SELECT ostemplate_id,template_name FROM openvz_ostemplate WHERE {AUTHSQL} ORDER BY template_name',
+										'querystring' => 'SELECT ostemplate_id,template_name FROM openvz_ostemplate WHERE 1 ORDER BY template_name',
 										'keyfield'=> 'ostemplate_id',
 										'valuefield'=> 'template_name'
 									 ),
@@ -84,11 +89,13 @@
 			'datatype'	=> 'INTEGER',
 			'formtype'	=> 'SELECT',
 			'default'	=> '',
+			/*
 			'datasource'	=> array ( 	'type'	=> 'SQL',
-										'querystring' => 'SELECT template_id,template_name FROM openvz_template WHERE {AUTHSQL} ORDER BY template_name',
+										'querystring' => 'SELECT template_id,template_name FROM openvz_template WHERE 1 ORDER BY template_name',
 										'keyfield'=> 'template_id',
 										'valuefield'=> 'template_name'
 									 ),
+			*/
 			'value'		=> ''
 		),
 		'ip_address' => array (
@@ -99,11 +106,12 @@
 									),
 			'default'	=> '',
 			'datasource'	=> array ( 	'type'	=> 'SQL',
-										'querystring' => "SELECT ip_address FROM openvz_ip WHERE reserved = 'n' AND (vm_id = 0 or vm_id = '{RECORDID}') AND {AUTHSQL} ORDER BY ip_address",
+										'querystring' => "SELECT ip_address FROM openvz_ip WHERE reserved = 'n' AND (vm_id = 0 or vm_id = '{RECORDID}') ORDER BY ip_address",
 										'keyfield'=> 'ip_address',
 										'valuefield'=> 'ip_address'
 									 ),
-			'value'		=> ''
+			'value'		=> '',
+			'searchable' => 2
 		),
 		'hostname' => array (
 			'datatype'	=> 'VARCHAR',
@@ -114,7 +122,8 @@
 			'default'	=> '',
 			'value'		=> '',
 			'width'		=> '30',
-			'maxlength'	=> '255'
+			'maxlength'	=> '255',
+			'searchable' => 1
 		),
 		'vm_password' => array (
 			'datatype'	=> 'VARCHAR',
@@ -156,7 +165,8 @@
 			'width'		=> '',
 			'maxlength'	=> '',
 			'rows'		=> '10',
-			'cols'		=> '30'
+			'cols'		=> '30',
+			'searchable' => 2
 		),
 	##################################
 	# ENDE Datatable fields
@@ -164,6 +174,7 @@
 	)
 );
 
+if($_SESSION["s"]["user"]["typ"] == 'admin') {
 $form["tabs"]['advanced'] = array (
 	'title' 	=> "Advanced",
 	'width' 	=> 100,
@@ -292,6 +303,7 @@
 	##################################
 	)
 );
+}
 
 
 ?>
\ No newline at end of file

--
Gitblit v1.9.1