From d22277878254cf33fd63ca1bf12b215f4e030a27 Mon Sep 17 00:00:00 2001
From: Marius Burkard <m.burkard@pixcept.de>
Date: Mon, 04 Jan 2016 05:12:49 -0500
Subject: [PATCH] - merged different fixes and updates from foreign branches
---
interface/web/sites/ajax_get_json.php | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/interface/web/sites/ajax_get_json.php b/interface/web/sites/ajax_get_json.php
index b9b9b03..c115b17 100644
--- a/interface/web/sites/ajax_get_json.php
+++ b/interface/web/sites/ajax_get_json.php
@@ -92,7 +92,7 @@
$sql_where .= ")";
}
- if($php_type == 'php-fpm'){
+ if($php_type == 'php-fpm' || ($php_type == 'hhvm' && $server_type == 'nginx')){
$php_records = $app->db->queryAllRecords("SELECT * FROM server_php WHERE php_fpm_init_script != '' AND php_fpm_ini_dir != '' AND php_fpm_pool_dir != '' AND server_id = ?".$sql_where, $server_id);
} elseif($php_type == 'fast-cgi'){
$php_records = $app->db->queryAllRecords("SELECT * FROM server_php WHERE php_fastcgi_binary != '' AND php_fastcgi_ini_dir != '' AND server_id = ?".$sql_where, $server_id);
@@ -100,7 +100,7 @@
$php_select = "";
if(is_array($php_records) && !empty($php_records)) {
foreach( $php_records as $php_record) {
- if($php_type == 'php-fpm'){
+ if($php_type == 'php-fpm' || ($php_type == 'hhvm' && $server_type == 'nginx')){
$php_version = $php_record['name'].':'.$php_record['php_fpm_init_script'].':'.$php_record['php_fpm_ini_dir'].':'.$php_record['php_fpm_pool_dir'];
} else {
$php_version = $php_record['name'].':'.$php_record['php_fastcgi_binary'].':'.$php_record['php_fastcgi_ini_dir'];
@@ -192,12 +192,13 @@
if ($type == 'getdirectivesnippet') {
$server_type = 'apache';
$web_config = $app->getconf->get_server_config($server_id, 'web');
- if (!empty($web_config['server_type']))
- $server_type = $web_config['server_type'];
+ if (!empty($web_config['server_type'])) $server_type = $web_config['server_type'];
- $snippets = $app->db->queryAllRecords("SELECT directive_snippets_id, name FROM directive_snippets WHERE customer_viewable = 'y' AND type = ? ORDER BY name ASC", $server_type);
+ $m_snippets = $app->db->queryAllRecords("SELECT directive_snippets_id, name FROM directive_snippets WHERE customer_viewable = 'y' AND active = 'y' AND master_directive_snippets_id > 0 AND type = ? ORDER BY name ASC", $server_type);
+
+ $snippets = $app->db->queryAllRecords("SELECT directive_snippets_id, name FROM directive_snippets WHERE customer_viewable = 'y' AND active = 'y' AND master_directive_snippets_id = 0 AND type = ? ORDER BY name ASC", $server_type);
- $json = json_encode($snippets);
+ $json = json_encode(array('m_snippets' => $m_snippets, 'snippets' => $snippets));
}
if($type == 'getclientssldata'){
--
Gitblit v1.9.1