| | |
| | | |
| | | if($type == 'getserverid'){ |
| | | $json = '{"serverid":"'; |
| | | $sql = "SELECT server_id FROM web_domain WHERE domain_id = ?? AND ".$app->tform->getAuthSQL('r'); |
| | | $sql = "SELECT server_id FROM web_domain WHERE domain_id = ? AND ".$app->tform->getAuthSQL('r'); |
| | | $server = $app->db->queryOneRecord($sql, $web_id); |
| | | $json .= $server['server_id']; |
| | | unset($server); |
| | |
| | | $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); |
| | |
| | | $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']; |
| | |
| | | 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'){ |