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/templates/web_domain_edit.htm |   41 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 40 insertions(+), 1 deletions(-)

diff --git a/interface/web/sites/templates/web_domain_edit.htm b/interface/web/sites/templates/web_domain_edit.htm
index 178c639..8a07871 100644
--- a/interface/web/sites/templates/web_domain_edit.htm
+++ b/interface/web/sites/templates/web_domain_edit.htm
@@ -122,6 +122,12 @@
 					{tmpl_var name='php'}
 				</select>
       </div>
+	  <div class="ctrlHolder fastcgi_php_version">
+      	<label for="fastcgi_php_version">{tmpl_var name='fastcgi_php_version_txt'}</label>
+        <select name="fastcgi_php_version" id="fastcgi_php_version" class="selectInput formLengthHalf">
+					{tmpl_var name='fastcgi_php_version'}
+				</select>
+      </div>
       <div class="ctrlHolder">
 				<p class="label">{tmpl_var name='active_txt'}</p>
 					<div class="multiField">
@@ -151,6 +157,7 @@
 				serverId = $(this).val();
 				adjustForm();
 				reloadWebIP();
+				reloadFastcgiPHPVersions();
 			});
 		}
 		adjustForm();
@@ -160,19 +167,35 @@
 			reloadWebIP();
 		});
 		
+		if(jQuery('#php').val() == 'fast-cgi' || jQuery('#php').val() == 'php-fpm'){
+			jQuery('.fastcgi_php_version:hidden').show();
+		} else {
+			jQuery('.fastcgi_php_version:visible').hide();
+		}
+		jQuery('#php').change(function(){
+			reloadFastcgiPHPVersions();
+			if(jQuery(this).val() == 'fast-cgi' || jQuery(this).val() == 'php-fpm'){
+				jQuery('.fastcgi_php_version:hidden').show();
+			} else {
+				jQuery('.fastcgi_php_version:visible').hide();
+			}
+		});
+		
 		function adjustForm(){
 			jQuery.getJSON('sites/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {server_id : serverId, type : "getservertype"}, function(data) {
 				if(data.servertype == "nginx"){
 					var selected = jQuery('#php').val();
 					jQuery('.apache').hide();
 					jQuery('.apache').hide();
+					jQuery('#php option[value="fast-cgi"]').hide();
 					jQuery('#php option[value="cgi"]').hide();
 					jQuery('#php option[value="mod"]').hide();
 					jQuery('#php option[value="suphp"]').hide();
-					if(selected != "no" && selected != "fast-cgi") jQuery('#php option[value="fast-cgi"]').attr('selected', 'selected');
+					if(selected != "no" && selected != "php-fpm") jQuery('#php option[value="php-fpm"]').attr('selected', 'selected');
 				} else {
 					jQuery('.apache').show();
 					jQuery('.apache').show();
+					jQuery('#php option[value="fast-cgi"]').show();
 					jQuery('#php option[value="cgi"]').show();
 					jQuery('#php option[value="mod"]').show();
 					jQuery('#php option[value="suphp"]').show();
@@ -184,5 +207,21 @@
 			loadOptionInto('ip_address','sites/ajax_get_ip.php?ip_type=IPv4&server_id='+serverId+'&client_group_id='+clientGroupId);
 			loadOptionInto('ipv6_address','sites/ajax_get_ip.php?ip_type=IPv6&server_id='+serverId+'&client_group_id='+clientGroupId);
 		}
+		
+		function reloadFastcgiPHPVersions() {
+			jQuery.getJSON('sites/ajax_get_json.php'+ '?' + Math.round(new Date().getTime()), {server_id : serverId, php_type : jQuery('#php').val(), type : "getphpfastcgi"}, function(data) {
+				var options = '<option value="">Default</option>';
+				var phpfastcgiselected = '';
+				$.each(data, function(key, val) {
+					if($('#fastcgi_php_version').val() == key){
+						phpfastcgiselected = ' selected="selected"';
+					} else {
+						phpfastcgiselected = '';
+					}
+					options += '<option value="'+key+'"'+phpfastcgiselected+'>'+val+'</option>';
+				});
+				$('#fastcgi_php_version').html(options);
+			});
+		}
 			
 </script>

--
Gitblit v1.9.1